Interface LuceneIndexFieldTypeFactory

    • Method Detail

      • 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.
        valueType - The type of the value.
        fieldContributor - The field contributor.
        fieldValueExtractor - The field value extractor used when projecting on this field.
        A DSL step where the index field type can be defined in more details.