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
Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.FieldMapper
FieldMapper.Conflicts, FieldMapper.CopyTo, FieldMapper.MergeValidator<T>, FieldMapper.MultiFields, FieldMapper.Parameter<T>, FieldMapper.Serializer<T>, FieldMapper.SerializerCheck<T>, FieldMapper.TypeParser
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final IndexVersion
static final IndexVersion
static final int
static final IndexVersion
static short
static short
static final IndexVersion
static final FieldMapper.TypeParser
Fields inherited from class org.elasticsearch.index.mapper.FieldMapper
COERCE_SETTING, copyTo, deprecationLogger, hasScript, IGNORE_MALFORMED_SETTING, mappedFieldType, multiFields, onScriptError
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);
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.Create aSourceLoader.SyntheticFieldLoader
to populate synthetic source.Methods inherited from class org.elasticsearch.index.mapper.FieldMapper
checkIncomingMergeType, copyTo, doValidate, doXContentBody, executeScript, getTotalFieldsCount, hasScript, ignoreMalformed, indexAnalyzers, indexScriptValues, iterator, merge, multiFields, multiFieldsIterator, name, notInMultiFields, sourcePathUsedBy, supportsParsingObject, toXContent, typeName, validate
Methods inherited from class org.elasticsearch.index.mapper.Mapper
freezeAndDeduplicateFieldType, internFieldName, simpleName, 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:
-
MAGNITUDE_STORED_INDEX_VERSION
-
INDEXED_BY_DEFAULT_INDEX_VERSION
-
NORMALIZE_COSINE
-
LITTLE_ENDIAN_FLOAT_STORED_INDEX_VERSION
-
CONTENT_TYPE
- See Also:
-
MAX_DIMS_COUNT
public static short MAX_DIMS_COUNT -
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:
-
PARSER
-
-
Method Details
-
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.
-
syntheticFieldLoader
Description copied from class:Mapper
Create aSourceLoader.SyntheticFieldLoader
to populate synthetic source.- Overrides:
syntheticFieldLoader
in classMapper
-