Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-User

Weird scenario: Score 'explain' description showing different doc id

 

 

Lucene java-user RSS feed   Index | Next | Previous | View Threaded


phaninra at gmail

Jul 27, 2012, 3:56 PM

Post #1 of 2 (160 views)
Permalink
Weird scenario: Score 'explain' description showing different doc id

Hi,
This is the first time I am encountering this kind of scenario. Lack
of knowledge might be the reason for my surprise.

- I am using myIndexWriter.explain(Query q, int docId).

- For the same query, the explanation for most of the docs is exactly what
it's supposed to be. However, for some docId, the explanation is showing a
different doc id. That doc id doesn't even have the passed in query term.
The following is the output.

Explaining: Doc id: *73714*, Query: MY_FIELD:bike

60.828213 = (MATCH) fieldWeight(MY_FIELD:bike in *22973*), product of:
1.7320508 = tf(termFreq(MY_FIELD:bike)=3)
70.23837 = idf(docFreq=272, maxDocs=438145)
0.5 = fieldNorm(field=MY_FIELD, doc=*22973*)

You may notice that the underlined doc ids are different from each other.
The "same" code is working perfectly fine for other document ids.

Here is the code snippet, just in case.

private void explainQuery(Query q, int doc) throws IOException {
System.out.println("Explaining: " + doc + ", Query: " + q );
Explanation exp = is.explain(q, doc);
System.out.println(exp);
}

I am not able to figure out the reason behind it.

Thanks,
Phani


phaninra at gmail

Jul 29, 2012, 12:42 PM

Post #2 of 2 (155 views)
Permalink
Re: Weird scenario: Score 'explain' description showing different doc id [In reply to]

I've found the answer. I am using the CustomScoreQuery and the doc id
inconsistency is because of the segment based IndexReader concept.

On Fri, Jul 27, 2012 at 3:56 PM, Phanindra R <phaninra [at] gmail> wrote:

>
> Hi,
> This is the first time I am encountering this kind of scenario. Lack
> of knowledge might be the reason for my surprise.
>
> - I am using myIndexWriter.explain(Query q, int docId).
>
> - For the same query, the explanation for most of the docs is exactly what
> it's supposed to be. However, for some docId, the explanation is showing a
> different doc id. That doc id doesn't even have the passed in query term.
> The following is the output.
>
> Explaining: Doc id: *73714*, Query: MY_FIELD:bike
>
> 60.828213 = (MATCH) fieldWeight(MY_FIELD:bike in *22973*), product of:
> 1.7320508 = tf(termFreq(MY_FIELD:bike)=3)
> 70.23837 = idf(docFreq=272, maxDocs=438145)
> 0.5 = fieldNorm(field=MY_FIELD, doc=*22973*)
>
> You may notice that the underlined doc ids are different from each other.
> The "same" code is working perfectly fine for other document ids.
>
> Here is the code snippet, just in case.
>
> private void explainQuery(Query q, int doc) throws IOException {
> System.out.println("Explaining: " + doc + ", Query: " + q );
> Explanation exp = is.explain(q, doc);
> System.out.println(exp);
> }
>
> I am not able to figure out the reason behind it.
>
> Thanks,
> Phani
>

Lucene java-user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.