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 classstatic final classstatic enumstatic interfaceInterface for a function that takes a int and booleanstatic enumstatic enumNested 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.TypeParserNested classes/interfaces inherited from class org.elasticsearch.index.mapper.Mapper
Mapper.SourceKeepModeNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final Stringstatic final Stringstatic final IndexVersionstatic final IndexVersionstatic final IndexVersionstatic final intstatic final IndexVersionstatic final shortstatic final intstatic final shortstatic final Map<String, DenseVectorFieldMapper.ElementType> static final IndexVersionstatic final intstatic final FieldMapper.TypeParserFields inherited from class org.elasticsearch.index.mapper.FieldMapper
builderParams, COERCE_SETTING, deprecationLogger, IGNORE_MALFORMED_SETTING, mappedFieldTypeFields inherited from class org.elasticsearch.index.mapper.Mapper
SYNTHETIC_SOURCE_KEEP_INDEX_SETTING, SYNTHETIC_SOURCE_KEEP_PARAMFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringorg.apache.lucene.codecs.KnnVectorsFormatgetKnnVectorsFormatForField(org.apache.lucene.codecs.KnnVectorsFormat defaultFormat) Returns aFieldMapper.Builderto be used for merging and serialization Implement as follows:return new MyBuilder(simpleName()).init(this);static booleanisNotUnitVector(float magnitude) voidparse(DocumentParserContext context) Parse the field value using the providedDocumentParserContext.protected voidparseCreateField(DocumentParserContext context) Parse the field value and populate the fields onDocumentParserContext.doc().booleanWhether this mapper can handle an array value during document parsing.protected FieldMapper.SyntheticSourceSupportReturns implementation of synthetic source support for the mapper.Methods inherited from class org.elasticsearch.index.mapper.FieldMapper
checkIncomingMergeType, copyTo, createTypeParserWithLegacySupport, doValidate, doXContentBody, executeScript, fullPath, getTotalFieldsCount, hasScript, ignoreMalformed, indexAnalyzers, indexScriptValues, iterator, merge, multiFields, multiFieldsIterator, notFromDynamicTemplates, notInMultiFields, sourceKeepMode, sourcePathUsedBy, supportsParsingObject, syntheticFieldLoader, toXContent, typeName, validateMethods inherited from class org.elasticsearch.index.mapper.Mapper
freezeAndDeduplicateFieldType, internFieldName, leafName, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods 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:
-
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 final short MAX_DIMS_COUNT- See Also:
-
MAX_DIMS_COUNT_BIT
public static final int MAX_DIMS_COUNT_BIT- See Also:
-
MIN_DIMS_FOR_DYNAMIC_FLOAT_MAPPING
public static final short MIN_DIMS_FOR_DYNAMIC_FLOAT_MAPPING- See Also:
-
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:
fieldTypein classFieldMapper
-
parsesArrayValue
public boolean parsesArrayValue()Description copied from class:FieldMapperWhether 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:
parsesArrayValuein classFieldMapper
-
parse
Description copied from class:FieldMapperParse the field value using the providedDocumentParserContext.- Overrides:
parsein classFieldMapper- Throws:
IOException
-
parseCreateField
Description copied from class:FieldMapperParse 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:
parseCreateFieldin classFieldMapper
-
contentType
- Specified by:
contentTypein classFieldMapper
-
getMergeBuilder
Description copied from class:FieldMapperReturns aFieldMapper.Builderto be used for merging and serialization Implement as follows:return new MyBuilder(simpleName()).init(this);- Specified by:
getMergeBuilderin 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
nullif the default format should be used.
-
syntheticSourceSupport
Description copied from class:FieldMapperReturns 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:
syntheticSourceSupportin classFieldMapper- Returns:
FieldMapper.SyntheticSourceMode
-