Class CrossProjectModeDecider

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

public class CrossProjectModeDecider extends Object
Utility class to determine whether Cross-Project Search (CPS) applies to an inbound request.

CPS applicability is controlled at three levels:

  • Cluster level: The serverless.cross_project.enabled setting determines whether CPS processing is available at all. In the future, all Serverless projects will support CPS, so this distinction will depend on whether the cluster is a Serverless cluster or not.
  • API level: The IndicesRequest.Replaceable.allowsCrossProject() method determines whether a particular request type supports CPS processing.
  • Request level: An IndicesOptions flag determines whether CPS should apply to the current request being processed. This fine-grained control is required because APIs that support CPS may also be used in contexts where CPS should not apply—for example, internal searches against the security system index to retrieve user roles, or CPS actions that execute in a flow where a parent action has already performed CPS processing.
  • Constructor Details

    • CrossProjectModeDecider

      public CrossProjectModeDecider(Settings settings)
  • Method Details

    • crossProjectEnabled

      public boolean crossProjectEnabled()
    • resolvesCrossProject

      public boolean resolvesCrossProject(IndicesRequest.Replaceable request)