Class ElasticsearchIndexFieldTypeFactoryImpl
java.lang.Object
org.hibernate.search.backend.elasticsearch.types.dsl.impl.ElasticsearchIndexFieldTypeFactoryImpl
- All Implemented Interfaces:
ElasticsearchIndexFieldTypeFactory,ElasticsearchIndexFieldTypeBuildContext,IndexFieldTypeFactory
public class ElasticsearchIndexFieldTypeFactoryImpl
extends Object
implements ElasticsearchIndexFieldTypeFactory, ElasticsearchIndexFieldTypeBuildContext
-
Constructor Summary
ConstructorsConstructorDescriptionElasticsearchIndexFieldTypeFactoryImpl(EventContext eventContext, BackendMapperContext backendMapperContext, com.google.gson.Gson userFacingGson, ElasticsearchDefaultFieldFormatProvider defaultFieldFormatProvider, IndexFieldTypeDefaultsProvider typeDefaultsProvider, ElasticsearchVectorFieldTypeMappingContributor vectorFieldTypeMappingContributor) -
Method Summary
Modifier and TypeMethodDescription<F> StandardIndexFieldTypeOptionsStep<?,F> Define a field type whose values are represented as a given type in Hibernate Search.Define a field type whose values are represented as aBigDecimalin Hibernate Search.Define a field type whose values are represented as aBigIntegerin Hibernate Search.Define a field type whose values are represented as aBooleanin Hibernate Search.asByte()Define a field type whose values are represented as aBytein Hibernate Search.VectorFieldTypeOptionsStep<?,byte[]> Define a field type intended for use in vector search and whose values are represented as abyte[]in Hibernate Search.asDouble()Define a field type whose values are represented as aDoublein Hibernate Search.asFloat()Define a field type whose values are represented as aFloatin Hibernate Search.VectorFieldTypeOptionsStep<?,float[]> Define a field type intended for use in vector search and whose values are represented as afloat[]in Hibernate Search.Define a field type whose values are represented as aGeoPointin Hibernate Search.Define a field type whose values are represented as anInstantin Hibernate Search.Define a field type whose values are represented as anIntegerin Hibernate Search.Define a field type whose values are represented as aLocalDatein Hibernate Search.Define a field type whose values are represented as aLocalDateTimein Hibernate Search.Define a field type whose values are represented as aLocalTimein Hibernate Search.asLong()Define a field type whose values are represented as aLongin Hibernate Search.Define a field type whose values are represented as aMonthDayin Hibernate Search.asNative()Define a native field type.Define a field type whose values are represented as anOffsetDateTimein Hibernate Search.Define a field type whose values are represented as anOffsetTimein Hibernate Search.asShort()Define a field type whose values are represented as aShortin Hibernate Search.asString()Define a field type whose values are represented as aStringin Hibernate Search.<F> VectorFieldTypeOptionsStep<?,F> Define a vector field type whose values are represented as a given type in Hibernate Search.asYear()Define a field type whose values are represented as aYearin Hibernate Search.Define a field type whose values are represented as aYearMonthin Hibernate Search.Define a field type whose values are represented as aZonedDateTimein Hibernate Search.com.google.gson.Gsonhints()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.search.engine.backend.types.dsl.IndexFieldTypeFactory
extension
-
Constructor Details
-
ElasticsearchIndexFieldTypeFactoryImpl
public ElasticsearchIndexFieldTypeFactoryImpl(EventContext eventContext, BackendMapperContext backendMapperContext, com.google.gson.Gson userFacingGson, ElasticsearchDefaultFieldFormatProvider defaultFieldFormatProvider, IndexFieldTypeDefaultsProvider typeDefaultsProvider, ElasticsearchVectorFieldTypeMappingContributor vectorFieldTypeMappingContributor)
-
-
Method Details
-
as
Description copied from interface:IndexFieldTypeFactoryDefine a field type whose values are represented as a given type in Hibernate Search.Note this method will return a "generic" DSL step that does not offer any type-specific options. When possible, prefer the other methods such as
IndexFieldTypeFactory.asString()orIndexFieldTypeFactory.asInteger().- Specified by:
asin interfaceIndexFieldTypeFactory- Type Parameters:
F- The type of values for this field type.- Parameters:
valueType- The type of values for this field type.- Returns:
- A DSL step where the index field type can be defined in more details.
-
asString
Description copied from interface:IndexFieldTypeFactoryDefine a field type whose values are represented as aStringin Hibernate Search.- Specified by:
asStringin interfaceIndexFieldTypeFactory- Returns:
- A DSL step where the index field type can be defined in more details.
-
asInteger
Description copied from interface:IndexFieldTypeFactoryDefine a field type whose values are represented as anIntegerin Hibernate Search.- Specified by:
asIntegerin interfaceIndexFieldTypeFactory- Returns:
- A DSL step where the index field type can be defined in more details.
-
asLong
Description copied from interface:IndexFieldTypeFactoryDefine a field type whose values are represented as aLongin Hibernate Search.- Specified by:
asLongin interfaceIndexFieldTypeFactory- Returns:
- A DSL step where the index field type can be defined in more details.
-
asBoolean
Description copied from interface:IndexFieldTypeFactoryDefine a field type whose values are represented as aBooleanin Hibernate Search.- Specified by:
asBooleanin interfaceIndexFieldTypeFactory- Returns:
- A DSL step where the index field type can be defined in more details.
-
asByte
Description copied from interface:IndexFieldTypeFactoryDefine a field type whose values are represented as aBytein Hibernate Search.- Specified by:
asBytein interfaceIndexFieldTypeFactory- Returns:
- A DSL step where the index field type can be defined in more details.
-
asShort
Description copied from interface:IndexFieldTypeFactoryDefine a field type whose values are represented as aShortin Hibernate Search.- Specified by:
asShortin interfaceIndexFieldTypeFactory- Returns:
- A DSL step where the index field type can be defined in more details.
-
asFloat
Description copied from interface:IndexFieldTypeFactoryDefine a field type whose values are represented as aFloatin Hibernate Search.- Specified by:
asFloatin interfaceIndexFieldTypeFactory- Returns:
- A DSL step where the index field type can be defined in more details.
-
asDouble
Description copied from interface:IndexFieldTypeFactoryDefine a field type whose values are represented as aDoublein Hibernate Search.- Specified by:
asDoublein interfaceIndexFieldTypeFactory- Returns:
- A DSL step where the index field type can be defined in more details.
-
asLocalDate
Description copied from interface:IndexFieldTypeFactoryDefine a field type whose values are represented as aLocalDatein Hibernate Search.- Specified by:
asLocalDatein interfaceIndexFieldTypeFactory- Returns:
- A DSL step where the index field type can be defined in more details.
-
asLocalDateTime
Description copied from interface:IndexFieldTypeFactoryDefine a field type whose values are represented as aLocalDateTimein Hibernate Search.- Specified by:
asLocalDateTimein interfaceIndexFieldTypeFactory- Returns:
- A DSL step where the index field type can be defined in more details.
-
asLocalTime
Description copied from interface:IndexFieldTypeFactoryDefine a field type whose values are represented as aLocalTimein Hibernate Search.- Specified by:
asLocalTimein interfaceIndexFieldTypeFactory- Returns:
- A DSL step where the index field type can be defined in more details.
-
asInstant
Description copied from interface:IndexFieldTypeFactoryDefine a field type whose values are represented as anInstantin Hibernate Search.- Specified by:
asInstantin interfaceIndexFieldTypeFactory- Returns:
- A DSL step where the index field type can be defined in more details.
-
asZonedDateTime
Description copied from interface:IndexFieldTypeFactoryDefine a field type whose values are represented as aZonedDateTimein Hibernate Search.- Specified by:
asZonedDateTimein interfaceIndexFieldTypeFactory- Returns:
- A DSL step where the index field type can be defined in more details.
-
asYear
Description copied from interface:IndexFieldTypeFactoryDefine a field type whose values are represented as aYearin Hibernate Search.- Specified by:
asYearin interfaceIndexFieldTypeFactory- Returns:
- A DSL step where the index field type can be defined in more details.
-
asYearMonth
Description copied from interface:IndexFieldTypeFactoryDefine a field type whose values are represented as aYearMonthin Hibernate Search.- Specified by:
asYearMonthin interfaceIndexFieldTypeFactory- Returns:
- A DSL step where the index field type can be defined in more details.
-
asMonthDay
Description copied from interface:IndexFieldTypeFactoryDefine a field type whose values are represented as aMonthDayin Hibernate Search.- Specified by:
asMonthDayin interfaceIndexFieldTypeFactory- Returns:
- A DSL step where the index field type can be defined in more details.
-
asOffsetDateTime
Description copied from interface:IndexFieldTypeFactoryDefine a field type whose values are represented as anOffsetDateTimein Hibernate Search.- Specified by:
asOffsetDateTimein interfaceIndexFieldTypeFactory- Returns:
- A DSL step where the index field type can be defined in more details.
-
asOffsetTime
Description copied from interface:IndexFieldTypeFactoryDefine a field type whose values are represented as anOffsetTimein Hibernate Search.- Specified by:
asOffsetTimein interfaceIndexFieldTypeFactory- Returns:
- A DSL step where the index field type can be defined in more details.
-
asGeoPoint
Description copied from interface:IndexFieldTypeFactoryDefine a field type whose values are represented as aGeoPointin Hibernate Search.- Specified by:
asGeoPointin interfaceIndexFieldTypeFactory- Returns:
- A DSL step where the index field type can be defined in more details.
-
asBigDecimal
Description copied from interface:IndexFieldTypeFactoryDefine a field type whose values are represented as aBigDecimalin Hibernate Search.- Specified by:
asBigDecimalin interfaceIndexFieldTypeFactory- Returns:
- A DSL step where the index field type can be defined in more details.
-
asBigInteger
Description copied from interface:IndexFieldTypeFactoryDefine a field type whose values are represented as aBigIntegerin Hibernate Search.- Specified by:
asBigIntegerin interfaceIndexFieldTypeFactory- Returns:
- A DSL step where the index field type can be defined in more details.
-
asVector
Description copied from interface:IndexFieldTypeFactoryDefine a vector field type whose values are represented as a given type in Hibernate Search.When possible, prefer the other methods such as
IndexFieldTypeFactory.asByteVector()orIndexFieldTypeFactory.asFloatVector()to avoid unnecessary type checks.- Specified by:
asVectorin interfaceIndexFieldTypeFactory- Type Parameters:
F- The type of values for this field type.- Parameters:
valueType- The type of values for this field type. Should be an array type likebyte[]orfloat[].- Returns:
- A DSL step where the index vector field type can be defined in more details.
-
asByteVector
Description copied from interface:IndexFieldTypeFactoryDefine a field type intended for use in vector search and whose values are represented as abyte[]in Hibernate Search.- Specified by:
asByteVectorin interfaceIndexFieldTypeFactory- Returns:
- A DSL step where the index field type can be defined in more details.
-
asFloatVector
Description copied from interface:IndexFieldTypeFactoryDefine a field type intended for use in vector search and whose values are represented as afloat[]in Hibernate Search.- Specified by:
asFloatVectorin interfaceIndexFieldTypeFactory- Returns:
- A DSL step where the index field type can be defined in more details.
-
asNative
Description copied from interface:ElasticsearchIndexFieldTypeFactoryDefine a native field type.A native field type has the following characteristics:
- Hibernate Search doesn't know its exact type, so it must be entirely defined as a JSON object,
provided as the
mappingJsonStringparameter - When indexing, fields of this type must be populated with JSON. The field has a string type, but the string is interpreted as JSON, so it can contain a boolean, an integer, or even an object.
- The predicate/sort/projection DSLs have only limited support for fields of this type.
Some features may not work and throw an exception, such as phrase predicates.
It is recommended to create the predicate/sort/projections targeting these fields from JSON
using
ElasticsearchSearchPredicateFactory.fromJson(String)orElasticsearchSearchSortFactory.fromJson(String)
- Specified by:
asNativein interfaceElasticsearchIndexFieldTypeFactory- Returns:
- A DSL step where the index field type can be defined in more details.
- Hibernate Search doesn't know its exact type, so it must be entirely defined as a JSON object,
provided as the
-
getEventContext
- Specified by:
getEventContextin interfaceElasticsearchIndexFieldTypeBuildContext
-
getUserFacingGson
public com.google.gson.Gson getUserFacingGson()- Specified by:
getUserFacingGsonin interfaceElasticsearchIndexFieldTypeBuildContext
-
getDefaultFieldFormatProvider
- Specified by:
getDefaultFieldFormatProviderin interfaceElasticsearchIndexFieldTypeBuildContext
-
hints
- Specified by:
hintsin interfaceElasticsearchIndexFieldTypeBuildContext
-