Hi
Elastic 6.8.7
Let's say I have single index a. Then there is for example 1 document with id: 1.
(in real life there would be hundred thousands of documents of course)
Then at some time, let's say we need to reindex the whole index (source is not enabled, so I can't use reindex API).
So what I do, I create new index b (with same mappings as a), and create alias, so that new index b is write index.
This is how I create alias.
POST /_aliases
{
"actions": [
{
"add": {
"index": "a",
"alias": "a_index",
"is_write_index": false
}
},
{
"add": {
"index": "b",
"alias": "a_index",
"is_write_index": true
}
}
]
}
Then I will forward all reindex requests to this alias name "a_index" and my document "id: 1" is indexed into write index "b".
Now if I search this doc "id: 1", the result gives me 2, since this doc is present in both indexes.
GET a_index/_search?q=_id:1
...
"hits" : {
"total" : 2,
.....
Now, my question is, is it not possible, that after the doc with "id: 1" has bee reindexed into index "b", then this doc is automatically deleted from index "a" ?
Raul