Interface LuceneIndexFieldTypeFactory

All Superinterfaces:
org.hibernate.search.engine.backend.types.dsl.IndexFieldTypeFactory

public interface LuceneIndexFieldTypeFactory extends org.hibernate.search.engine.backend.types.dsl.IndexFieldTypeFactory
  • Method Summary

    Modifier and Type
    Method
    Description
    default <F> org.hibernate.search.engine.backend.types.dsl.IndexFieldTypeOptionsStep<?,F>
    asNative(Class<F> valueType, LuceneFieldContributor<F> fieldContributor)
    Define a native field type on which projection is not allowed.
    <F> org.hibernate.search.engine.backend.types.dsl.IndexFieldTypeOptionsStep<?,F>
    asNative(Class<F> valueType, LuceneFieldContributor<F> fieldContributor, LuceneFieldValueExtractor<F> fieldValueExtractor)
    Define a native field type.

    Methods inherited from interface org.hibernate.search.engine.backend.types.dsl.IndexFieldTypeFactory

    as, asBigDecimal, asBigInteger, asBoolean, asByte, asByteVector, asDouble, asFloat, asFloatVector, asGeoPoint, asInstant, asInteger, asLocalDate, asLocalDateTime, asLocalTime, asLong, asMonthDay, asOffsetDateTime, asOffsetTime, asShort, asString, asVector, asYear, asYearMonth, asZonedDateTime, extension
  • Method Details

    • asNative

      <F> org.hibernate.search.engine.backend.types.dsl.IndexFieldTypeOptionsStep<?,F> asNative(Class<F> valueType, LuceneFieldContributor<F> fieldContributor, LuceneFieldValueExtractor<F> fieldValueExtractor)
      Define a native field type.

      A native field type has the following characteristics:

      • Hibernate Search doesn't know its exact type, so it cannot be configured precisely, except through the parameters passed to this method
      • When indexing, fields values will be passed to the field contributor. This contributor will translate the value into IndexableField instances which will be added to the document.
      • The predicate/sort DSLs cannot be used on fields of this type. It is recommended to create the predicate/sort/projections targeting these fields from native Lucene objects using LuceneSearchPredicateFactory.fromLuceneQuery(Query) or LuceneSearchSortFactory.fromLuceneSort(Sort)
      • The projection DSL can only be used on fields of this type of fieldValueExtractor is non-null. When projecting, the value extractor will be passed the IndexableField and will return the corresponding projected value of type F.
      Type Parameters:
      F - The type of the value.
      Parameters:
      valueType - The type of the value.
      fieldContributor - The field contributor.
      fieldValueExtractor - The field value extractor used when projecting on this field.
      Returns:
      A DSL step where the index field type can be defined in more details.
    • asNative

      default <F> org.hibernate.search.engine.backend.types.dsl.IndexFieldTypeOptionsStep<?,F> asNative(Class<F> valueType, LuceneFieldContributor<F> fieldContributor)
      Define a native field type on which projection is not allowed.

      See asNative(Class, LuceneFieldContributor, LuceneFieldValueExtractor).

      Type Parameters:
      F - The type of the value.
      Parameters:
      valueType - The type of the value.
      fieldContributor - The field contributor.
      Returns:
      A DSL step where the index field type can be defined in more details.