Class DenseVectorProperty.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<BuilderT>
co.elastic.clients.elasticsearch._types.mapping.PropertyBase.AbstractBuilder<DenseVectorProperty.Builder>
co.elastic.clients.elasticsearch._types.mapping.DenseVectorProperty.Builder
- All Implemented Interfaces:
WithJson<DenseVectorProperty.Builder>,ObjectBuilder<DenseVectorProperty>
- Enclosing class:
- DenseVectorProperty
public static class DenseVectorProperty.Builder
extends PropertyBase.AbstractBuilder<DenseVectorProperty.Builder>
implements ObjectBuilder<DenseVectorProperty>
Builder for
DenseVectorProperty.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds aDenseVectorProperty.Number of vector dimensions.The data type used to encode vectors.Iftrue, you can search this field using the kNN search API.An optional section that configures the kNN indexing algorithm.An optional section that configures the kNN indexing algorithm.protected DenseVectorProperty.Builderself()similarity(DenseVectorSimilarity value) The vector similarity metric to use in kNN search.Methods inherited from class co.elastic.clients.elasticsearch._types.mapping.PropertyBase.AbstractBuilder
dynamic, fields, fields, fields, ignoreAbove, meta, meta, properties, properties, properties, syntheticSourceKeepMethods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJsonMethods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
dims
Number of vector dimensions. Can't exceed4096. Ifdimsis not specified, it will be set to the length of the first vector added to the field.API name:
dims -
elementType
The data type used to encode vectors. The supported data types arefloat(default),byte, andbit.API name:
element_type -
index
Iftrue, you can search this field using the kNN search API.API name:
index -
indexOptions
An optional section that configures the kNN indexing algorithm. The HNSW algorithm has two internal parameters that influence how the data structure is built. These can be adjusted to improve the accuracy of results, at the expense of slower indexing speed.This parameter can only be specified when
indexistrue.API name:
index_options -
indexOptions
public final DenseVectorProperty.Builder indexOptions(Function<DenseVectorIndexOptions.Builder, ObjectBuilder<DenseVectorIndexOptions>> fn) An optional section that configures the kNN indexing algorithm. The HNSW algorithm has two internal parameters that influence how the data structure is built. These can be adjusted to improve the accuracy of results, at the expense of slower indexing speed.This parameter can only be specified when
indexistrue.API name:
index_options -
similarity
The vector similarity metric to use in kNN search.Documents are ranked by their vector field's similarity to the query vector. The
_scoreof each document will be derived from the similarity, in a way that ensures scores are positive and that a larger score corresponds to a higher ranking.Defaults to
l2_normwhenelement_typeisbitotherwise defaults tocosine.bitvectors only supportl2_normas their similarity metric.This parameter can only be specified when
indexistrue.API name:
similarity -
self
- Specified by:
selfin classPropertyBase.AbstractBuilder<DenseVectorProperty.Builder>
-
build
Builds aDenseVectorProperty.- Specified by:
buildin interfaceObjectBuilder<DenseVectorProperty>- Throws:
NullPointerException- if some of the required fields are null.
-