Package org.elasticsearch.index.mapper
Class ParseContext
java.lang.Object
org.elasticsearch.index.mapper.ParseContext
- Direct Known Subclasses:
ParseContext.InternalParseContext
public abstract class ParseContext
extends java.lang.Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classParseContext.DocumentFork ofDocumentwith additional functionality.static classParseContext.InternalParseContext -
Constructor Summary
Constructors Constructor Description ParseContext() -
Method Summary
Modifier and Type Method Description protected abstract voidaddDoc(ParseContext.Document doc)abstract voidaddDynamicMapper(Mapper update)Add a new mapper dynamically created while parsing.abstract voidaddDynamicRuntimeField(RuntimeField runtimeField)Add a new runtime field dynamically created while parsing.abstract voidaddIgnoredField(java.lang.String field)Add the givenfieldto the set of ignored fields.ParseContextcreateCopyToContext()Return a new context that will be within a copy-to operation.ParseContextcreateExternalValueContext(java.lang.Object externalValue)Return a new context that will have the external value set.ParseContextcreateMultiFieldContext()Return a new context that will be within multi-fields.ParseContextcreateNestedContext(java.lang.String fullPath)Return a new context that will be used within a nested document.abstract ParseContext.Documentdoc()abstract java.util.List<ParseContext.Document>docs()java.lang.ObjectexternalValue()booleanexternalValueSet()DynamicTemplatefindDynamicTemplate(java.lang.String fieldName, DynamicTemplate.XContentFieldType matchType)Find a dynamic mapping template for the given field and its matching typeabstract java.util.List<Mapper>getDynamicMappers()Get dynamic mappers created while parsing.abstract java.util.List<RuntimeField>getDynamicRuntimeFields()Get dynamic runtime fields created while parsing.abstract java.util.Collection<java.lang.String>getIgnoredFields()Return the collection of fields that have been ignored so far.abstract MetadataFieldMappergetMetadataMapper(java.lang.String mapperName)abstract ObjectMappergetObjectMapper(java.lang.String name)abstract IndexAnalyzersindexAnalyzers()abstract IndexSettingsindexSettings()booleanisWithinCopyTo()booleanisWithinMultiFields()abstract MappingLookupmappingLookup()abstract java.lang.Iterable<ParseContext.Document>nonRootDocuments()Returns an Iterable over all non-root documents.ParseContextoverridePath(ContentPath path)Return a new context that will have the provided path.<T> TparseExternalValue(java.lang.Class<T> clazz)Try to parse an externalValue if anyabstract org.elasticsearch.common.xcontent.XContentParserparser()abstract Mapper.TypeParser.ParserContextparserContext(DateFormatter dateFormatter)abstract ContentPathpath()abstract RootObjectMapperroot()abstract ParseContext.DocumentrootDoc()abstract SeqNoFieldMapper.SequenceIDFieldsseqID()abstract voidseqID(SeqNoFieldMapper.SequenceIDFields seqID)abstract SourceToParsesourceToParse()ParseContextswitchDoc(ParseContext.Document document)Return a new context that has the provided document as the current document.abstract org.apache.lucene.document.Fieldversion()abstract voidversion(org.apache.lucene.document.Field version)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ParseContext
public ParseContext()
-
-
Method Details
-
nonRootDocuments
Returns an Iterable over all non-root documents. If there are no non-root documents the iterable will return an empty iterator. -
addIgnoredField
public abstract void addIgnoredField(java.lang.String field)Add the givenfieldto the set of ignored fields. -
getIgnoredFields
public abstract java.util.Collection<java.lang.String> getIgnoredFields()Return the collection of fields that have been ignored so far. -
parserContext
-
createCopyToContext
Return a new context that will be within a copy-to operation. -
isWithinCopyTo
public boolean isWithinCopyTo() -
createMultiFieldContext
Return a new context that will be within multi-fields. -
createNestedContext
Return a new context that will be used within a nested document. -
switchDoc
Return a new context that has the provided document as the current document. -
overridePath
Return a new context that will have the provided path. -
isWithinMultiFields
public boolean isWithinMultiFields() -
indexSettings
-
sourceToParse
-
path
-
parser
public abstract org.elasticsearch.common.xcontent.XContentParser parser() -
rootDoc
-
docs
-
doc
-
addDoc
-
root
-
mappingLookup
-
getMetadataMapper
-
indexAnalyzers
-
version
public abstract org.apache.lucene.document.Field version() -
version
public abstract void version(org.apache.lucene.document.Field version) -
seqID
-
seqID
-
createExternalValueContext
Return a new context that will have the external value set. -
externalValueSet
public boolean externalValueSet() -
externalValue
public java.lang.Object externalValue() -
parseExternalValue
public final <T> T parseExternalValue(java.lang.Class<T> clazz)Try to parse an externalValue if any- Parameters:
clazz- Expected class for external value- Returns:
- null if no external value has been set or the value
-
addDynamicMapper
Add a new mapper dynamically created while parsing. -
getObjectMapper
-
getDynamicMappers
Get dynamic mappers created while parsing. -
addDynamicRuntimeField
Add a new runtime field dynamically created while parsing. -
getDynamicRuntimeFields
Get dynamic runtime fields created while parsing. -
findDynamicTemplate
public final DynamicTemplate findDynamicTemplate(java.lang.String fieldName, DynamicTemplate.XContentFieldType matchType)Find a dynamic mapping template for the given field and its matching type- Parameters:
fieldName- the name of the fieldmatchType- the expecting matchType of the field- Returns:
- the matching template; otherwise returns null
- Throws:
MapperParsingException- if the given field has a dynamic template name specified, but no template matches that name.
-