java.lang.Object
org.elasticsearch.index.mapper.Mapping
- All Implemented Interfaces:
ToXContent,ToXContentFragment
Wrapper around everything that defines a mapping, without references to
utility classes like MapperService, ...
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params -
Field Summary
FieldsFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionMapping(RootObjectMapper rootObjectMapper, MetadataFieldMapper[] metadataMappers, Map<String, Object> meta) -
Method Summary
Modifier and TypeMethodDescriptiongetMeta()Returns the meta section for the current mapping<T extends MetadataFieldMapper>
TgetMetadataMapperByClass(Class<T> clazz) Get the metadata mapper with the given class.getMetadataMapperByName(String mapperName) getRoot()Returns the root object for the current mappingsyntheticFieldLoader(SourceFilter filter) syntheticVectorsLoader(SourceFilter filter) Returns aSourceLoader.SyntheticVectorsLoaderthat loads synthetic vector values from a source document, optionally applying aSourceFilter.Outputs this mapping instance and returns it inCompressedXContentformattoString()toXContent(XContentBuilder builder, ToXContent.Params params) withFieldsBudget(long fieldsBudget) Returns a copy of this mapper that ensures that the number of fields isn't greater than the provided fields budget.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Field Details
-
EMPTY
-
-
Constructor Details
-
Mapping
public Mapping(RootObjectMapper rootObjectMapper, MetadataFieldMapper[] metadataMappers, Map<String, Object> meta)
-
-
Method Details
-
toCompressedXContent
Outputs this mapping instance and returns it inCompressedXContentformat- Returns:
- the
CompressedXContentrepresentation of this mapping instance
-
getRoot
Returns the root object for the current mapping -
getMeta
Returns the meta section for the current mapping -
getMetadataMapperByClass
Get the metadata mapper with the given class. -
getMetadataMapperByName
-
syntheticVectorsLoader
Returns aSourceLoader.SyntheticVectorsLoaderthat loads synthetic vector values from a source document, optionally applying aSourceFilter.The
filter, if provided, can be used to limit which fields from the mapping are considered when computing synthetic vectors. This allows for performance optimizations or targeted vector extraction.- Parameters:
filter- an optionalSourceFilterto restrict the fields considered during loading; may benullto indicate no filtering- Returns:
- a
SourceLoader.SyntheticVectorsLoaderfor extracting synthetic vectors, potentially using the provided filter
-
syntheticFieldLoader
-
ignoredSourceFormat
-
withFieldsBudget
Returns a copy of this mapper that ensures that the number of fields isn't greater than the provided fields budget.- Parameters:
fieldsBudget- the maximum number of fields this mapping may have
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
toString
-