Sort After Specifying Fields in QueryStringQuery


(davrob) #1

Hi,

Using QueryStringQuery, if I searched on "_all:smith*" and did a sort-
by-name, without specifying fields to sort on using
QueryStringQuery.field() , the sort would span across all 2000 results
returned, paged in four 500 row pages. The pages were sorted correctly

  • The first page: A to G second: G to P third: P to W fourth:
    everything else

Now that I search on "smith*" and then specify 4 fields using
QueryStringQuery.field() and one boosted field, I find that I get 4
pages each sorted A-to-Z. So the first page starts with A and ends in
Z, the second page starts with A and ends in Z, and the third.

Best Regards,

David

.


(Shay Banon) #2

Gist a curl recreation, will have a look. http://www.elasticsearch.org/help.

On Friday, June 3, 2011 at 10:43 PM, davrob2 wrote:

Hi,

Using QueryStringQuery, if I searched on "_all:smith*" and did a sort-
by-name, without specifying fields to sort on using
QueryStringQuery.field() , the sort would span across all 2000 results
returned, paged in four 500 row pages. The pages were sorted correctly

  • The first page: A to G second: G to P third: P to W fourth:
    everything else

Now that I search on "smith*" and then specify 4 fields using
QueryStringQuery.field() and one boosted field, I find that I get 4
pages each sorted A-to-Z. So the first page starts with A and ends in
Z, the second page starts with A and ends in Z, and the third.

Best Regards,

David

.


(davrob) #3

Apologies, this was a client side issue. Server-side sorting flag had
been turned off in the client.

On Jun 3, 11:17 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

Gist a curl recreation, will have a look.http://www.elasticsearch.org/help.

On Friday, June 3, 2011 at 10:43 PM, davrob2 wrote:

Hi,

Using QueryStringQuery, if I searched on "_all:smith*" and did a sort-
by-name, without specifying fields to sort on using
QueryStringQuery.field() , the sort would span across all 2000 results
returned, paged in four 500 row pages. The pages were sorted correctly

  • The first page: A to G second: G to P third: P to W fourth:
    everything else

Now that I search on "smith*" and then specify 4 fields using
QueryStringQuery.field() and one boosted field, I find that I get 4
pages each sorted A-to-Z. So the first page starts with A and ends in
Z, the second page starts with A and ends in Z, and the third.

Best Regards,

David

.


(system) #4