Elasticsearch how to query on ID field higher than x Elasticsearch how to query on ID field higher than x elasticsearch elasticsearch

Elasticsearch how to query on ID field higher than x


The best way to achieve what you want is to use the scroll/can API. However, if you still want to proceed that way, you can do it like this:

last_id = ...search.filter('range', id={'gt': last_id + 1, 'lt': last_id + 1000})