Interface LuceneIndexFieldTypeFactory

All Superinterfaces:
IndexFieldTypeFactory

public interface LuceneIndexFieldTypeFactory extends IndexFieldTypeFactory
  • Method Details

    • asNative

      <F> 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> 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.