public class MapperService extends AbstractIndexComponent
Modifier and Type | Class and Description |
---|---|
static class |
MapperService.SmartNameFieldMappers |
static class |
MapperService.SmartNameObjectMapper |
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_MAPPING |
componentSettings, index, indexSettings, logger
Constructor and Description |
---|
MapperService(Index index,
Settings indexSettings,
Environment environment,
AnalysisService analysisService,
IndexFieldDataService fieldDataService,
PostingsFormatService postingsFormatService,
DocValuesFormatService docValuesFormatService,
SimilarityLookupService similarityLookupService,
ScriptService scriptService) |
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) |
DocumentMapperParser |
documentMapperParser() |
Tuple<DocumentMapper,Boolean> |
documentMapperWithAutoCreate(String type)
Returns the document mapper created, including if the document mapper ended up
being actually created or not in the second tuple value.
|
org.apache.lucene.analysis.Analyzer |
fieldSearchAnalyzer(String field) |
org.apache.lucene.analysis.Analyzer |
fieldSearchQuoteAnalyzer(String field) |
FieldMappers |
fullName(String fullName)
Returns the
FieldMappers of all the FieldMapper s that are
registered under the give fullName across all the different DocumentMapper types. |
boolean |
hasMapping(String mappingType) |
boolean |
hasNested() |
FieldMappers |
indexName(String indexName)
Returns
FieldMappers for all the FieldMapper s that are registered
under the given indexName across all the different DocumentMapper types. |
static boolean |
isMetadataField(String fieldName) |
DocumentMapper |
merge(String type,
CompressedString mappingSource,
boolean applyDefault) |
FieldMappers |
name(String name)
Returns
FieldMappers for all the FieldMapper s that are registered
under the given name across all the different DocumentMapper types. |
ObjectMappers |
objectMapper(String path)
Returns objects mappers based on the full path of the object.
|
DocumentMapper |
parse(String mappingType,
CompressedString mappingSource,
boolean applyDefault) |
void |
remove(String type) |
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.Filter |
searchFilter(String... types)
A filter for search.
|
org.apache.lucene.analysis.Analyzer |
searchQuoteAnalyzer() |
List<String> |
simpleMatchToIndexNames(String pattern)
Returns all the fields that match the given pattern.
|
List<String> |
simpleMatchToIndexNames(String pattern,
String[] types)
Returns all the fields that match the given pattern, with an optional narrowing
based on a list of types.
|
MapperService.SmartNameFieldMappers |
smartName(String smartName)
Returns smart field mappers based on a smart name.
|
MapperService.SmartNameFieldMappers |
smartName(String smartName,
String[] types) |
FieldMapper |
smartNameFieldMapper(String smartName)
Same as
smartNameFieldMappers(String) but returns the first field mapper for it. |
FieldMapper |
smartNameFieldMapper(String smartName,
String[] types) |
FieldMappers |
smartNameFieldMappers(String smartName)
Same as
smartName(String) , except it returns just the field mappers. |
FieldMappers |
smartNameFieldMappers(String smartName,
String[] types) |
MapperService.SmartNameObjectMapper |
smartNameObjectMapper(String smartName) |
MapperService.SmartNameObjectMapper |
smartNameObjectMapper(String smartName,
String[] types) |
Collection<String> |
types() |
FieldMapper<?> |
unmappedFieldMapper(String type)
Given a type (eg.
|
index, nodeName
public static final String DEFAULT_MAPPING
@Inject public MapperService(Index index, @IndexSettings Settings indexSettings, Environment environment, AnalysisService analysisService, IndexFieldDataService fieldDataService, PostingsFormatService postingsFormatService, DocValuesFormatService docValuesFormatService, SimilarityLookupService similarityLookupService, ScriptService scriptService)
public void close()
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 DocumentMapper merge(String type, CompressedString mappingSource, boolean applyDefault)
public void remove(String type)
public DocumentMapper parse(String mappingType, CompressedString mappingSource, boolean applyDefault) throws MapperParsingException
MapperParsingException
public boolean hasMapping(String mappingType)
public Collection<String> types()
public DocumentMapper documentMapper(String type)
public Tuple<DocumentMapper,Boolean> documentMapperWithAutoCreate(String type)
@Nullable public org.apache.lucene.search.Filter searchFilter(String... types)
public FieldMappers name(String name)
FieldMappers
for all the FieldMapper
s that are registered
under the given name across all the different DocumentMapper
types.name
- The name to return all the FieldMappers
for across all DocumentMapper
s.FieldMappers
for across all DocumentMapper
spublic FieldMappers indexName(String indexName)
FieldMappers
for all the FieldMapper
s that are registered
under the given indexName across all the different DocumentMapper
types.indexName
- The indexName to return all the FieldMappers
for across all DocumentMapper
s.FieldMappers
across all DocumentMapper
s for the given indexName.public FieldMappers fullName(String fullName)
FieldMappers
of all the FieldMapper
s that are
registered under the give fullName across all the different DocumentMapper
types.fullName
- The full nameFieldMappers
across all the DocumentMapper
s for the given fullName.public ObjectMappers objectMapper(String path)
public List<String> simpleMatchToIndexNames(String pattern, @Nullable String[] types)
public List<String> simpleMatchToIndexNames(String pattern)
public MapperService.SmartNameObjectMapper smartNameObjectMapper(String smartName, @Nullable String[] types)
public MapperService.SmartNameObjectMapper smartNameObjectMapper(String smartName)
public FieldMapper smartNameFieldMapper(String smartName)
smartNameFieldMappers(String)
but returns the first field mapper for it. Returns
null if there is none.public FieldMapper smartNameFieldMapper(String smartName, @Nullable String[] types)
public FieldMappers smartNameFieldMappers(String smartName, @Nullable String[] types)
public FieldMappers smartNameFieldMappers(String smartName)
smartName(String)
, except it returns just the field mappers.public MapperService.SmartNameFieldMappers smartName(String smartName, @Nullable String[] types)
public MapperService.SmartNameFieldMappers smartName(String smartName)
MapperService.SmartNameFieldMappers
will have the doc mapper set.
It also (without the optional type prefix) try and find the FieldMappers
for the specific
name. It will first try to find it based on the full name (with the dots if its a compound name). If
it is not found, will try and find it based on the indexName (which can be controlled in the mapping),
and last, will try it based no the name itself.
If nothing is found, returns null.
public FieldMapper<?> unmappedFieldMapper(String type)
public org.apache.lucene.analysis.Analyzer searchAnalyzer()
public org.apache.lucene.analysis.Analyzer searchQuoteAnalyzer()
public org.apache.lucene.analysis.Analyzer fieldSearchAnalyzer(String field)
public org.apache.lucene.analysis.Analyzer fieldSearchQuoteAnalyzer(String field)
public ObjectMapper resolveClosestNestedObjectMapper(String fieldName)
ObjectMapper
that is nested.public static boolean isMetadataField(String fieldName)
Copyright © 2009–2015. All rights reserved.