Annotation Type VectorField
@Documented
@Target({METHOD,FIELD})
@Retention(RUNTIME)
@Repeatable(List.class)
@PropertyMapping(processor=@PropertyMappingAnnotationProcessorRef(type=org.hibernate.search.mapper.pojo.mapping.definition.annotation.processing.impl.VectorFieldAnnotationProcessor.class,retrieval=CONSTRUCTOR))
@Incubating
public @interface VectorField
Maps an entity property to a vector field in the index.
This annotation will work for any float/byte
array.
Vector fields are to be used in k-NN search, when the distance between a queried and stored vectors is computed and k nearest vectors are selected as the results.
- See Also:
-
Nested Class Summary
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionint
int
int
-
Element Details
-
name
String name- Returns:
- The name of the index field.
- Default:
""
-
projectable
Projectable projectable- Returns:
- Whether this field should be projectable.
- See Also:
- Default:
DEFAULT
-
searchable
Searchable searchable- Returns:
- Whether this field should be searchable.
- See Also:
- Default:
DEFAULT
-
dimension
int dimension- Returns:
- The size of the vector.
- Default:
-2147483648
-
vectorSimilarity
VectorSimilarity vectorSimilarity- Returns:
- How vector similarity is calculated.
- See Also:
- Default:
DEFAULT
-
indexNullAs
String indexNullAs- Returns:
- A value used instead of null values when indexing.
- Default:
"__HibernateSearch_indexNullAs_default"
-
efConstruction
int efConstruction- Returns:
- The size of the dynamic list used during k-NN graph creation. Higher values lead to a more accurate graph but slower indexing speed. Default value is backend-specific.
- Default:
-2147483648
-
m
int m- Returns:
- The number of neighbors each node will be connected to in the HNSW graph. Modifying this value will have an impact on memory consumption. It is recommended to keep this value between 2 and 100. Default value is backend-specific.
- Default:
-2147483648
-
valueBridge
ValueBridgeRef valueBridge- Returns:
- A reference to the value bridge to use for this field.
Must not be set if
valueBinder()
is set. - See Also:
- Default:
@org.hibernate.search.mapper.pojo.bridge.mapping.annotation.ValueBridgeRef
-
valueBinder
ValueBinderRef valueBinder- Returns:
- A reference to the value binder to use for this field.
Must not be set if
valueBridge()
is set. - See Also:
- Default:
@org.hibernate.search.mapper.pojo.bridge.mapping.annotation.ValueBinderRef
-
extraction
ContainerExtraction extraction- Returns:
- A definition of container extractors to be applied to the property,
allowing the binding of a value bridge to container elements.
By default, Hibernate Search will not try to apply a set of extractors.
Vector fields require an explicit extraction path being specified,
i.e. extraction must be set to
DEFAULT
and a nonempty array of container value extractor names provided as avalue
:@ContainerExtraction(extract = ContainerExtract.DEFAULT, value = { ... })
- See Also:
- Default:
@org.hibernate.search.mapper.pojo.extractor.mapping.annotation.ContainerExtraction(extract=NO)
-