-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Description
Elasticsearch serverless will be introducing Cross Project Search (CPS) enabled by default. But not all Kibana to Elasticsearch API calls are safe to use with CPS. To allow for incremental rollout Kibana will therefore disable CPS in all API calls. Once plugins have verified that their functionality supports CPS they should be able to explicitly opt-in to CPS again.
This work is blocked on elastic/elasticsearch-js#2902 where the clients team will expose the ability to:
- Intercept and modify API calls
- Check if an API call supports a given query parameter like
query_routing - Check if a given query param like
query_routingis set (non-null)
Using the above functionality Kibana can intercept any API calls made through the Elasticsearch client exposed by Core. If a given API call supports query_routing Core will set query_routing: "_tag._alias:_local" to disable CPS.
To allow plugins to opt-in to CPS they can specify a symbol for query_routing:
// Core code:
export const CPS_ENABLED = Symbol('explicit-cps-opt-in');
// Plugin code:
client.search({..., query_routing: CPS_ENABLED})
If Core detects this symbol it will unset query_routing so that this query will use the Elasticsearch default.