Class IndexResolver

java.lang.Object
org.elasticsearch.xpack.esql.session.IndexResolver

public class IndexResolver extends Object
  • Field Details

    • ALL_FIELDS

      public static final Set<String> ALL_FIELDS
    • INDEX_METADATA_FIELD

      public static final Set<String> INDEX_METADATA_FIELD
    • UNMAPPED

      public static final String UNMAPPED
      See Also:
    • FIELD_CAPS_INDICES_OPTIONS

      public static final IndicesOptions FIELD_CAPS_INDICES_OPTIONS
  • Constructor Details

    • IndexResolver

      public IndexResolver(Client client)
  • Method Details

    • resolveAsMergedMapping

      public void resolveAsMergedMapping(String indexWildcard, Set<String> fieldNames, QueryBuilder requestFilter, boolean includeAllDimensions, TransportVersion minimumVersion, boolean useAggregateMetricDoubleWhenNotSupported, boolean useDenseVectorWhenNotSupported, ActionListener<IndexResolution> listener)
      Like resolveAsMergedMappingAndRetrieveMinimumVersion but does not pass on the determined minimum transport version to the listener.
    • resolveAsMergedMappingAndRetrieveMinimumVersion

      public void resolveAsMergedMappingAndRetrieveMinimumVersion(String indexWildcard, Set<String> fieldNames, QueryBuilder requestFilter, boolean includeAllDimensions, TransportVersion minimumVersion, boolean useAggregateMetricDoubleWhenNotSupported, boolean useDenseVectorWhenNotSupported, ActionListener<Versioned<IndexResolution>> listener)
      Perform a field caps request to resolve a pattern to one mapping (potentially compound, meaning it spans multiple indices).

      The field caps response contains the minimum transport version of all clusters that apply to the pattern, and it is used to deal with previously unsupported data types during resolution.

      If a field's type is not supported on the minimum version, it will be DataType.UNSUPPORTED.

      If the nodes are too old to include their minimum transport version in the field caps response, we'll assume TransportVersion.minimumCompatible().

      The minimumVersion already known so far must be passed in and will be used instead of the minimum version from the field caps response if it is lower. During main index resolution, this is the local cluster's minimum version. This safeguards against using too new a version in case of FROM remote_only:* | ... queries that don't have any indices on the local cluster.

      But it's also important for remote ENRICH resolution, because in CCS enrich policies are resolved on remote clusters, so the overall minimum transport version that the coordinating cluster observed must be passed in here to avoid inconsistencies.

      The overall minimum version is updated using the field caps response and is passed on to the listener.

    • mergedMappings

      public static IndexResolution mergedMappings(String indexPattern, IndexResolver.FieldsInfo fieldsInfo)