Interface LuceneIndexFieldTypeFactory
- All Superinterfaces:
IndexFieldTypeFactory
-
Method Summary
Modifier and TypeMethodDescriptiondefault <F> IndexFieldTypeOptionsStep<?,
F> asNative
(Class<F> valueType, LuceneFieldContributor<F> fieldContributor) Define a native field type on which projection is not allowed.<F> 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, asDouble, asFloat, asGeoPoint, asInstant, asInteger, asLocalDate, asLocalDateTime, asLocalTime, asLong, asMonthDay, asOffsetDateTime, asOffsetTime, asShort, asString, asYear, asYearMonth, asZonedDateTime, extension
-
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 intoIndexableField
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)
orLuceneSearchSortFactory.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 theIndexableField
and will return the corresponding projected value of typeF
.
- 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.
-