Scroll and/or "from-size" for pagination - best practices


(Mauricio Alarcon) #1

Hi

I'm a bit confused here about the use of scroll and "From-size", I
was wondering if someone can give some light about them.

So far I've been using the scroll to get the next "page" of results
for the user, now I'm in need of having the user select which page go
to. From the docs "setFrom" is a method of SearchBuilder but couldn't
find it as a method of SearchScrollRequestBuilder.

It is my understanding that scroll will keep the relevant resources
related to the search to continue, so, isn't setting a starting point
"from" something that should be part of scroll? instead of calling a
completely new search? isn't this cheaper that do the search setting
the "from" param?

What are the best practices here related to pagination and how to deal
when user click on "show me page 6" instead of "next" page?

Cheers


(Lukáš Vlček) #2

Hi,

the way to go is to use "from" value in search request (do not use scroll
for user pagination). As the doc for scroll points out
http://www.elasticsearch.org/guide/reference/api/search/scroll.html it
should not be used for user requests.

Regards,
Lukas

On Fri, Sep 2, 2011 at 11:30 PM, maverick mauricio.alarcon@gmail.comwrote:

Hi

I'm a bit confused here about the use of scroll and "From-size", I
was wondering if someone can give some light about them.

So far I've been using the scroll to get the next "page" of results
for the user, now I'm in need of having the user select which page go
to. From the docs "setFrom" is a method of SearchBuilder but couldn't
find it as a method of SearchScrollRequestBuilder.

It is my understanding that scroll will keep the relevant resources
related to the search to continue, so, isn't setting a starting point
"from" something that should be part of scroll? instead of calling a
completely new search? isn't this cheaper that do the search setting
the "from" param?

What are the best practices here related to pagination and how to deal
when user click on "show me page 6" instead of "next" page?

Cheers


(Mauricio Alarcon) #3

Thanks Lukas, really appreciated the info

Regards

On Sep 2, 7:05 pm, Lukáš Vlček lukas.vl...@gmail.com wrote:

Hi,

the way to go is to use "from" value in search request (do not use scroll
for user pagination). As the doc for scroll points outhttp://www.elasticsearch.org/guide/reference/api/search/scroll.htmlit
should not be used for user requests.

Regards,
Lukas

On Fri, Sep 2, 2011 at 11:30 PM, maverick mauricio.alar...@gmail.comwrote:

Hi

I'm a bit confused here about the use of scroll and "From-size", I
was wondering if someone can give some light about them.

So far I've been using the scroll to get the next "page" of results
for the user, now I'm in need of having the user select which page go
to. From the docs "setFrom" is a method of SearchBuilder but couldn't
find it as a method of SearchScrollRequestBuilder.

It is my understanding that scroll will keep the relevant resources
related to the search to continue, so, isn't setting a starting point
"from" something that should be part of scroll? instead of calling a
completely new search? isn't this cheaper that do the search setting
the "from" param?

What are the best practices here related to pagination and how to deal
when user click on "show me page 6" instead of "next" page?

Cheers


(system) #4