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.
  • Field Details

    • TYPE_FIELD

      public static final ParseField TYPE_FIELD
    • IS_METADATA_FIELD

      public static final ParseField IS_METADATA_FIELD
    • SEARCHABLE_FIELD

      public static final ParseField SEARCHABLE_FIELD
    • AGGREGATABLE_FIELD

      public static final ParseField AGGREGATABLE_FIELD
    • TIME_SERIES_DIMENSION_FIELD

      public static final ParseField TIME_SERIES_DIMENSION_FIELD
    • TIME_SERIES_METRIC_FIELD

      public static final ParseField TIME_SERIES_METRIC_FIELD
    • INDICES_FIELD

      public static final ParseField INDICES_FIELD
    • NON_SEARCHABLE_INDICES_FIELD

      public static final ParseField NON_SEARCHABLE_INDICES_FIELD
    • NON_AGGREGATABLE_INDICES_FIELD

      public static final ParseField NON_AGGREGATABLE_INDICES_FIELD
    • NON_DIMENSION_INDICES_FIELD

      public static final ParseField NON_DIMENSION_INDICES_FIELD
    • METRIC_CONFLICTS_INDICES_FIELD

      public static final ParseField METRIC_CONFLICTS_INDICES_FIELD
  • Constructor Details

    • FieldCapabilities

      public FieldCapabilities(String name, String type, boolean isMetadataField, boolean isSearchable, boolean isAggregatable, boolean isDimension, TimeSeriesParams.MetricType metricType, String[] indices, String[] nonSearchableIndices, String[] nonAggregatableIndices, String[] nonDimensionIndices, String[] metricConflictsIndices, 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.
      isDimension - Whether this field can be used as dimension
      metricType - If this field is a metric field, returns the metric's type or null for non-metrics fields
      indices - The list of indices where this field name is defined as type. When includeIndices is set to false, this list is only present if there is a mapping conflict (e.g. the same field has different types across indices). When includeIndices is set to true, this list is always present and contains all indices where the field exists, regardless of mapping conflicts.
      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.
      nonDimensionIndices - The list of indices where this field is not a dimension
      metricConflictsIndices - The list of indices where this field is has different metric types or not mark as a metric
      meta - Merged metadata across indices.
    • 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 non-timeseries field caps. Useful for testing 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.
    • FieldCapabilities

      public FieldCapabilities(String name, String type, Boolean isMetadataField, boolean isSearchable, boolean isAggregatable, Boolean isDimension, String metricType, List<String> indices, List<String> nonSearchableIndices, List<String> nonAggregatableIndices, List<String> nonDimensionIndices, List<String> metricConflictsIndices, Map<String,Set<String>> meta)
      Constructor for a set of indices used by parser
      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.
      isDimension - Whether this field can be used as dimension
      metricType - If this field is a metric field, returns the metric's type or null for non-metrics fields
      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.
      nonDimensionIndices - The list of indices where this field is not a dimension
      metricConflictsIndices - The list of indices where this field is has different metric types or not mark as a metric
      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
    • 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.
    • isDimension

      public boolean isDimension()
      Whether this field is a dimension in any indices.
    • getMetricType

      public TimeSeriesParams.MetricType getMetricType()
      The metric type
    • 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.
    • nonDimensionIndices

      public String[] nonDimensionIndices()
      The list of indices where this field has different dimension or metric flag
    • metricConflictsIndices

      public String[] metricConflictsIndices()
      The list of indices where this field has different dimension or metric flag
    • 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