Complete the code to start reindexing from source to destination index.
{
"source": { "index": "[1]" },
"dest": { "index": "new_index" }
}The source.index must be the name of the existing index you want to copy from.
Complete the code to add a query filter to reindex only documents where status is 'active'.
{
"source": {
"index": "old_index",
"query": { "term": { "status": "[1]" } }
},
"dest": { "index": "new_index" }
}The query filters documents with status equal to active to be reindexed.
Fix the error in the reindex request by completing the missing field for the destination index.
{
"source": { "index": "old_index" },
"dest": { "[1]": "new_index" }
}source instead of index in destination.The destination index must be specified with the index field inside dest.
Fill both blanks to reindex documents from 'old_index' to 'new_index' with a script that sets the field 'status' to 'archived'.
{
"source": { "index": "[1]" },
"dest": { "index": "[2]" },
"script": {
"source": "ctx._source.status = 'archived'"
}
}The source index is old_index and the destination index is new_index. The script updates the status field to 'archived' during reindexing.
Fill all three blanks to reindex documents from 'products' to 'products_new' only if 'price' is greater than 100, and add a script to increase 'price' by 10%.
{
"source": {
"index": "[1]",
"query": { "range": { "price": { "[2]": 100 } } }
},
"dest": { "index": "[3]" },
"script": {
"source": "ctx._source.price *= 1.1"
}
}gte instead of gt.The source index is products. The query uses gt to filter prices greater than 100. The destination index is products_new. The script increases the price by 10%.