Ben
Ben

Reputation: 6086

Elasticsearch - pagination of continuously updating data

I am new to ES and have a requirement to store real-time data streams. This is time-stamp based data.

Can anyone advise on the best way to support pagination given that the results set will be updating continuously?

I understand that Twitter and Facebook etc use cursor based pagination. I was wondering if there was a similar concept within ES?

Upvotes: 3

Views: 3332

Answers (2)

Daniel Winterstein
Daniel Winterstein

Reputation: 2556

There's nothing quite the same as a cursor, but you have a couple of options.

The easiest to use for displaying small sets of results to a user, is paging with the from parameter. See http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/pagination.html

The other option is scrolling: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-scroll.html

Or you can manage cursoring yourself, using the timestamps as cursors, and converting them into conditions on your query.

Upvotes: 5

Алексей
Алексей

Reputation: 1847

in Es you can achieve pagination using search type SCAN and specifying SCROLL. However you would get a snapshot meaning you will get results that exist at the moment when you run a query.

Upvotes: 1

Related Questions