You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Bing Li <lb...@gmail.com> on 2012/01/20 19:42:50 UTC
Sort for Retrieved Data
Dear all,
I have a question when sorting retrieved data from Solr. As I know, Lucene
retrieves data according to the degree of keyword matching on text field
(partial matching).
If I search data by string field (complete matching), how does Lucene sort
the retrieved data?
If I add some filters, such as time, what about the sorting way?
If I just need to top ones, is it proper to just add rows?
If I want to add new sorting ways, how to do that?
Thanks so much!
Bing
Re: Sort for Retrieved Data
Posted by Erick Erickson <er...@gmail.com>.
See belowl
On Fri, Jan 20, 2012 at 10:42 AM, Bing Li <lb...@gmail.com> wrote:
> Dear all,
>
> I have a question when sorting retrieved data from Solr. As I know, Lucene
> retrieves data according to the degree of keyword matching on text field
> (partial matching).
>
> If I search data by string field (complete matching), how does Lucene sort
> the retrieved data?
>
If scores match exactly, which may well be the case here, then the tiebreaker
is internal Lucene document id.
> If I add some filters, such as time, what about the sorting way?
>
It doesn't. Filters only restrict the result set, they have no influence
on sorting
> If I just need to top ones, is it proper to just add rows?
>
I don't understand what you're asking. If you want the top 100
rather than the top 10, yes you can increase the &rows
parameter or page (see &start).
> If I want to add new sorting ways, how to do that?
See the &sort parameter. This page comes up as the
first google search on "solr sort"....
http://lucene.apache.org/solr/tutorial.html
Best
Erick
>
> Thanks so much!
> Bing