Missing docvalue fields on reindex


(Xavi Ametller) #1

Hello there,

I'm using the reindex api endpoint to create a reduced version of an index:

POST /_reindex
{
  "size": 10,
  "source": {
    "index": "big-index",
    "_source": ["*"],
    "query": {
      "match_all": {}
    }
  },
  "dest": {
    "index": "small-index"
  }
}

Thing is, the documents in the big-index contain some doc value fields which are missing in the small-index.
I am able to see that by running this kind of query:

GET /big-index/_search
{
  "query": {
    "match_all": {}
  },
  "docvalue_fields" : ["doc_value_field"]
}

If I run this query against the big index, then the response has a fields section inside hits, but if I run it against the small index there's no such fields section and information can't be filtered by (as opposite as in the big-index).

I have tried to:

  • Specify "docvalue_fields" as part of reindex source, it does not complain but data is not there neither.
  • Copy the mapping from the original index to the new one be fore reindexing but doesn't work neither.

Am I missing something? Looking around documentation and forums seems like everything should be copied and feel like I'm missing something very basic...

Thanks!
Xavi


(Zachary Tong) #2

Hm, could you post the mapping for the new and old index? Do you have any index templates which might be affecting things?

What version of Elasticsearch is this?


(Xavi Ametller) #3

Hi @polyfractal,

  1. I'm sorry but I can't share the mappings. I can say though, that I copied the mapping from one index to the other (called the get mapping API from the original index and PUT mapping on the destination index with the answer of the previous call) before running the reindex.
  2. We don't have any index templates
  3. We use 5.1.1

Thanks for the answer, as of now, we will move forward ignoring this issue as it is not blocking us anymore. If I ever find an answer I will post it here.
Cheers


(system) #4

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