[DOCS] add source filtering example to reindex docs (#21835)

This commit is contained in:
Luca Cavanna 2016-11-29 09:22:54 +01:00 committed by GitHub
parent a884573898
commit c25f9b5fba
1 changed files with 22 additions and 0 deletions

View File

@ -227,6 +227,28 @@ POST _reindex
// CONSOLE
// TEST[setup:twitter]
The `source` section supports all the elements that are supported in a
<<search-request-body,search request>>. For instance only a subset of the
fields from the original documents can be reindexed using source filtering
as follows:
[source,js]
--------------------------------------------------
POST _reindex
{
"source": {
"index": "twitter",
"_source": ["user", "tweet"]
},
"dest": {
"index": "new_twitter"
}
}
--------------------------------------------------
// CONSOLE
// TEST[setup:twitter]
Like `_update_by_query`, `_reindex` supports a script that modifies the
document. Unlike `_update_by_query`, the script is allowed to modify the
document's metadata. This example bumps the version of the source document: