org.elasticsearch.index.mapper
Interface DocumentMapper

All Known Implementing Classes:
XContentDocumentMapper

@ThreadSafe
public interface DocumentMapper


Nested Class Summary
static class DocumentMapper.MergeFlags
           
static class DocumentMapper.MergeResult
          A result of a merge.
static interface DocumentMapper.ParseListener<ParseContext>
          A listener to be called during the parse process.
static class DocumentMapper.ParseListenerAdapter
           
 
Method Summary
 void addFieldMapperListener(FieldMapperListener fieldMapperListener, boolean includeExisting)
          Adds a field mapper listener.
 AllFieldMapper allFieldMapper()
           
 BoostFieldMapper boostMapper()
           
 IdFieldMapper idMapper()
           
 org.apache.lucene.analysis.Analyzer indexAnalyzer()
          The default index analyzer to be used.
 IndexFieldMapper indexMapper()
           
 DocumentFieldMappers mappers()
           
 CompressedString mappingSource()
          When constructed by parsing a mapping definition, will return it.
 DocumentMapper.MergeResult merge(DocumentMapper mergeWith, DocumentMapper.MergeFlags mergeFlags)
          Merges this document mapper with the provided document mapper.
 org.elasticsearch.common.collect.ImmutableMap<java.lang.String,java.lang.Object> meta()
          Attributes of this type mappings.
 ParsedDocument parse(byte[] source)
          Parses the source into a parsed document.
 ParsedDocument parse(SourceToParse source)
          Parses the source into a parsed document.
 ParsedDocument parse(SourceToParse source, DocumentMapper.ParseListener listener)
          Parses the source into a parsed document.
 ParsedDocument parse(java.lang.String type, java.lang.String id, byte[] source)
          Parses the source into a parsed document.
 void refreshSource()
          Generates the source of the mapper based on the current mappings.
 RoutingFieldMapper routingFieldMapper()
           
 org.apache.lucene.analysis.Analyzer searchAnalyzer()
          The default search analyzer to be used.
 SourceFieldMapper sourceMapper()
           
 java.lang.String type()
           
 org.apache.lucene.search.Filter typeFilter()
          A filter based on the type of the field.
 TypeFieldMapper typeMapper()
           
 UidFieldMapper uidMapper()
           
 

Method Detail

type

java.lang.String type()

mappingSource

CompressedString mappingSource()
When constructed by parsing a mapping definition, will return it. Otherwise, returns null.


meta

org.elasticsearch.common.collect.ImmutableMap<java.lang.String,java.lang.Object> meta()
Attributes of this type mappings.


refreshSource

void refreshSource()
                   throws FailedToGenerateSourceMapperException
Generates the source of the mapper based on the current mappings.

Throws:
FailedToGenerateSourceMapperException

uidMapper

UidFieldMapper uidMapper()

idMapper

IdFieldMapper idMapper()

typeMapper

TypeFieldMapper typeMapper()

indexMapper

IndexFieldMapper indexMapper()

sourceMapper

SourceFieldMapper sourceMapper()

boostMapper

BoostFieldMapper boostMapper()

allFieldMapper

AllFieldMapper allFieldMapper()

routingFieldMapper

RoutingFieldMapper routingFieldMapper()

mappers

DocumentFieldMappers mappers()

indexAnalyzer

org.apache.lucene.analysis.Analyzer indexAnalyzer()
The default index analyzer to be used. Note, the DocumentFieldMappers.indexAnalyzer() should probably be used instead.


searchAnalyzer

org.apache.lucene.analysis.Analyzer searchAnalyzer()
The default search analyzer to be used. Note, the DocumentFieldMappers.searchAnalyzer() should probably be used instead.


typeFilter

org.apache.lucene.search.Filter typeFilter()
A filter based on the type of the field.


parse

ParsedDocument parse(byte[] source)
                     throws MapperParsingException
Parses the source into a parsed document.

Validates that the source has the provided id and type. Note, most times we will already have the id and the type even though they exist in the source as well.

Throws:
MapperParsingException

parse

ParsedDocument parse(java.lang.String type,
                     java.lang.String id,
                     byte[] source)
                     throws MapperParsingException
Parses the source into a parsed document.

Validates that the source has the provided id and type. Note, most times we will already have the id and the type even though they exist in the source as well.

Throws:
MapperParsingException

parse

ParsedDocument parse(SourceToParse source)
                     throws MapperParsingException
Parses the source into a parsed document.

Validates that the source has the provided id and type. Note, most times we will already have the id and the type even though they exist in the source as well.

Throws:
MapperParsingException

parse

ParsedDocument parse(SourceToParse source,
                     @Nullable
                     DocumentMapper.ParseListener listener)
                     throws MapperParsingException
Parses the source into a parsed document.

Validates that the source has the provided id and type. Note, most times we will already have the id and the type even though they exist in the source as well.

Throws:
MapperParsingException

merge

DocumentMapper.MergeResult merge(DocumentMapper mergeWith,
                                 DocumentMapper.MergeFlags mergeFlags)
                                 throws MergeMappingException
Merges this document mapper with the provided document mapper. If there are conflicts, the DocumentMapper.MergeResult will hold them.

Throws:
MergeMappingException

addFieldMapperListener

void addFieldMapperListener(FieldMapperListener fieldMapperListener,
                            boolean includeExisting)
Adds a field mapper listener.