Module org.elasticsearch.server
Class DenseVectorFieldMapper
java.lang.Object
org.elasticsearch.index.mapper.Mapper
org.elasticsearch.index.mapper.FieldMapper
org.elasticsearch.index.mapper.vectors.DenseVectorFieldMapper
- All Implemented Interfaces:
Iterable<Mapper>
,ToXContent
,ToXContentFragment
A
FieldMapper
for indexing a dense vector of floats.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static final class
static enum
static interface
Interface for a function that takes a int and booleanstatic enum
static enum
Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.FieldMapper
FieldMapper.BuilderParams, FieldMapper.Conflicts, FieldMapper.CopyTo, FieldMapper.DimensionBuilder, FieldMapper.MergeValidator<T>, FieldMapper.MultiFields, FieldMapper.Parameter<T>, FieldMapper.Serializer<T>, FieldMapper.SerializerCheck<T>, FieldMapper.SyntheticSourceMode, FieldMapper.SyntheticSourceSupport, FieldMapper.TypeParser
Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.Mapper
Mapper.SourceKeepMode
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NodeFeature
static final int
static final NodeFeature
static final String
static final String
static final IndexVersion
static final IndexVersion
static final NodeFeature
static final IndexVersion
static final int
static final IndexVersion
static short
static int
static short
static final Map
<String, DenseVectorFieldMapper.ElementType> static final IndexVersion
static final int
static final FieldMapper.TypeParser
Fields inherited from class org.elasticsearch.index.mapper.FieldMapper
builderParams, COERCE_SETTING, deprecationLogger, IGNORE_MALFORMED_SETTING, mappedFieldType
Fields inherited from class org.elasticsearch.index.mapper.Mapper
SYNTHETIC_SOURCE_KEEP_FEATURE, SYNTHETIC_SOURCE_KEEP_INDEX_SETTING, SYNTHETIC_SOURCE_KEEP_PARAM
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
org.apache.lucene.codecs.KnnVectorsFormat
getKnnVectorsFormatForField
(org.apache.lucene.codecs.KnnVectorsFormat defaultFormat) Returns aFieldMapper.Builder
to be used for merging and serialization Implement as follows:return new MyBuilder(simpleName()).init(this);
static boolean
isNotUnitVector
(float magnitude) void
parse
(DocumentParserContext context) Parse the field value using the providedDocumentParserContext
.protected void
parseCreateField
(DocumentParserContext context) Parse the field value and populate the fields onDocumentParserContext.doc()
.boolean
Whether this mapper can handle an array value during document parsing.protected FieldMapper.SyntheticSourceSupport
Returns implementation of synthetic source support for the mapper.Methods inherited from class org.elasticsearch.index.mapper.FieldMapper
checkIncomingMergeType, copyTo, doValidate, doXContentBody, executeScript, fullPath, getTotalFieldsCount, hasScript, ignoreMalformed, indexAnalyzers, indexScriptValues, iterator, merge, multiFields, multiFieldsIterator, notFromDynamicTemplates, notInMultiFields, sourceKeepMode, sourcePathUsedBy, supportsParsingObject, syntheticFieldLoader, toXContent, typeName, validate
Methods inherited from class org.elasticsearch.index.mapper.Mapper
freezeAndDeduplicateFieldType, internFieldName, leafName, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Field Details
-
COSINE_MAGNITUDE_FIELD_SUFFIX
- See Also:
-
BBQ_MIN_DIMS
public static final int BBQ_MIN_DIMS- See Also:
-
INT4_QUANTIZATION
-
BIT_VECTORS
-
BBQ_FORMAT
-
MAGNITUDE_STORED_INDEX_VERSION
-
INDEXED_BY_DEFAULT_INDEX_VERSION
-
NORMALIZE_COSINE
-
DEFAULT_TO_INT8
-
LITTLE_ENDIAN_FLOAT_STORED_INDEX_VERSION
-
CONTENT_TYPE
- See Also:
-
MAX_DIMS_COUNT
public static short MAX_DIMS_COUNT -
MAX_DIMS_COUNT_BIT
public static int MAX_DIMS_COUNT_BIT -
MIN_DIMS_FOR_DYNAMIC_FLOAT_MAPPING
public static short MIN_DIMS_FOR_DYNAMIC_FLOAT_MAPPING -
MAGNITUDE_BYTES
public static final int MAGNITUDE_BYTES- See Also:
-
OVERSAMPLE_LIMIT
public static final int OVERSAMPLE_LIMIT- See Also:
-
namesToElementType
-
PARSER
-
-
Method Details
-
isNotUnitVector
public static boolean isNotUnitVector(float magnitude) -
fieldType
- Overrides:
fieldType
in classFieldMapper
-
parsesArrayValue
public boolean parsesArrayValue()Description copied from class:FieldMapper
Whether this mapper can handle an array value during document parsing. If true, when an array is encountered during parsing, the document parser will pass the whole array to the mapper. If false, the array is split into individual values and each value is passed to the mapper for parsing.- Overrides:
parsesArrayValue
in classFieldMapper
-
parse
Description copied from class:FieldMapper
Parse the field value using the providedDocumentParserContext
.- Overrides:
parse
in classFieldMapper
- Throws:
IOException
-
parseCreateField
Description copied from class:FieldMapper
Parse the field value and populate the fields onDocumentParserContext.doc()
. Implementations of this method should ensure that on failing to parse parser.currentToken() must be the current failing token- Specified by:
parseCreateField
in classFieldMapper
-
contentType
- Specified by:
contentType
in classFieldMapper
-
getMergeBuilder
Description copied from class:FieldMapper
Returns aFieldMapper.Builder
to be used for merging and serialization Implement as follows:return new MyBuilder(simpleName()).init(this);
- Specified by:
getMergeBuilder
in classFieldMapper
-
getKnnVectorsFormatForField
public org.apache.lucene.codecs.KnnVectorsFormat getKnnVectorsFormatForField(org.apache.lucene.codecs.KnnVectorsFormat defaultFormat) - Returns:
- the custom kNN vectors format that is configured for this field or
null
if the default format should be used.
-
syntheticSourceSupport
Description copied from class:FieldMapper
Returns implementation of synthetic source support for the mapper.
By default (meaningFieldMapper.SyntheticSourceSupport.Fallback
), an exact full copy of parsed field value is stored separately and used for synthetic source.Field mappers must override this method if they provide a more efficient field-specific implementation of synthetic source.
- Overrides:
syntheticSourceSupport
in classFieldMapper
- Returns:
FieldMapper.SyntheticSourceMode
-