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 sumittyagi <pi...@gmail.com> on 2008/03/05 22:16:06 UTC

changing scoring formula

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: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: changing scoring formula

Posted by Michael Stoppelman <st...@gmail.com>.
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 <pi...@gmail.com> 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: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: changing scoring formula

Posted by John Wang <jo...@gmail.com>.
you can always modify the raw lucene score in the hitCollector.
-John

On Wed, Mar 5, 2008 at 1:16 PM, sumittyagi <pi...@gmail.com> 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: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>