Elastic search _doc with sort

Viewed 1715

I am paginating elastic search data using search_after with sort using _uid. Sorting over huge amount of data leads to circuit breaker exception, as the field data size limit is exceeded. A possible solution provided by elastic search for sorting the large dataset is with _doc (https://www.elastic.co/guide/en/elasticsearch/reference/6.3/search-request-sort.html) This helps in getting the response quickly without failing with circuit breaker exception. However I am concerned about the unique value which is being used in search_after to get the next set of records as this value will be used as a cursor to get the next records. https://www.elastic.co/guide/en/elasticsearch/reference/6.3/search-request-scroll.html

To understand what does the _doc value represent I was going through the documentation but there is no description added.

In my data I see more than few records with same _doc value. these documents with same _doc value has different _ids meaning they are two different records. Can anyone help me in understanding what does this value represents. Can I used it in search_after? I am using elastic version 5.4

0 Answers
Related