public class MapperService extends AbstractIndexComponent implements 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 String |
DEFAULT_MAPPING |
static boolean |
INDEX_MAPPER_DYNAMIC_DEFAULT |
static String |
INDEX_MAPPER_DYNAMIC_SETTING |
static String |
INDEX_MAPPING_NESTED_FIELDS_LIMIT_SETTING |
deprecationLogger, index, logger
Constructor and Description |
---|
MapperService(Index index,
IndexSettingsService indexSettingsService,
AnalysisService analysisService,
SimilarityLookupService similarityLookupService,
ScriptService scriptService,
MapperRegistry mapperRegistry) |
MapperService(Index index,
Settings indexSettings,
AnalysisService analysisService,
SimilarityLookupService similarityLookupService,
ScriptService scriptService,
MapperRegistry mapperRegistry) |
Modifier and Type | Method and Description |
---|---|
void |
addTypeListener(DocumentTypeListener listener) |
AnalysisService |
analysisService() |
void |
close() |
Iterable<DocumentMapper> |
docMappers(boolean includingDefaultMapping)
returns an immutable iterator over current document mappers.
|
DocumentMapper |
documentMapper(String type)
Return the
DocumentMapper for the given type. |
DocumentMapperParser |
documentMapperParser() |
DocumentMapperForType |
documentMapperWithAutoCreate(String type)
Returns the document mapper created, including a mapping update if the
type has been dynamically created.
|
MappedFieldType |
fullName(String fullName)
Returns the
MappedFieldType for the give fullName. |
static String[] |
getAllMetaFields() |
ObjectMapper |
getObjectMapper(String name,
String[] types) |
Set<String> |
getParentTypes() |
boolean |
hasMapping(String mappingType) |
boolean |
hasNested() |
org.apache.lucene.analysis.Analyzer |
indexAnalyzer() |
MappedFieldType |
indexName(String indexName)
Returns an
MappedFieldType which has the given index name. |
static boolean |
isMetadataField(String fieldName) |
void |
merge(Map<String,Map<String,Object>> mappings,
boolean updateAllTypes) |
DocumentMapper |
merge(String type,
CompressedXContent mappingSource,
MapperService.MergeReason reason,
boolean updateAllTypes) |
DocumentMapper |
parse(String mappingType,
CompressedXContent mappingSource,
boolean applyDefault) |
static Map<String,Object> |
parseMapping(String mappingSource) |
void |
removeTypeListener(DocumentTypeListener listener) |
ObjectMapper |
resolveClosestNestedObjectMapper(String fieldName)
Resolves the closest inherited
ObjectMapper that is nested. |
org.apache.lucene.analysis.Analyzer |
searchAnalyzer() |
org.apache.lucene.search.Query |
searchFilter(String... types)
A filter for search.
|
org.apache.lucene.analysis.Analyzer |
searchQuoteAnalyzer() |
Collection<String> |
simpleMatchToIndexNames(String pattern)
Returns all the fields that match the given pattern.
|
Collection<String> |
simpleMatchToIndexNames(String pattern,
String[] types) |
MappedFieldType |
smartNameFieldType(String smartName) |
MappedFieldType |
smartNameFieldType(String smartName,
String[] types) |
Collection<String> |
types()
Return the set of concrete types that have a mapping.
|
MappedFieldType |
unmappedFieldType(String type)
Given a type (eg.
|
index, indexSettings
public static final String DEFAULT_MAPPING
public static final String INDEX_MAPPER_DYNAMIC_SETTING
public static final String INDEX_MAPPING_NESTED_FIELDS_LIMIT_SETTING
public static final boolean INDEX_MAPPER_DYNAMIC_DEFAULT
@Inject public MapperService(Index index, IndexSettingsService indexSettingsService, AnalysisService analysisService, SimilarityLookupService similarityLookupService, ScriptService scriptService, MapperRegistry mapperRegistry)
public MapperService(Index index, Settings indexSettings, AnalysisService analysisService, SimilarityLookupService similarityLookupService, ScriptService scriptService, MapperRegistry mapperRegistry)
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public boolean hasNested()
public 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 void addTypeListener(DocumentTypeListener listener)
public void removeTypeListener(DocumentTypeListener listener)
public static Map<String,Object> parseMapping(String mappingSource) throws Exception
Exception
public void merge(Map<String,Map<String,Object>> mappings, boolean updateAllTypes) throws MapperParsingException
MapperParsingException
public DocumentMapper merge(String type, CompressedXContent mappingSource, MapperService.MergeReason reason, boolean updateAllTypes)
public DocumentMapper parse(String mappingType, CompressedXContent mappingSource, boolean applyDefault) throws MapperParsingException
MapperParsingException
public boolean hasMapping(String mappingType)
public Collection<String> types()
public DocumentMapper documentMapper(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(String type)
@Nullable public org.apache.lucene.search.Query searchFilter(String... types)
public MappedFieldType indexName(String indexName)
MappedFieldType
which has the given index name.
If multiple types have fields with the same index name, the first is returned.public MappedFieldType fullName(String fullName)
MappedFieldType
for the give fullName.
If multiple types have fields with the same full name, the first is returned.public Collection<String> simpleMatchToIndexNames(String pattern)
public Collection<String> simpleMatchToIndexNames(String pattern, @Nullable String[] types)
public ObjectMapper getObjectMapper(String name, @Nullable String[] types)
public MappedFieldType smartNameFieldType(String smartName)
public MappedFieldType smartNameFieldType(String smartName, @Nullable String[] types)
public MappedFieldType unmappedFieldType(String type)
public org.apache.lucene.analysis.Analyzer indexAnalyzer()
public org.apache.lucene.analysis.Analyzer searchAnalyzer()
public org.apache.lucene.analysis.Analyzer searchQuoteAnalyzer()
public ObjectMapper resolveClosestNestedObjectMapper(String fieldName)
ObjectMapper
that is nested.public static boolean isMetadataField(String fieldName)
public static String[] getAllMetaFields()
Copyright © 2009–2017. All rights reserved.