Class CrossProjectIndexExpressionsRewriter

java.lang.Object
org.elasticsearch.search.crossproject.CrossProjectIndexExpressionsRewriter

public class CrossProjectIndexExpressionsRewriter extends Object
Utility class for rewriting cross-project index expressions. Provides methods that can rewrite qualified and unqualified index expressions to canonical CCS.
  • Field Details

    • NO_MATCHING_PROJECT_EXCEPTION_VERSION

      public static TransportVersion NO_MATCHING_PROJECT_EXCEPTION_VERSION
  • Constructor Details

    • CrossProjectIndexExpressionsRewriter

      public CrossProjectIndexExpressionsRewriter()
  • Method Details

    • rewriteIndexExpressions

      public static Map<String,List<String>> rewriteIndexExpressions(ProjectRoutingInfo originProject, List<ProjectRoutingInfo> linkedProjects, String[] originalIndices)
      Rewrites index expressions for cross-project search requests. Handles qualified and unqualified expressions and match-all cases will also hand exclusions in the future.
      Parameters:
      originProject - the _origin project with its alias
      linkedProjects - the list of linked and available projects to consider for a request
      originalIndices - the array of index expressions to be rewritten to canonical CCS
      Returns:
      a map from original index expressions to lists of canonical index expressions
      Throws:
      IllegalArgumentException - if exclusions, date math or selectors are present in the index expressions
      NoMatchingProjectException - if a qualified resource cannot be resolved because a project is missing