Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 54266 invoked from network); 19 Sep 2006 19:55:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Sep 2006 19:55:46 -0000 Received: (qmail 19296 invoked by uid 500); 19 Sep 2006 19:55:39 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 19268 invoked by uid 500); 19 Sep 2006 19:55:39 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 19257 invoked by uid 99); 19 Sep 2006 19:55:39 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Sep 2006 12:55:39 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from ([169.229.70.167:47887] helo=rescomp.berkeley.edu) by idunn.apache.osuosl.org (ecelerity 2.1 r(10620)) with ESMTP id 66/79-28275-63B40154 for ; Tue, 19 Sep 2006 12:55:35 -0700 Received: by rescomp.berkeley.edu (Postfix, from userid 1007) id 3AF715B78B; Tue, 19 Sep 2006 12:55:20 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by rescomp.berkeley.edu (Postfix) with ESMTP id 1D9847F403 for ; Tue, 19 Sep 2006 12:55:20 -0700 (PDT) Date: Tue, 19 Sep 2006 12:55:20 -0700 (PDT) From: Chris Hostetter To: Lucene Java Group Subject: Re: DisjunctionMaxQuery explaination In-Reply-To: <45104842.5090101@gmail.com> Message-ID: References: <45104842.5090101@gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N The "i" you pass to Hits.score is the index of the result in that Hits object ... the "i" you pass to Searcher.explain should be the absolute docid (the searcher has no way of knowing about your Hits, or what order they are in). Try something like... searcher.explain(disjunctQuery, hits.doc(i)).toString() : Date: Tue, 19 Sep 2006 14:42:58 -0500 : From: Find Me : Reply-To: java-user@lucene.apache.org : To: Lucene Java Group : Subject: Re: DisjunctionMaxQuery explaination : : Forgot to add the hits.score() to print out the hits score. : : public void explainSearchScore(String indexLocation, DisjunctionMaxQuery : disjunctQuery){ : IndexSearcher searcher = new : IndexSearcher(IndexReader.open(indexLocation)); : : Hits hits = searcher.search(disjunctQuery); : if(hits == null) return; : : for(int i = 0; i < hits.length(); i++){ : System.out.println("Hit " + i + ": " + hits.score(i) + : "\n" + searcher.explain(disjunctQuery, i).toString()); : } : } : : Find Me wrote: : > public void explainSearchScore(String indexLocation, : > DisjunctionMaxQuery disjunctQuery){ : > IndexSearcher searcher = new : > IndexSearcher(IndexReader.open(indexLocation)); : > : > Hits hits = searcher.search(disjunctQuery); : > if(hits == null) return; : > : > for(int i = 0; i < hits.length(); i++){ : > System.out.println("Hit " + i + " " + : > searcher.explain(disjunctQuery, i).toString()); : > } : > } : > : > : > On 9/19/06, *Chris Hostetter* > wrote: : > : > : > : In the following output, each hit has two lines. The first line : > is the hit : > : score and the second line is the explanation given by the : > : DisjunctionMaxQuery. : > : > how are you printing the Explanation? .. are you using the toString()? : > : > can you post a small self contained code example showing how you : > got this : > output? : > : > : Hit 1: 0.6027994 : > : 0.0 = max plus 0.1 times others of: : > : : > : Hit 2: 0.59990174 : > : 0.0 = max plus 0.1 times others of: : > : : > : Hit 3: 0.41993123 : > : 0.0 = max plus 0.1 times others of: : > : > : > : > : > -Hoss : > : > : > --------------------------------------------------------------------- : > 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 : -Hoss --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org