Class CrossProjectRoutingResolver

java.lang.Object
org.elasticsearch.search.crossproject.CrossProjectRoutingResolver
All Implemented Interfaces:
ProjectRoutingResolver

public class CrossProjectRoutingResolver extends Object implements ProjectRoutingResolver
Tech Preview. Resolves a single entry _alias for a cross-project request specifying a project_routing. We currently only support a single entry routing containing either a specific name, a prefix, a suffix, or a match-all (*).
  • Constructor Details

    • CrossProjectRoutingResolver

      public CrossProjectRoutingResolver()
  • Method Details

    • resolve

      public TargetProjects resolve(String projectRouting, TargetProjects targetProjects)
      Filters the specified TargetProjects based on the provided project routing string
      Specified by:
      resolve in interface ProjectRoutingResolver
      Parameters:
      projectRouting - the project_routing specified in the request object
      targetProjects - The target projects to be filtered
      Returns:
      A new TargetProjects instance containing only the projects that match the project routing.
      Throws:
      ElasticsearchStatusException - if the projectRouting is null, empty, does not start with "_alias:", contains more than one entry, or contains an '*' in the middle of a string.