One type of document reindex works just fine (the parent documents), however a second type which contains a _parent mapping to the first type fails. The reindex task errors with failures of type "routing_missing_exception". (Since the mapping has a _parent field, I believe the _routing is set to 'required'). It appears neither the _parent or _routing fields are being set. After reviewing the documentation I attempted:
Trying all the available settings for the
routingoption on the dest request e.g.
Creating a script to manually assign the _routing field from the _parent field. (Grasping at straws here.) (e.g.
"ctx._routing = ctx._parent").
"fields": "*"to a
"query"on the source.
(1) and (2) did nothing, and I received the same error. (3) errored with
"Deprecated field [fields] used, expected [stored_fields] instead", but if I then use
stored_fields I get
"Validation Failed: 1: stored_fields is in not supported in this context;"
The docs say:
By default if _reindex sees a document with routing then the routing is preserved unless it’s changed by the script.
I suspect that is technically true, but _reindex is not seeing the _parent or _routing from the source.
I looked through the source and it appears the reindex-from-remote uses the scan/scroll method, however on 1.7, I have been unable to get a scan/scroll call to return either _parent or _routing in the results.
I even noticed there were tests for parent/child documents from remote in the _reindex source, so I'm thinking I just haven't figured out the right way to do it. What am I missing?