Sorting and pagination

Hi all,

I was wondering how the scroing works when I ask for paginating results. I
run a test with the following search requests:

Request 1
I run the following search request and write the results in a file.

SearchRequestBuilder searchRequestBuilder = client.prepareSearch(INDEX_NAME)
.setSize(10)
.setQuery(queryBuilder);
SearchResponse searchResponse =
searchRequestBuilder.execute()
.actionGet();

Request 2
I run the folloing search requests and write the results in a file
(actually two files, one for each request).

SearchRequestBuilder searchRequestBuilder = client.prepareSearch(INDEX_NAME)
.setFrom(0)
.setSize(5)
.setQuery(queryBuilder);
SearchResponse searchResponse =
searchRequestBuilder.execute()
.actionGet();

SearchRequestBuilder searchRequestBuilder = client.prepareSearch(INDEX_NAME)
.setFrom(1)
.setSize(5)
.setQuery(queryBuilder);
SearchResponse searchResponse =
searchRequestBuilder.execute()
.actionGet();

After that I check if I join the two files from the second request if it
will be the same with the first one. Unfortunately, I noticed that the
results from the second request are not sorted in a right way like the
results from the first one. (I am not using any special sorting so I
suppose that the sorting should be done by the relevance score).

Does anyone knows more information about this issue?

FYI. I use elasticsearch 1.4.0

Cheers,
Sotiris

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/dae2524c-a990-45d5-a4fc-c3fbc0c2741d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Are you sure you want the hits 0-5 and 1-6 in request 2? I assume you want
hits 0-5 and 5-10.

Jörg

On Wed, Dec 10, 2014 at 4:48 PM, Sotiris Beis sot.beis@gmail.com wrote:

Hi all,

I was wondering how the scroing works when I ask for paginating results. I
run a test with the following search requests:

Request 1
I run the following search request and write the results in a file.

SearchRequestBuilder searchRequestBuilder = client.prepareSearch(
INDEX_NAME)
.setSize(10)
.setQuery(queryBuilder);
SearchResponse searchResponse =
searchRequestBuilder.execute()
.actionGet();

Request 2
I run the folloing search requests and write the results in a file
(actually two files, one for each request).

SearchRequestBuilder searchRequestBuilder = client.prepareSearch(
INDEX_NAME)
.setFrom(0)
.setSize(5)
.setQuery(queryBuilder);
SearchResponse searchResponse =
searchRequestBuilder.execute()
.actionGet();

SearchRequestBuilder searchRequestBuilder = client.prepareSearch(
INDEX_NAME)
.setFrom(1)
.setSize(5)
.setQuery(queryBuilder);
SearchResponse searchResponse =
searchRequestBuilder.execute()
.actionGet();

After that I check if I join the two files from the second request if it
will be the same with the first one. Unfortunately, I noticed that the
results from the second request are not sorted in a right way like the
results from the first one. (I am not using any special sorting so I
suppose that the sorting should be done by the relevance score).

Does anyone knows more information about this issue?

FYI. I use elasticsearch 1.4.0

Cheers,
Sotiris

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/dae2524c-a990-45d5-a4fc-c3fbc0c2741d%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/dae2524c-a990-45d5-a4fc-c3fbc0c2741d%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEjA%3DDFLc%3Dx608TNtEx_YpDzXgHNqi106YoN%2BLk1WmZvQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.