Class IndexResolver

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

public class IndexResolver extends Object
  • Field Details

  • Constructor Details

    • IndexResolver

      public IndexResolver(Client client)
  • Method Details

    • resolveIndices

      public void resolveIndices(String indexPattern, Set<String> fieldNames, TransportVersion minimumVersion, ActionListener<IndexResolution> listener)
      Like IndexResolver#resolveIndicesVersioned but simplified and does not pass on the determined minimum transport version to the listener.
    • resolveIndicesVersioned

      public void resolveIndicesVersioned(String indexPattern, Set<String> fieldNames, QueryBuilder requestFilter, boolean includeAllDimensions, TransportVersion minimumVersion, boolean useAggregateMetricDoubleWhenNotSupported, boolean useDenseVectorWhenNotSupported, IndicesExpressionGrouper indicesExpressionGrouper, 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.

    • resolveFlatWorldIndicesVersioned

      public void resolveFlatWorldIndicesVersioned(String indexPattern, String projectRouting, Set<String> fieldNames, QueryBuilder requestFilter, boolean includeAllDimensions, TransportVersion minimumVersion, boolean useAggregateMetricDoubleWhenNotSupported, boolean useDenseVectorWhenNotSupported, ActionListener<Versioned<IndexResolution>> listener)
      Like IndexResolver#resolveIndicesVersioned but for flat world queries.
    • mergedMappings

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