changing scoring formula

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

changing scoring formula

sumittyagi
is there any way to change the score of the documents.
Actually i want to modify the scores of the documents dynamically, everytime for a given query the results will be sorted according to "lucene scoring formula + an equation".
how can i do that...i saw that lucene scoring page but i am not getting exactly how to do that...
please advice me
Reply | Threaded
Open this post in threaded view
|

Re: changing scoring formula

Michael Stoppelman
Sumit,

The class you'll end up subclassing from would be:
http://hudson.zones.apache.org/hudson/job/Lucene-trunk/javadoc//org/apache/lucene/search/Similarity.htmlor
http://hudson.zones.apache.org/hudson/job/Lucene-trunk/javadoc//org/apache/lucene/search/DefaultSimilarity.html

On an IndexSearcher you can setSimilarity() class that you want to use for
scoring, see:
http://hudson.zones.apache.org/hudson/job/Lucene-trunk/javadoc//org/apache/lucene/search/IndexSearcher.html
http://hudson.zones.apache.org/hudson/job/Lucene-trunk/javadoc//org/apache/lucene/search/Searcher.html#setSimilarity(org.apache.lucene.search.Similarity)

Does that help?

-M

On Wed, Mar 5, 2008 at 1:16 PM, sumittyagi <[hidden email]> wrote:

>
> is there any way to change the score of the documents.
> Actually i want to modify the scores of the documents dynamically,
> everytime
> for a given query the results will be sorted according to "lucene scoring
> formula + an equation".
> how can i do that...i saw that lucene scoring page but i am not getting
> exactly how to do that...
> please advice me
> --
> View this message in context:
> http://www.nabble.com/changing-scoring-formula-tp15860538p15860538.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: changing scoring formula

John Wang-9
In reply to this post by sumittyagi
you can always modify the raw lucene score in the hitCollector.
-John

On Wed, Mar 5, 2008 at 1:16 PM, sumittyagi <[hidden email]> wrote:

>
> is there any way to change the score of the documents.
> Actually i want to modify the scores of the documents dynamically,
> everytime
> for a given query the results will be sorted according to "lucene scoring
> formula + an equation".
> how can i do that...i saw that lucene scoring page but i am not getting
> exactly how to do that...
> please advice me
> --
> View this message in context:
> http://www.nabble.com/changing-scoring-formula-tp15860538p15860538.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>