Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export const esqlAsyncSearchStrategyProvider = (
{
method: 'POST',
path: `/_query/async`,
body: params,
body: { project_routing: '_alias:_origin', ...params },
querystring: dropNullColumns ? 'drop_null_columns' : '',
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const esqlSearchStrategyProvider = (
path: `/_query`,
querystring: dropNullColumns ? 'drop_null_columns' : '',
body: {
project_routing: '_alias:_origin',
...requestParams,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ async function getTile({
method: 'POST',
path,
body,
querystring: { project_routing: '_alias:_origin' },
},
{
signal: abortController.signal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ export function registerElasticsearchFunction({
const response = await esClient.asCurrentUser.transport.request({
method,
path,
body,
// POST _search: inject project_routing for CPS (stripped automatically when CPS is disabled)
body:
isSearchEndpoint && method === 'POST'
? { project_routing: '_alias:_origin', ...body }
: body,
});

return { content: { response } };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export class ElasticsearchRetriever extends BaseRetriever {
method: 'POST',
path: `/${this.index}/_search`,
body: {
project_routing: '_alias:_origin',
...queryBody,
size: this.k,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const performEsqlRequest = async ({
const asyncEsqlResponse = await esClient.transport.request<AsyncEsqlResponse>({
method: 'POST',
path: '/_query/async',
body: requestBody,
body: { project_routing: '_alias:_origin', ...requestBody },
querystring: requestQueryParams,
});
setLatestRequestDuration(asyncSearchStarted, loggedRequests);
Expand Down