I have been tripping over finding a way to run a sort on a set of results by 2 or more attributes. Most likely "_score" plus something else.
Sample record values:
_score:100, price:50, size:25
_score:100, price:40, size:40
_score:100, price:45, size:30
_score:90, price:48, size:100
_score:90, price:70, size:50
If sorting by _score (desc) then price (desc), I would expect the ordering:
1, 3, 2, 5, 4 (results grouped by _score, subsorted by price desc; 1,2,3 will stay together, as will 4,5, but I would like to affect the ordering within those groups)
If sorting by _score (desc) then size (desc), I would expect the ordering:
2, 3, 1, 4, 5
I imagine that this is possible, but I have not yet found the correct method. Can anyone help me out? Thanks!!!
On Tuesday, January 31, 2012 at 6:41 PM, rrgrzcool wrote:
I have been tripping over finding a way to run a sort on a set of results by
2 or more attributes. Most likely "_score" plus something else.
Sample record values:
_score:100, price:50, size:25
_score:100, price:40, size:40
_score:100, price:45, size:30
_score:90, price:48, size:100
_score:90, price:70, size:50
If sorting by _score (desc) then price (desc), I would expect the ordering:
1, 3, 2, 5, 4 (results grouped by _score, subsorted by price desc; 1,2,3
will stay together, as will 4,5, but I would like to affect the ordering
within those groups)
If sorting by _score (desc) then size (desc), I would expect the ordering:
2, 3, 1, 4, 5
I imagine that this is possible, but I have not yet found the correct
method. Can anyone help me out? Thanks!!!
On Tuesday, January 31, 2012 at 6:41 PM, rrgrzcool wrote:
I have been tripping over finding a way to run a sort on a set of results
by
2 or more attributes. Most likely "_score" plus something else.
Sample record values:
_score:100, price:50, size:25
_score:100, price:40, size:40
_score:100, price:45, size:30
_score:90, price:48, size:100
_score:90, price:70, size:50
If sorting by _score (desc) then price (desc), I would expect the ordering:
1, 3, 2, 5, 4 (results grouped by _score, subsorted by price desc; 1,2,3
will stay together, as will 4,5, but I would like to affect the ordering
within those groups)
If sorting by _score (desc) then size (desc), I would expect the ordering:
2, 3, 1, 4, 5
I imagine that this is possible, but I have not yet found the correct
method. Can anyone help me out? Thanks!!!
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.