lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: NPE when using explain
Date Thu, 04 Dec 2003 19:57:32 GMT
On Thursday, December 4, 2003, at 02:46  PM, Dror Matalon wrote:
> Of course, now that I got explain to work I need to figure out what the
> following means :-)
> -------------
> Explanation:0.0 = product of:
>   0.0 = sum of:
> 	0.0 = coord(0/5)
> -------------

It means you have a bug in your code :))

You're using 'ii' as a document id... but its only your loop variable 
(position within Hits).  Pass Hits.id(ii) to explain instead.

	Erik


>>    for (int start = 0; start < hits.length(); start += HITS_PER_PAGE) 
>> {
>>      int end = Math.min(hits.length(), start + HITS_PER_PAGE);
>>      for (int ii = start; ii < end; ii++) {
>>        Document doc = hits.doc(ii);
>>        message ("---------------- " + ii + " score:" + hits.score(ii) 
>> +
>>        "---------------------");
>>        if (explain) {
>>          Explanation exp = searcher.explain(query, ii);
>>          message("Explanation:" + exp.toString());
>>        }


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


Mime
View raw message