public class MapperService extends AbstractIndexComponent implements java.io.Closeable
Modifier and Type | Class and Description |
---|---|
static class |
MapperService.MergeReason
The reason why a mapping is being merged.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_MAPPING |
static boolean |
INDEX_MAPPER_DYNAMIC_DEFAULT |
static Setting<java.lang.Boolean> |
INDEX_MAPPER_DYNAMIC_SETTING |
static Setting<java.lang.Long> |
INDEX_MAPPING_DEPTH_LIMIT_SETTING |
static Setting<java.lang.Long> |
INDEX_MAPPING_NESTED_FIELDS_LIMIT_SETTING |
static Setting<java.lang.Boolean> |
INDEX_MAPPING_SINGLE_TYPE_SETTING |
static Setting<java.lang.Long> |
INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING |
static java.lang.String |
PERCOLATOR_LEGACY_TYPE_NAME
Deprecated.
|
deprecationLogger, indexSettings, logger
Constructor and Description |
---|
MapperService(IndexSettings indexSettings,
IndexAnalyzers indexAnalyzers,
NamedXContentRegistry xContentRegistry,
SimilarityService similarityService,
MapperRegistry mapperRegistry,
java.util.function.Supplier<QueryShardContext> queryShardContextSupplier) |
Modifier and Type | Method and Description |
---|---|
boolean |
allEnabled()
Returns true if the "_all" field is enabled on any type.
|
void |
close() |
org.apache.lucene.index.Term |
createUidTerm(java.lang.String type,
java.lang.String id)
Return a term that uniquely identifies the document, or
null if the type is not allowed. |
java.lang.Iterable<DocumentMapper> |
docMappers(boolean includingDefaultMapping)
returns an immutable iterator over current document mappers.
|
DocumentMapper |
documentMapper(java.lang.String type)
Return the
DocumentMapper for the given type. |
DocumentMapperParser |
documentMapperParser() |
DocumentMapperForType |
documentMapperWithAutoCreate(java.lang.String type)
Returns the document mapper created, including a mapping update if the
type has been dynamically created.
|
MappedFieldType |
fullName(java.lang.String fullName)
Returns the
MappedFieldType for the give fullName. |
static java.lang.String[] |
getAllMetaFields() |
IndexAnalyzers |
getIndexAnalyzers() |
ObjectMapper |
getObjectMapper(java.lang.String name) |
java.util.Set<java.lang.String> |
getParentTypes() |
boolean |
hasMapping(java.lang.String mappingType) |
boolean |
hasNested() |
org.apache.lucene.analysis.Analyzer |
indexAnalyzer() |
static boolean |
isMetadataField(java.lang.String fieldName) |
void |
merge(IndexMetaData indexMetaData,
MapperService.MergeReason reason,
boolean updateAllTypes) |
void |
merge(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> mappings,
MapperService.MergeReason reason,
boolean updateAllTypes) |
DocumentMapper |
merge(java.lang.String type,
CompressedXContent mappingSource,
MapperService.MergeReason reason,
boolean updateAllTypes) |
DocumentMapper |
parse(java.lang.String mappingType,
CompressedXContent mappingSource,
boolean applyDefault) |
static java.util.Map<java.lang.String,java.lang.Object> |
parseMapping(NamedXContentRegistry xContentRegistry,
java.lang.String mappingSource)
Parses the mappings (formatted as JSON) into a map
|
org.apache.lucene.analysis.Analyzer |
searchAnalyzer() |
org.apache.lucene.analysis.Analyzer |
searchQuoteAnalyzer() |
java.util.Collection<java.lang.String> |
simpleMatchToIndexNames(java.lang.String pattern)
Returns all the fields that match the given pattern.
|
java.util.Collection<java.lang.String> |
types()
Return the set of concrete types that have a mapping.
|
MappedFieldType |
unmappedFieldType(java.lang.String type)
Given a type (eg.
|
boolean |
updateMapping(IndexMetaData indexMetaData)
Update mapping by only merging the metadata that is different between received and stored entries
|
getIndexSettings, index
public static final java.lang.String DEFAULT_MAPPING
public static final Setting<java.lang.Long> INDEX_MAPPING_NESTED_FIELDS_LIMIT_SETTING
public static final Setting<java.lang.Long> INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING
public static final Setting<java.lang.Long> INDEX_MAPPING_DEPTH_LIMIT_SETTING
public static final boolean INDEX_MAPPER_DYNAMIC_DEFAULT
public static final Setting<java.lang.Boolean> INDEX_MAPPER_DYNAMIC_SETTING
public static final Setting<java.lang.Boolean> INDEX_MAPPING_SINGLE_TYPE_SETTING
@Deprecated public static final java.lang.String PERCOLATOR_LEGACY_TYPE_NAME
public MapperService(IndexSettings indexSettings, IndexAnalyzers indexAnalyzers, NamedXContentRegistry xContentRegistry, SimilarityService similarityService, MapperRegistry mapperRegistry, java.util.function.Supplier<QueryShardContext> queryShardContextSupplier)
public boolean hasNested()
public boolean allEnabled()
public java.lang.Iterable<DocumentMapper> docMappers(boolean includingDefaultMapping)
includingDefaultMapping
- indicates whether the iterator should contain the DEFAULT_MAPPING
document mapper.
As is this not really an active type, you would typically set this to falsepublic IndexAnalyzers getIndexAnalyzers()
public DocumentMapperParser documentMapperParser()
public static java.util.Map<java.lang.String,java.lang.Object> parseMapping(NamedXContentRegistry xContentRegistry, java.lang.String mappingSource) throws java.lang.Exception
java.lang.Exception
public boolean updateMapping(IndexMetaData indexMetaData) throws java.io.IOException
java.io.IOException
public void merge(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> mappings, MapperService.MergeReason reason, boolean updateAllTypes)
public void merge(IndexMetaData indexMetaData, MapperService.MergeReason reason, boolean updateAllTypes)
public DocumentMapper merge(java.lang.String type, CompressedXContent mappingSource, MapperService.MergeReason reason, boolean updateAllTypes)
public DocumentMapper parse(java.lang.String mappingType, CompressedXContent mappingSource, boolean applyDefault) throws MapperParsingException
MapperParsingException
public boolean hasMapping(java.lang.String mappingType)
public java.util.Collection<java.lang.String> types()
public DocumentMapper documentMapper(java.lang.String type)
DocumentMapper
for the given type. By using the special
"_default_" type, you can get a DocumentMapper
for
the default mapping.public DocumentMapperForType documentMapperWithAutoCreate(java.lang.String type)
public MappedFieldType fullName(java.lang.String fullName)
MappedFieldType
for the give fullName.
If multiple types have fields with the same full name, the first is returned.public java.util.Collection<java.lang.String> simpleMatchToIndexNames(java.lang.String pattern)
public ObjectMapper getObjectMapper(java.lang.String name)
public MappedFieldType unmappedFieldType(java.lang.String type)
public org.apache.lucene.analysis.Analyzer indexAnalyzer()
public org.apache.lucene.analysis.Analyzer searchAnalyzer()
public org.apache.lucene.analysis.Analyzer searchQuoteAnalyzer()
public java.util.Set<java.lang.String> getParentTypes()
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public static boolean isMetadataField(java.lang.String fieldName)
public static java.lang.String[] getAllMetaFields()
public org.apache.lucene.index.Term createUidTerm(java.lang.String type, java.lang.String id)
null
if the type is not allowed.