Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
3 changes: 3 additions & 0 deletions docs/docset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ subs:
api-path-parms-title: "Path parameters"
api-request-body-title: "Request body"
api-examples-title: "Examples"
cps: "cross-project search"
cps-init: "CPS"
cps-cap: "Cross-project search"
ecloud: "Elastic Cloud"
ess: "Elasticsearch Service"
ece: "Elastic Cloud Enterprise"
Expand Down
95 changes: 89 additions & 6 deletions docs/reference/elasticsearch/rest-apis/reindex-indices.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
- [Reindex with custom routing](#docs-reindex-routing)
- [Reindex with an ingest pipeline](#reindex-with-an-ingest-pipeline)
- [Reindex from remote](#reindex-from-remote)
- [Reindex in {{cps}}](#reindex-cps)

**Troubleshooting**
- [Monitor reindex tasks](#monitor-reindex-tasks)
Expand Down Expand Up @@ -618,11 +619,6 @@
}
}
```
% TEST[setup:host]
% TEST[s/^/PUT my-index-000001\n/]
% TEST[s/"host": [^}]*,/"host": "http:\/\/\${host}",/]
% TEST[s/"username": "user",/"username": "test_admin",/]
% TEST[s/"password": "pass"/"password": "x-pack-test-password"/]

The `host` parameter must contain a scheme, host, port (for example, `https://<OTHER_HOST_URL>:9200`), and optional path (for example, `https://<OTHER_HOST_URL>:9200/proxy`).

Expand Down Expand Up @@ -710,7 +706,7 @@

The list of allowed hosts must be configured on any node that will coordinate the reindex.

* In {{serverless-full}}, only remote hosts in Elastic Cloud Hosted are allowed. {applies_to}`serverless: preview`
* In {{serverless-full}}, remote hosts in {{ech}} and other {{serverless-short}} projects are allowed. {applies_to}`serverless: preview`
Comment thread
szabosteve marked this conversation as resolved.
Outdated

### Compatibility [reindex-remote-compatibility]

Expand Down Expand Up @@ -791,9 +787,96 @@

Reindex from remote supports configurable SSL settings.
These must be specified in the `elasticsearch.yml` file, with the exception of the secure settings, which you add in the {{es}} keystore.
It is not possible to configure SSL in the body of the reindex API request.

Check notice on line 790 in docs/reference/elasticsearch/rest-apis/reindex-indices.md

View workflow job for this annotation

GitHub Actions / docs-preview / vale

Elastic.Wordiness: Consider using 'impossible' instead of 'not possible'.
Refer to [Reindex settings](/reference/elasticsearch/configuration-reference/index-management-settings.md#reindex-settings).

## Reindex in {{cps}} [reindex-cps]
```{applies_to}
serverless: preview
```

When [{{cps}}](docs-content://explore-analyze/cross-project-search.md) is enabled, the [Reindex API](https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-reindex) can pull documents from indices across linked {{serverless-short}} projects.
The `source.index` field resolves across the origin project and all of its linked projects.

Check notice on line 799 in docs/reference/elasticsearch/rest-apis/reindex-indices.md

View workflow job for this annotation

GitHub Actions / docs-preview / vale

Elastic.Wordiness: Consider using 'all' instead of 'all of '.
You can narrow the scope of the source using [project routing](docs-content://explore-analyze/cross-project-search/cross-project-search-project-routing.md) or [qualified index expressions](docs-content://explore-analyze/cross-project-search/cross-project-search-search.md#search-expressions).
Documents are always written to the destination index on the origin project.

There are two ways to use reindex to move data between projects in {{cps-init}}:
Comment thread
szabosteve marked this conversation as resolved.
Outdated

* [**Reindex across linked projects**](#reindex-cps-linked): reindex from the origin project and its [linked projects](docs-content://explore-analyze/cross-project-search/cross-project-search-link-projects.md).
* [**Reindex from a remote project**](#reindex-cps-remote): reindex from a {{serverless-short}} project or {{ech}} deployment that is not linked to the origin project, by specifying `source.remote.host`.
Comment thread
szabosteve marked this conversation as resolved.
Outdated

### Reindex across linked projects [reindex-cps-linked]

When not using `source.remote`, the Reindex API pulls documents from the origin project and its linked projects:
Comment thread
szabosteve marked this conversation as resolved.
Outdated

* Only the origin project and projects [linked](docs-content://explore-analyze/cross-project-search/cross-project-search-link-projects.md) to it can be targeted.
* The `source.index` field resolves across the origin project and all linked projects.
* You can use `project_routing` in the `source` section to limit which projects are included.
* Qualified index expressions (for example, `project1:logs`) are supported.

The following request reindexes documents from the `logs` index, limiting the source to the linked project with alias `project1`:

```console
POST _reindex
{
"source": {
"project_routing": "_alias:project1",
"index": "logs"
},
"dest": {
"index": "new_index"
}
}
```

### Reindex from a remote project [reindex-cps-remote]

When using `source.remote.host`, you can reindex from {{serverless-short}} projects or {{ech}} deployments that are not linked to the origin project.

The `source.index` field on the remote side also resolves across the remote project and all of its linked projects.

Check notice on line 836 in docs/reference/elasticsearch/rest-apis/reindex-indices.md

View workflow job for this annotation

GitHub Actions / docs-preview / vale

Elastic.Wordiness: Consider using 'all' instead of 'all of '.
Comment thread
szabosteve marked this conversation as resolved.
Outdated
For {{cps}} to work on the remote side, you must authenticate with a Cloud API key. A stack API key only provides access to the remote project itself, not its linked projects.
Comment thread
szabosteve marked this conversation as resolved.
Outdated

The following request reindexes documents from the `logs` index on a remote project. The source targets the `logs` index on the remote project and any of its linked projects, but not the `logs` index on the origin project (the project you sent the reindex request to):

```console
POST _reindex
{
"source": {
"remote": {
"host": "https://my-remote-project.es.us-east-1.aws.elastic.cloud:443",
"api_key": "<API_KEY>"
},
"index": "logs"
},
"dest": {
"index": "new_index"
}
}
```

You can add `project_routing` to the `source` section to limit which of the remote project's linked projects are included. The following request limits the reindex source to the remote project's origin project only:

```console
POST _reindex
{
"source": {
"remote": {
"host": "https://my-remote-project.es.us-east-1.aws.elastic.cloud:443",
"api_key": "<API_KEY>"
},
"project_routing": "_alias:_origin",
"index": "logs"
},
"dest": {
"index": "new_index"
}
}
```

::::{note}
`project_routing` is only supported when the remote target is a {{serverless-short}} project. If you include `project_routing` in a request targeting a non-{{serverless-short}} deployment, the request returns an error.
::::

## Monitor reindex tasks [monitor-reindex-tasks]

When run asynchronously with `wait_for_completion=false`, a reindex task can be monitored with the task management API:
Expand Down
Loading