Reindex api request failing on Elasticsearch 6.6

Facing issue while running reindex api on ES v6.6.
Please refer below shared output:
Command:

$ curl  -XPOST http://<elasticsearch-svc>:9200/_reindex?pretty -H 'Content-Type: application/json' -d'
 {
 "source": {
 "index": "dc-log-2020-11-02"
 },
 "dest": {
 "index": "dc-log-new-index"
 }
}
 '

Output:

{
"error" : {
"root_cause" : [
{
"type" : "illegal_argument_exception",
"reason" : "[dc-log-2020-11-02][dc-log-mapping][SVCz6XgBjqpvb352VFA8] didn't store _source"
}
],
"type" : "illegal_argument_exception",
"reason" : "[dc-log-2020-11-02][dc-log-mapping][SVCz6XgBjqpvb352VFA8] didn't store _source"
},
"status" : 400
}

Please suggest what could be the cause for this error and how this can be resolved.
Thanks in advance

Hi,

Does your Source Index contain the _source field or is it disabled?
If it is disabled you cannot use the reindex API to reindex the data as the documentation states:

Reindex requires _source to be enabled for all documents in the source index.

Best regards
Wolfram

Hi,
Thanks for the quick reply.
How can I verify if _source field is enabled or disabled?

You can either check the mapping for the index which shows something like this:

"_source": {
   "enabled": false
}

or just check in Kibana/Elasticsearch query if the _source field exists...

Thank you for the info.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.