Interface RuntimeField

All Superinterfaces:
org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentFragment
All Known Implementing Classes:
BooleanScriptFieldType, DateScriptFieldType, DoubleScriptFieldType, GeoPointScriptFieldType, IpScriptFieldType, KeywordScriptFieldType, LongScriptFieldType

public interface RuntimeField
extends org.elasticsearch.common.xcontent.ToXContentFragment
Definition of a runtime field that can be defined as part of the runtime section of the index mappings
  • Nested Class Summary

    Nested Classes
    Modifier and Type Interface Description
    static class  RuntimeField.Builder
    For runtime fields the RuntimeField.Parser returns directly the MappedFieldType.
    static class  RuntimeField.Parser
    Parser for a runtime field.

    Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent

    org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
  • Field Summary

    Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent

    EMPTY_PARAMS
  • Method Summary

    Modifier and Type Method Description
    MappedFieldType asMappedFieldType()
    Exposes the MappedFieldType backing this runtime field, used to execute queries, run aggs etc.
    void doXContentBody​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
    Prints out the parameters that subclasses expose
    java.lang.String name()
    Exposes the name of the runtime field
    static java.util.Map<java.lang.String,​RuntimeField> parseRuntimeFields​(java.util.Map<java.lang.String,​java.lang.Object> node, Mapper.TypeParser.ParserContext parserContext, boolean supportsRemoval)
    Parse runtime fields from the provided map, using the provided parser context.
    default org.elasticsearch.common.xcontent.XContentBuilder toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)  
    java.lang.String typeName()
    Exposes the type of the runtime field

    Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment

    isFragment
  • Method Details

    • toXContent

      default org.elasticsearch.common.xcontent.XContentBuilder toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException
      Specified by:
      toXContent in interface org.elasticsearch.common.xcontent.ToXContent
      Throws:
      java.io.IOException
    • doXContentBody

      void doXContentBody​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException
      Prints out the parameters that subclasses expose
      Throws:
      java.io.IOException
    • name

      java.lang.String name()
      Exposes the name of the runtime field
      Returns:
      name of the field
    • typeName

      java.lang.String typeName()
      Exposes the type of the runtime field
      Returns:
      type of the field
    • asMappedFieldType

      MappedFieldType asMappedFieldType()
      Exposes the MappedFieldType backing this runtime field, used to execute queries, run aggs etc.
      Returns:
      the MappedFieldType backing this runtime field
    • parseRuntimeFields

      static java.util.Map<java.lang.String,​RuntimeField> parseRuntimeFields​(java.util.Map<java.lang.String,​java.lang.Object> node, Mapper.TypeParser.ParserContext parserContext, boolean supportsRemoval)
      Parse runtime fields from the provided map, using the provided parser context.
      Parameters:
      node - the map that holds the runtime fields configuration
      parserContext - the parser context that holds info needed when parsing mappings
      supportsRemoval - whether a null value for a runtime field should be properly parsed and translated to the removal of such runtime field
      Returns:
      the parsed runtime fields