Solr Sorting Bug in Riak Search?

Eric Moritz eric at
Fri Apr 1 08:44:38 EDT 2011

Hi, I was just digging through the riak search code and I think there
may be a bug, but I may be mistaken (my Erlang isn't that great).

It appears that the search is performed, sorted by score, sliced using
the start and rows values.  After that happens, if there is a sort
param, the results are then sorted by
the sort param.

If this is correct, then there appears to be a bug that will provide
unexpected sorting.  For instance.  Let's say we have the results:

a, 0
d, 1
c, 2
b, 3
e, 4

where index 0 is the value and index 1 is the score.  Here the result
is sorted by the score.  If we limit the result to 3 items we have:

a, 0
d, 1
c, 1

Then we sort by the value:

a, c, d

I would expect that sorting by the value would return the following list:

a, b, c

because that is the order of the entire search result not the limited
set.  By limiting the query set before the sort is performed, it is
possible to not receive values that should be in the list.

Is this correct?


More information about the riak-users mailing list