2

My company is using elasticsearch 2.3.4. We have a cluster that contains 38 ES nodes, and we've been having a problem with reindexing some of our data lately... We've reindexed before very large indexes and had no problems, but recently, when trying to reindex much smaller indexed (less than 10GB) - we get : "SearchContextMissingException [No search context found for id [XXX]]". We have no idea what's causing this problem or how to fix it. We'd like some guidance. Has anyone saw this exception before?

elik
  • 21
  • 2
  • Are you reindexing using spark ( hive , or anything using elasticsearch-hadoop ) ? There were few issues with elasticsearch spark with same exception – Nirmal May 05 '17 at 15:10
  • i'm using elasticsearch's reindex API – elik May 05 '17 at 17:07

2 Answers2

2

From github comments on issues related to this , i think this can be avoided by changing batch size :

From documentation:

By default _reindex uses scroll batches of 1000. You can change the batch size with the size field in the source element:

POST _reindex
{
  "source": {
    "index": "source",
    "size": 100
  },
  "dest": {
    "index": "dest",
    "routing": "=cat"
  }
}
Nirmal
  • 1,276
  • 8
  • 16
  • but according to the documentation the size field isn't the batch size, it's the number of documents that will be reindexed into the index – elik May 05 '17 at 18:17
  • this is size inside "source" object . btw I was quoting from documentation :-) – Nirmal May 05 '17 at 18:19
  • oh.. sorry, didn't saw it.I'll try it and let ou know :) – elik May 05 '17 at 18:38
  • tough luck , sorry ! but this seems to be definitely part of few PR's and discussions in their repo and should be patched in more recent version . – Nirmal May 07 '17 at 06:41
1

I had the same problem with an index that holds many huge documents. I had to reduce the batch size down to 10. (100 and 50 both didn't work).

This was the request that worked in the end:

POST _reindex?slices=5&refresh
{
  "source": {
    "index": "source_index",
    "size": 10
  },
  "dest": {
    "index": "dest_index"
  }
}

You should also set the slices to the number of shards you have in your index.

samy
  • 1,396
  • 2
  • 19
  • 41