Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
92 changes: 87 additions & 5 deletions docs/reference/elasticsearch/rest-apis/reindex-indices.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
**Route or send data elsewhere**
- [Reindex with custom routing](#docs-reindex-routing)
- [Reindex with an ingest pipeline](#reindex-with-an-ingest-pipeline)
- [Reindex in {{cps}}](#reindex-cps)
- [Reindex from remote](#reindex-from-remote)

**Troubleshooting**
Expand Down Expand Up @@ -587,8 +588,94 @@
* `_version`
* `_routing`

Setting `_version` to `null` or clearing it from the `ctx` map is just like not sending the version in an indexing request; it will cause the document to be overwritten in the destination regardless of the version on the target or the version type you use in the reindex API request.

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

View workflow job for this annotation

GitHub Actions / docs-preview / vale

Elastic.Semicolons: Use semicolons judiciously.

Check warning on line 591 in docs/reference/elasticsearch/rest-apis/reindex-indices.md

View workflow job for this annotation

GitHub Actions / docs-preview / vale

Elastic.DontUse: Don't use 'just'.

## Reindex in {{cps}} [reindex-cps]
Comment thread
szabosteve marked this conversation as resolved.
Outdated
```{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 599 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 reindex 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:

* 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.
Comment thread
szabosteve marked this conversation as resolved.
Outdated

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

Check notice on line 636 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 '.

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):
Comment thread
szabosteve marked this conversation as resolved.
Outdated

```console
POST _reindex
{
"source": {
"remote": {
"host": "https://my-remote-project.es.us-east-1.aws.elastic.cloud:443",
"api_key": "<API_KEY>"
},
"index": "logs"
Comment thread
szabosteve marked this conversation as resolved.
Outdated
},
"dest": {
"index": "new_index"
}
}
```
Comment thread
szabosteve marked this conversation as resolved.
Outdated

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>"
},
Comment thread
szabosteve marked this conversation as resolved.
Outdated
"project_routing": "_alias:_origin",
"index": "logs"
},
"dest": {
"index": "new_index"
}
}
```

::::{note}
`project_routing` is not supported when the remote target is an {{ech}} deployment. If you include `project_routing` in a request targeting an {{ech}} deployment, the request returns an error.
Comment thread
szabosteve marked this conversation as resolved.
Outdated
::::

## Reindex from remote [reindex-from-remote]
```{applies_to}
stack: ga
Expand Down Expand Up @@ -618,11 +705,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
Loading