Copy missing documents(from a specific date) from old to new index


(Neha Agarwal) #1

I rebuilt the index. When the indexing was done, I deleted old index alias, and added the alias to the new index, as follows:-
POST /_aliases
{
"actions": [
{ "remove": { "index": "dfse_20151211", "alias": "dfse" }},
{ "add": { "index": "dfse_20151216", "alias": "dfse" }}
]
}

During the reindexing(making of the new index), documents were added to the old index.
I tried getting the missing documents as below, but I get an error.

elasticdump --input=http://server:9200/dfse_20151211 --output=http://server:9200/dfse_20151216 --type=data --bulk=true --limit=500 --bulk-use-output-index-name=true --searchBody="{"query":{"bool":{"must":[{"range":{"asset.submitDate":{"gte":"2015-12-15","lte":"2015-12-17"}}}]}}}"

SyntaxError: Unexpected token q
at Object.parse (native)
at Object. (C:\Users\ab85gc\AppData\Roaming\npm\node_modules\elasticdump\bin\elasticdump:46:23)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3

What am I doing wrong?


(system) #2