Package org.elasticsearch.index.mapper
Class ParseContext
- java.lang.Object
-
- org.elasticsearch.index.mapper.ParseContext
-
- All Implemented Interfaces:
java.lang.Iterable<ParseContext.Document>
- Direct Known Subclasses:
ParseContext.InternalParseContext
public abstract class ParseContext extends java.lang.Object implements java.lang.Iterable<ParseContext.Document>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ParseContext.Document
Fork ofDocument
with additional functionality.static class
ParseContext.InternalParseContext
-
Constructor Summary
Constructors Constructor Description ParseContext()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
addDoc(ParseContext.Document doc)
abstract void
addDynamicMapper(Mapper update)
Add a new mapper dynamically created while parsing.abstract void
addIgnoredField(java.lang.String field)
Add the givenfield
to the set of ignored fields.abstract AllEntries
allEntries()
ParseContext
createCopyToContext()
Return a new context that will be within a copy-to operation.ParseContext
createExternalValueContext(java.lang.Object externalValue)
Return a new context that will have the external value set.ParseContext
createMultiFieldContext()
Return a new context that will be within multi-fields.ParseContext
createNestedContext(java.lang.String fullPath)
Return a new context that will be used within a nested document.abstract ParseContext.Document
doc()
abstract DocumentMapper
docMapper()
abstract DocumentMapperParser
docMapperParser()
java.lang.Object
externalValue()
boolean
externalValueSet()
abstract java.util.List<Mapper>
getDynamicMappers()
Get dynamic mappers created while parsing.abstract java.util.Collection<java.lang.String>
getIgnoredFields()
Return the collection of fields that have been ignored so far.java.lang.Boolean
getIncludeInAllDefault()
Whether field values should be added to the _all field by default.boolean
includeInAll(java.lang.Boolean includeInAll, FieldMapper mapper)
abstract IndexSettings
indexSettings()
boolean
isWithinCopyTo()
boolean
isWithinMultiFields()
abstract MapperService
mapperService()
abstract java.lang.Iterable<ParseContext.Document>
nonRootDocuments()
Returns an Iterable over all non-root documents.ParseContext
overridePath(ContentPath path)
Return a new context that will have the provided path.<T> T
parseExternalValue(java.lang.Class<T> clazz)
Try to parse an externalValue if anyabstract XContentParser
parser()
abstract ContentPath
path()
abstract RootObjectMapper
root()
abstract ParseContext.Document
rootDoc()
abstract SeqNoFieldMapper.SequenceIDFields
seqID()
abstract void
seqID(SeqNoFieldMapper.SequenceIDFields seqID)
ParseContext
setIncludeInAllDefault(boolean includeInAll)
Return a view of thisParseContext
that changes the return value ofgetIncludeInAllDefault()
.abstract SourceToParse
sourceToParse()
ParseContext
switchDoc(ParseContext.Document document)
Return a new context that has the provided document as the current document.abstract org.apache.lucene.document.Field
version()
abstract void
version(org.apache.lucene.document.Field version)
-
-
-
Method Detail
-
nonRootDocuments
public abstract java.lang.Iterable<ParseContext.Document> 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 givenfield
to 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.
-
docMapperParser
public abstract DocumentMapperParser docMapperParser()
-
setIncludeInAllDefault
public final ParseContext setIncludeInAllDefault(boolean includeInAll)
Return a view of thisParseContext
that changes the return value ofgetIncludeInAllDefault()
.
-
getIncludeInAllDefault
public java.lang.Boolean getIncludeInAllDefault()
Whether field values should be added to the _all field by default.
-
createCopyToContext
public final ParseContext createCopyToContext()
Return a new context that will be within a copy-to operation.
-
isWithinCopyTo
public boolean isWithinCopyTo()
-
createMultiFieldContext
public final ParseContext createMultiFieldContext()
Return a new context that will be within multi-fields.
-
createNestedContext
public final ParseContext createNestedContext(java.lang.String fullPath)
Return a new context that will be used within a nested document.
-
switchDoc
public final ParseContext switchDoc(ParseContext.Document document)
Return a new context that has the provided document as the current document.
-
overridePath
public final ParseContext overridePath(ContentPath path)
Return a new context that will have the provided path.
-
isWithinMultiFields
public boolean isWithinMultiFields()
-
indexSettings
public abstract IndexSettings indexSettings()
-
sourceToParse
public abstract SourceToParse sourceToParse()
-
path
public abstract ContentPath path()
-
parser
public abstract XContentParser parser()
-
rootDoc
public abstract ParseContext.Document rootDoc()
-
doc
public abstract ParseContext.Document doc()
-
addDoc
protected abstract void addDoc(ParseContext.Document doc)
-
root
public abstract RootObjectMapper root()
-
docMapper
public abstract DocumentMapper docMapper()
-
mapperService
public abstract MapperService mapperService()
-
version
public abstract org.apache.lucene.document.Field version()
-
version
public abstract void version(org.apache.lucene.document.Field version)
-
seqID
public abstract SeqNoFieldMapper.SequenceIDFields seqID()
-
seqID
public abstract void seqID(SeqNoFieldMapper.SequenceIDFields seqID)
-
includeInAll
public final boolean includeInAll(java.lang.Boolean includeInAll, FieldMapper mapper)
-
allEntries
public abstract AllEntries allEntries()
-
createExternalValueContext
public final ParseContext createExternalValueContext(java.lang.Object externalValue)
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
public abstract void addDynamicMapper(Mapper update)
Add a new mapper dynamically created while parsing.
-
getDynamicMappers
public abstract java.util.List<Mapper> getDynamicMappers()
Get dynamic mappers created while parsing.
-
-