You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Armbrust, Daniel C." <Ar...@mayo.edu> on 2003/05/30 14:48:58 UTC

Document scoring - should I file a bug report?

I've noticed an oddity in scoring....

If I do my search like this:

searcher.search(query, filter, new HitCollector()
{
	public void collect(int doc, float score)
	{
		tempHits.add(new LuceneHits(doc, score));
	}
});


I get different scores for the resulting documents than I do if I do my search like this:

hits = searcher.search(query, filter);

Both methods return the same number of hits.  I can live with them returning different scores, I'm just curious as to why it happens.

Furthermore, the first method returns several scores that are greater than 1.0.  Isn't this supposed to be impossible?  The FAQ states that scores range from 0 to 1.

Thanks, 

Dan

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Re: Document scoring - should I file a bug report?

Posted by Doug Cutting <cu...@lucene.com>.
Armbrust, Daniel C. wrote:
> I've noticed an oddity in scoring....
> 
> If I do my search like this:
> 
> searcher.search(query, filter, new HitCollector()
> {
> 	public void collect(int doc, float score)
> 	{
> 		tempHits.add(new LuceneHits(doc, score));
> 	}
> });
> 
> 
> I get different scores for the resulting documents than I do if I do my search like this:
> 
> hits = searcher.search(query, filter);
> 
> Both methods return the same number of hits.  I can live with them returning different scores, I'm just curious as to why it happens.
> 
> Furthermore, the first method returns several scores that are greater than 1.0.  Isn't this supposed to be impossible?  The FAQ states that scores range from 0 to 1.

Scores from Hits are normalized so that the top score is never greater 
than 1.0.  Scores passed to a HitCollector are raw.

It is very possible in Lucene to get scores that are greater than 1.0. 
This bothers some folks, so Hits hides it, however it's difficult to 
hide it from a HitCollector.

Doug


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Re: Document scoring - should I file a bug report?

Posted by Julien Nioche <Ju...@lingway.com>.
I observed a change in the ordering of the results since I moved from 1.2 to
the 1.3 RC1 version of the API ( with the extensible Scoring API)
Maybe it's related?

----- Original Message -----
From: "Otis Gospodnetic" <ot...@yahoo.com>
To: "Lucene Developers List" <lu...@jakarta.apache.org>
Sent: Monday, June 02, 2003 6:09 AM
Subject: Re: Document scoring - should I file a bug report?


> Sounds wrong, but I have not used HitCollector much, so maybe I just
> don't know enough about it.  Regardless, it looks like this should be
> entered in Bugzilla.  If it is not a bug in the code, it is a bug in
> documentation - this type of behaviour, if correct, we need to document
> clearly.
>
> Thanks,
> Otis
> P.S.
> I don't remember seeing any unit tests that use HitCollector.  If
> you've go something in a unit test format, please attach it to the bug,
> so we can include it in the test suite.
>
>
> --- "Armbrust, Daniel C." <Ar...@mayo.edu> wrote:
> > I've noticed an oddity in scoring....
> >
> > If I do my search like this:
> >
> > searcher.search(query, filter, new HitCollector()
> > {
> > public void collect(int doc, float score)
> > {
> > tempHits.add(new LuceneHits(doc, score));
> > }
> > });
> >
> >
> > I get different scores for the resulting documents than I do if I do
> > my search like this:
> >
> > hits = searcher.search(query, filter);
> >
> > Both methods return the same number of hits.  I can live with them
> > returning different scores, I'm just curious as to why it happens.
> >
> > Furthermore, the first method returns several scores that are greater
> > than 1.0.  Isn't this supposed to be impossible?  The FAQ states that
> > scores range from 0 to 1.
> >
> > Thanks,
> >
> > Dan
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
> >
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> http://calendar.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Re: Document scoring - should I file a bug report?

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Sounds wrong, but I have not used HitCollector much, so maybe I just
don't know enough about it.  Regardless, it looks like this should be
entered in Bugzilla.  If it is not a bug in the code, it is a bug in
documentation - this type of behaviour, if correct, we need to document
clearly.

Thanks,
Otis
P.S.
I don't remember seeing any unit tests that use HitCollector.  If
you've go something in a unit test format, please attach it to the bug,
so we can include it in the test suite.


--- "Armbrust, Daniel C." <Ar...@mayo.edu> wrote:
> I've noticed an oddity in scoring....
> 
> If I do my search like this:
> 
> searcher.search(query, filter, new HitCollector()
> {
> 	public void collect(int doc, float score)
> 	{
> 		tempHits.add(new LuceneHits(doc, score));
> 	}
> });
> 
> 
> I get different scores for the resulting documents than I do if I do
> my search like this:
> 
> hits = searcher.search(query, filter);
> 
> Both methods return the same number of hits.  I can live with them
> returning different scores, I'm just curious as to why it happens.
> 
> Furthermore, the first method returns several scores that are greater
> than 1.0.  Isn't this supposed to be impossible?  The FAQ states that
> scores range from 0 to 1.
> 
> Thanks, 
> 
> Dan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org