diff --git a/deploy-manage/cross-project-search-config/cps-config-impacts-and-limitations.md b/deploy-manage/cross-project-search-config/cps-config-impacts-and-limitations.md index 0c59d5cbb7..7fc83d284b 100644 --- a/deploy-manage/cross-project-search-config/cps-config-impacts-and-limitations.md +++ b/deploy-manage/cross-project-search-config/cps-config-impacts-and-limitations.md @@ -26,6 +26,8 @@ For more details about {{cps-init}} configuration, refer to [](/deploy-manage/cr - **User permissions:** {{cps-cap}} results are filtered by each user's role assignments across projects. Users with different roles will see different results from the same query. Refer to [Manage user access](/deploy-manage/cross-project-search-config/cps-config-access-and-scope.md#manage-user-access). +- **{{product.painless}} scripting:** The [{{product.painless}} execute API](/explore-analyze/cross-project-search.md#cps-painless-execute) does not search across linked projects. It resolves index names against the origin project only. You can target a linked project by prefixing the index with the project alias (for example, `projectAlias:myindex`). + ## Limitations [cps-limitations] ::::{include} /deploy-manage/_snippets/cps-limitations-core.md diff --git a/explore-analyze/cross-project-search.md b/explore-analyze/cross-project-search.md index 178ab16680..18ef9527c9 100644 --- a/explore-analyze/cross-project-search.md +++ b/explore-analyze/cross-project-search.md @@ -150,6 +150,20 @@ The following APIs support {{cps}}: * Search scroll [clear](https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-clear-scroll), [run](https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-scroll) * [Search template](/solutions/search/search-templates.md) +### {{product.painless}} scripting [cps-painless-scripting] + +The [{{product.painless}} execute API](elasticsearch://reference/scripting-languages/painless/painless-api-examples.md) (`POST _scripts/painless/_execute`) does not search across linked projects. Unlike the search APIs listed above, the execute API resolves index names against the **origin project only**. + +When testing scripts with the execute API in a {{cps}} environment: + +* To target a specific linked project, prefix the index with the project alias: `projectAlias:myindex`. +* To explicitly target the origin project, use `_origin:myindex`. + * An unqualified index name like `logs` is equivalent to `_origin:logs` — it targets the origin project only. +* Only a single index is accepted. Wildcards and [project routing](/explore-analyze/cross-project-search/cross-project-search-project-routing.md) are not supported. +* Requests to linked projects are subject to the same [security model](/explore-analyze/cross-project-search.md#security) as other {{cps}} requests. + +For additional information, refer to the [{{product.painless}} execute API reference](elasticsearch://reference/scripting-languages/painless/painless-api-examples.md). +