lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philippe <mailer.tho...@gmail.com>
Subject Re: Different ranking results
Date Thu, 22 Jul 2010 09:23:36 GMT
Hi Ian,

I'm using Version 2.93 of lucene.

q.getClass() and q.toString() are exactly equal:
org.apache.lucene.search.BooleanQuery
TITLE:672 BOOK:672

However, the results for searcher.explain(q,n) significantly differ. It 
seems to me that  "Query q = parser.parse("672");" searches only one the 
Book field, whereas  "Query q = parser.parse("TITLE:672 BOOK:672");" 
searches on both fields. Do you have a explanation for this behaviour? I 
only observed this problem for this field...

I appended the result of both explain strings below:

"Query q = parser.parse("672");"
9.987344E10 = (MATCH) sum of:
   9.987344E10 = (MATCH) weight(BOOK:672 in 7078), product of:
     0.6583703 = queryWeight(BOOK:672), product of:
       6.085349 = idf(docFreq=109, maxDocs=17780)
       0.10818941 = queryNorm
     1.51697965E11 = (MATCH) fieldWeight(BOOK:672 in 7078), product of:
       3.3166249 = tf(termFreq(BOOK:672)=11)
       6.085349 = idf(docFreq=109, maxDocs=17780)
       7.5161928E9 = fieldNorm(field=BOOK, doc=7078)


"Query q = parser.parse("TITLE:672 BOOK:672");"
9.5225594E10 = (MATCH) sum of:
   9.5225594E10 = (MATCH) weight(BOOK:672 in 4979), product of:
     0.6583703 = queryWeight(BOOK:672), product of:
       6.085349 = idf(docFreq=109, maxDocs=17780)
       0.10818941 = queryNorm
     1.44638345E11 = (MATCH) fieldWeight(BOOK:672 in 4979), product of:
       3.1622777 = tf(termFreq(BOOK:672)=10)
       6.085349 = idf(docFreq=109, maxDocs=17780)
       7.5161928E9 = fieldNorm(field=BOOK, doc=4979)
   52.366344 = (MATCH) weight(TITLE:672 in 4979), product of:
     0.7526941 = queryWeight(TITLE:672), product of:
       6.957188 = idf(docFreq=45, maxDocs=17780)
       0.10818941 = queryNorm
     69.571884 = (MATCH) fieldWeight(TITLE:672 in 4979), product of:
       1.0 = tf(termFreq(TITLE:672)=1)
       6.957188 = idf(docFreq=45, maxDocs=17780)
       10.0 = fieldNorm(field=TITLE, doc=4979)

Cheers,
     P.
Am 22.07.2010 10:02, schrieb Ian Lea:
> They look the same to me too.
>
> What does q.getClass().getName() say in each case? q.toString()?
> searcher.explain(q, n)?
>
> What version of lucene?
>
>
> --
> Ian.
>
>
>
>
> On Wed, Jul 21, 2010 at 10:25 PM, Philippe<mailer.thomas@gmail.com>  wrote:
>    
>> Hi,
>>
>> I just performed two queries which, in my opinion, should lead to the same
>> document rankings. However, the document ranking differ between these two
>> queries. For better understanding I prepared  minimal examples for both
>> queries. In my understanding both queries perform the same task. Namely
>> search for "lucene" in two different fields.
>>
>> Maybe someone can explain me my misunderstanding?
>>
>>
>> String[] fields = {"TITLE", "BOOK"};
>> MultiFieldQueryParser parser = new MultiFieldQueryParser(Version.LUCENE_29,
>> fields, new StandardAnalyzer(Version.LUCENE_29));
>>
>> 1.)
>> Query q = parser.parse("lucene");
>>
>> 2.)
>> Query q = parser.parse(TITLE:lucene OR BOOK:lucene);
>>
>> Regards,
>>     philippe
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>>      
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
>    


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


Mime
View raw message