public class MapperService extends AbstractIndexComponent
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.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,
AnalysisService analysisService,
SimilarityService similarityService,
MapperRegistry mapperRegistry,
java.util.function.Supplier<QueryShardContext> queryShardContextSupplier) |
Modifier and Type | Method and Description |
---|---|
AnalysisService |
analysisService() |
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() |
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(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> mappings,
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(java.lang.String mappingSource) |
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) |
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
@Deprecated public static final java.lang.String PERCOLATOR_LEGACY_TYPE_NAME
public MapperService(IndexSettings indexSettings, AnalysisService analysisService, SimilarityService similarityService, MapperRegistry mapperRegistry, java.util.function.Supplier<QueryShardContext> queryShardContextSupplier)
public boolean hasNested()
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 AnalysisService analysisService()
public DocumentMapperParser documentMapperParser()
public static java.util.Map<java.lang.String,java.lang.Object> parseMapping(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, boolean updateAllTypes) throws MapperParsingException
MapperParsingException
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 static boolean isMetadataField(java.lang.String fieldName)
public static java.lang.String[] getAllMetaFields()