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 Vikas Gupta <vg...@cs.utexas.edu> on 2004/12/14 10:53:05 UTC

Hit 2 has score less than Hit 3

I have come across a scenario where the hits returned are not sorted. Or
maybe they are sorted but the explanation is not correct.

Take a look at
http://cofferdam.cs.utexas.edu:8080/search.jsp?query=space+odyssey&hitsPerPage=10&hitsPerSite=0

Look at the top 3 results.

Score of Hit 1 is 1.0188559
Score of Hit 2 is 0.9934416
Score of Hit 3 is 1.0188559

I can't explain how score of hit 2 can be < hit 3. I thought the hits that
were returned were sorted.

An explanation is that the explanation of hit 2 is not correctly computed.
Has anyone encountered this before?

FYI, the docs corresponding to hits 1,2 and 3 have exactly the same
scoring fields(By scoring fields, I mean the fields used in the query).

Thanks for your time.

-Vikas

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


Re: Hit 2 has score less than Hit 3

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Dec 14, 2004, at 4:53 AM, Vikas Gupta wrote:
> I have come across a scenario where the hits returned are not sorted.  
> Or
> maybe they are sorted but the explanation is not correct.
>
> Take a look at
> http://cofferdam.cs.utexas.edu:8080/search.jsp? 
> query=space+odyssey&hitsPerPage=10&hitsPerSite=0

This site was down when I tried to access it.

> Look at the top 3 results.
>
> Score of Hit 1 is 1.0188559
> Score of Hit 2 is 0.9934416
> Score of Hit 3 is 1.0188559
>
> I can't explain how score of hit 2 can be < hit 3. I thought the hits  
> that
> were returned were sorted.

Hits should be in descending score order by default.  Are you using the  
new Sort facility at all?  Are you walking through Hits properly (i.e.  
hits.doc(i), i is the i-th hit, not document id i)?   What version of  
Lucene are you using?

Sorry - figured I'd rattle off some standard troubleshooting questions  
:)

> FYI, the docs corresponding to hits 1,2 and 3 have exactly the same
> scoring fields(By scoring fields, I mean the fields used in the query).

Use the IndexSearcher.explain() feature to get the real scoop on why a  
score is computed the way it is.

	Erik


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