You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Teruhiko Kurosaka <Ku...@basistech.com> on 2008/11/06 17:52:46 UTC
What does Sort.RELEVANCE do?
I can specify Sort.RELEVANCE to Searcher.search as in:
hits = searcher.search(q, Sort.RELEVANCE); // Using deprecated method to
make it short
What is the real effect of specifying the Sort argument like this?
Does Sort.RELEVANCE sorts the hits in order of the score
shown in Sect. 3.3 "Understanding Lucene scoring"
of Lucene In Action? If I use the search method without
a sort argument, is it equivalent of specifying
Sort.INDEXORDER?
----
T. "Kuro" Kurosaka, Basis Technology
San Francisco, California, U.S.A.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: What does Sort.RELEVANCE do?
Posted by Michael McCandless <lu...@mikemccandless.com>.
Section 5.1.2 of LIA also explains this.
Sort.RELEVANCE sorts by relevance score, descending, breaking ties by
sorting by doc ID, ascending, and s the default if you don't specify a
sort order.
Sort.INDEXORDER sorts only by doc ID, which is not the default sort.
Mike
Teruhiko Kurosaka wrote:
> I can specify Sort.RELEVANCE to Searcher.search as in:
>
> hits = searcher.search(q, Sort.RELEVANCE); // Using deprecated
> method to
> make it short
>
> What is the real effect of specifying the Sort argument like this?
>
> Does Sort.RELEVANCE sorts the hits in order of the score
> shown in Sect. 3.3 "Understanding Lucene scoring"
> of Lucene In Action? If I use the search method without
> a sort argument, is it equivalent of specifying
> Sort.INDEXORDER?
>
> ----
> T. "Kuro" Kurosaka, Basis Technology
> San Francisco, California, U.S.A.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org