Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@www.apache.org Received: (qmail 58238 invoked from network); 4 Dec 2003 19:57:36 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 4 Dec 2003 19:57:36 -0000 Received: (qmail 1209 invoked by uid 500); 4 Dec 2003 19:57:21 -0000 Delivered-To: apmail-jakarta-lucene-user-archive@jakarta.apache.org Received: (qmail 1182 invoked by uid 500); 4 Dec 2003 19:57:21 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 1169 invoked from network); 4 Dec 2003 19:57:21 -0000 Received: from unknown (HELO c000.snv.cp.net) (209.228.32.71) by daedalus.apache.org with SMTP; 4 Dec 2003 19:57:21 -0000 Received: (cpmta 13403 invoked from network); 4 Dec 2003 11:57:24 -0800 Received: from 24.51.109.181 (HELO ehatchersolutions.com) by smtp.hatcher.net (209.228.32.71) with SMTP; 4 Dec 2003 11:57:24 -0800 X-Sent: 4 Dec 2003 19:57:24 GMT Date: Thu, 4 Dec 2003 14:57:32 -0500 Subject: Re: NPE when using explain Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v553) From: Erik Hatcher To: "Lucene Users List" Content-Transfer-Encoding: 7bit In-Reply-To: <20031204194637.GE34796@rlx11.zapatec.com> Message-Id: <190C54E3-2694-11D8-8DAC-000393A564E6@ehatchersolutions.com> X-Mailer: Apple Mail (2.553) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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