Custom scoring example

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

Custom scoring example

Ravis-3
I am looking for an example if anyone has done any custom scoring with
Solr/Lucene.

I need to implement a Query similar to DisjunctionMaxQuery, the only
difference would
be it should score based on sum of score of sub queries' scores instead of
max.

Any custom scoring example will help.

(On one hand, DisjunctionMaxQuery itself is an example :-). It is too
professional :-)

Thanks,
Ravi
Reply | Threaded
Open this post in threaded view
|

Re: Custom scoring example

Grant Ingersoll-2
The only thing I can suggest is that each and every Query in Solr/
Lucene is an example of custom scoring.  You might be better off  
starting w/ TermQuery and working through PhraseQuery, BooleanQuery,  
on up.  At the point you get to DisJunctionMax, then ask questions  
about that specific one.

On Sep 5, 2008, at 8:01 PM, Ravindra Sharma wrote:

> I am looking for an example if anyone has done any custom scoring with
> Solr/Lucene.
>
> I need to implement a Query similar to DisjunctionMaxQuery, the only
> difference would
> be it should score based on sum of score of sub queries' scores  
> instead of
> max.
>
> Any custom scoring example will help.
>
> (On one hand, DisjunctionMaxQuery itself is an example :-). It is too
> professional :-)
>
> Thanks,
> Ravi


Reply | Threaded
Open this post in threaded view
|

Re: Custom scoring example

hossman
In reply to this post by Ravis-3

: I need to implement a Query similar to DisjunctionMaxQuery, the only
: difference would
: be it should score based on sum of score of sub queries' scores instead of
: max.

BooleanQuery computes scores that are the sub of hte subscores -- you just
need to disable the coordFactor (there is a constructor arg for this).



-Hoss

Reply | Threaded
Open this post in threaded view
|

Re: Custom scoring example

Mike Klaas
In reply to this post by Ravis-3

On 5-Sep-08, at 5:01 PM, Ravindra Sharma wrote:

> I am looking for an example if anyone has done any custom scoring with
> Solr/Lucene.
>
> I need to implement a Query similar to DisjunctionMaxQuery, the only
> difference would
> be it should score based on sum of score of sub queries' scores  
> instead of
> max.
>
> Any custom scoring example will help.
>
> (On one hand, DisjunctionMaxQuery itself is an example :-). It is too
> professional :-)

DisjunctionMaxQuery takes the max plus (tiebreak)*sum(others).  So, if  
you set tie=1.0, dismax becomes exactly what you are seeking.

-Mike