Class FieldCapabilities

java.lang.Object
org.elasticsearch.action.fieldcaps.FieldCapabilities
All Implemented Interfaces:
Writeable, ToXContent, ToXContentObject

public class FieldCapabilities extends Object implements Writeable, ToXContentObject
Describes the capabilities of a field optionally merged across multiple indices.
  • Constructor Details

    • FieldCapabilities

      public FieldCapabilities(String name, String type, boolean isMetadataField, boolean isSearchable, boolean isAggregatable, String[] indices, String[] nonSearchableIndices, String[] nonAggregatableIndices, Map<String,Set<String>> meta)
      Constructor for a set of indices.
      Parameters:
      name - The name of the field
      type - The type associated with the field.
      isMetadataField - Whether this field is a metadata field.
      isSearchable - Whether this field is indexed for search.
      isAggregatable - Whether this field can be aggregated on.
      indices - The list of indices where this field name is defined as type, or null if all indices have the same type for the field.
      nonSearchableIndices - The list of indices where this field is not searchable, or null if the field is searchable in all indices.
      nonAggregatableIndices - The list of indices where this field is not aggregatable, or null if the field is aggregatable in all indices.
      meta - Merged metadata across indices.
  • Method Details

    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • toXContent

      public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface ToXContent
      Throws:
      IOException
    • fromXContent

      public static FieldCapabilities fromXContent(String name, XContentParser parser) throws IOException
      Throws:
      IOException
    • getName

      public String getName()
      The name of the field.
    • isMetadataField

      public boolean isMetadataField()
      Whether this field is a metadata field.
    • isAggregatable

      public boolean isAggregatable()
      Whether this field can be aggregated on all indices.
    • isSearchable

      public boolean isSearchable()
      Whether this field is indexed for search on all indices.
    • getType

      public String getType()
      The type of the field.
    • indices

      public String[] indices()
      The list of indices where this field name is defined as type, or null if all indices have the same type for the field.
    • nonSearchableIndices

      public String[] nonSearchableIndices()
      The list of indices where this field is not searchable, or null if the field is searchable in all indices.
    • nonAggregatableIndices

      public String[] nonAggregatableIndices()
      The list of indices where this field is not aggregatable, or null if the field is aggregatable in all indices.
    • meta

      public Map<String,Set<String>> meta()
      Return merged metadata across indices.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object