How to get results pages using ElasticSearch?

I am working on retrieving data from an API with ElasticSearch and have some problems retrieving all the results.

I tried to use the from parameter without success, it even has strange behavior.

For example, I have one query that gives me 15 results, here is a different number of results depending on the value of the parameter:

from=9 - gives me 1 result
from=10 - gives me 7 results
from=11 - gives me 2 results
from=12 - gives me 5 results
from=13 - gives me 9 results

Thanks for the help!

+4
source share
1 answer

This is pretty simple from https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-from-size.html :

{ "from" : 0, "size" : 10, "query" : { "term" : { "user" : "kimchy" } } }

from , .. offset ( .. ). size - .

, .

+2

Source: https://habr.com/ru/post/1607030/


All Articles