Class ParseContext

java.lang.Object
org.elasticsearch.index.mapper.ParseContext
Direct Known Subclasses:
ParseContext.InternalParseContext

public abstract class ParseContext extends Object
  • Constructor Details

    • ParseContext

      public ParseContext()
  • Method Details

    • nonRootDocuments

      public abstract Iterable<LuceneDocument> 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(String field)
      Add the given field to the set of ignored fields.
    • getIgnoredFields

      public abstract Collection<String> getIgnoredFields()
      Return the collection of fields that have been ignored so far.
    • addToFieldNames

      public abstract void addToFieldNames(String field)
      Add the given field to the _field_names field Use this if an exists query run against the field cannot use docvalues or norms.
    • getFieldNames

      public abstract Collection<String> getFieldNames()
      Return the collection of fields to be added to the _field_names field
    • dynamicTemplateParserContext

      public abstract MappingParserContext dynamicTemplateParserContext(DateFormatter dateFormatter)
    • 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(String fullPath)
      Return a new context that will be used within a nested document.
    • switchDoc

      public final ParseContext switchDoc(LuceneDocument 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.
    • switchParser

      @Deprecated public final ParseContext switchParser(org.elasticsearch.common.xcontent.XContentParser parser)
      Deprecated.
      we are actively deprecating and removing the ability to pass complex objects to multifields, so try and avoid using this method
    • isWithinMultiFields

      public boolean isWithinMultiFields()
    • indexSettings

      public abstract IndexSettings indexSettings()
    • sourceToParse

      public abstract SourceToParse sourceToParse()
    • path

      public abstract ContentPath path()
    • parser

      public abstract org.elasticsearch.common.xcontent.XContentParser parser()
    • rootDoc

      public abstract LuceneDocument rootDoc()
    • docs

      public abstract List<LuceneDocument> docs()
    • doc

      public abstract LuceneDocument doc()
    • addDoc

      protected abstract void addDoc(LuceneDocument doc)
    • root

      public abstract RootObjectMapper root()
    • mappingLookup

      public abstract MappingLookup mappingLookup()
    • getMetadataMapper

      public abstract MetadataFieldMapper getMetadataMapper(String mapperName)
    • indexAnalyzers

      public abstract IndexAnalyzers indexAnalyzers()
    • 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)
    • addDynamicMapper

      public abstract void addDynamicMapper(Mapper update)
      Add a new mapper dynamically created while parsing.
    • getObjectMapper

      public abstract ObjectMapper getObjectMapper(String name)
    • getDynamicMappers

      public abstract List<Mapper> getDynamicMappers()
      Get dynamic mappers created while parsing.
    • addDynamicRuntimeField

      public abstract void addDynamicRuntimeField(RuntimeField runtimeField)
      Add a new runtime field dynamically created while parsing.
    • getDynamicRuntimeFields

      public abstract List<RuntimeField> getDynamicRuntimeFields()
      Get dynamic runtime fields created while parsing.
    • findDynamicTemplate

      public final DynamicTemplate findDynamicTemplate(String fieldName, DynamicTemplate.XContentFieldType matchType)
      Find a dynamic mapping template for the given field and its matching type
      Parameters:
      fieldName - the name of the field
      matchType - 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.