Scoring while sorting

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Scoring while sorting

dmitri
What is the point to calculate score if the result set is going to be sorted by some field?

Is it ok to replace several terms query (a OR b OR c) with MatchAllQuery and RangeFilters (from a to a, from b to b, from c to c) if sorting is needed? Won't it be faster?
---------------------
dmitri
Reply | Threaded
Open this post in threaded view
|

Re: Scoring while sorting

Yonik Seeley-2
On 2/21/07, dmitri <[hidden email]> wrote:
> What is the point to calculate score if the result set is going to be sorted
> by some field?
>
> Is it ok to replace several terms query (a OR b OR c) with MatchAllQuery and
> RangeFilters (from a to a, from b to b, from c to c) if sorting is needed?
> Won't it be faster?

Yes.

Solr actually has an optional optimization where a query with a sort
without a score component can use a cached filter and re-sort that.

-Yonik

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Scoring while sorting

Otis Gospodnetic-2
In reply to this post by dmitri
 ----- Original Message ---From: dmitri <[hidden email]>

> What is the point to calculate score if the result set is going to be sorted
> by some field?

No point, I believe, unless your sort includes relevance score.  I believe there is a Lucene patch that involves a Matcher (a new concept for Lucene) which does only matching without scoring.  If you try that patch, please let us know how it works.

Otis
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Simpy -- http://www.simpy.com/  -  Tag  -  Search  -  Share




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Scoring while sorting

Chris Hostetter-3

: > What is the point to calculate score if the result set is going to be sorted
: > by some field?

: No point, I believe, unless your sort includes relevance score.  I

...which is non trivial information to deduce, since a SortField can
contain a SortComparatorSource which uses a ScoreDocComparator which can
do anything it wants with the ScoreDoc.

If you know that you really don't care about score, you can use Filters
instead of Queries and then sort the docs represented by bits() yourself
... this is an approachSolr takes if a DocSet (Solr concept roughly equal
to a BitSet of documents) is already in the cache and you want the first N
sorted by a field.

(the heart of the jira issue Otis refered to is unifying the concepts of a
Query Scorer and a Filter into a common base class: Matcher)



-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]