Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 88373 invoked from network); 30 May 2008 00:08:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 May 2008 00:08:15 -0000 Received: (qmail 20375 invoked by uid 500); 30 May 2008 00:08:10 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 20314 invoked by uid 500); 30 May 2008 00:08:10 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 20302 invoked by uid 99); 30 May 2008 00:08:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 May 2008 17:08:10 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 May 2008 00:07:23 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3A945234C123 for ; Thu, 29 May 2008 17:07:45 -0700 (PDT) Message-ID: <1122384182.1212106065238.JavaMail.jira@brutus> Date: Thu, 29 May 2008 17:07:45 -0700 (PDT) From: "Mike Klaas (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Commented: (LUCENE-1293) Tweaks to PhraseQuery.explain() In-Reply-To: <1617343890.1211480636212.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-1293?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12600973#action_12600973 ] Mike Klaas commented on LUCENE-1293: ------------------------------------ It is meant for debugging, though I have found it so painfully slow in the past that I have avoided it on occasion. The main culprit is the looped next() call in PhraseScorer.explain(). Using skipTo() would be faster. > Tweaks to PhraseQuery.explain() > ------------------------------- > > Key: LUCENE-1293 > URL: https://issues.apache.org/jira/browse/LUCENE-1293 > Project: Lucene - Java > Issue Type: Improvement > Components: Search > Affects Versions: 1.9, 2.0.0, 2.1, 2.2, 2.3, 2.3.1, 2.3.2, 2.4 > Reporter: Itamar Syn-Hershko > Priority: Minor > Fix For: 2.4 > > > The explain() function in PhraseQuery.java is very clumzy and could use many optimizations. Perhaps it is only because it is intended to use while debugging? > Here's an example: > {noformat} > result.addDetail(fieldExpl); > // combine them > result.setValue(queryExpl.getValue() * fieldExpl.getValue()); > if (queryExpl.getValue() == 1.0f) > return fieldExpl; > return result; > } > {noformat} > Can easily be tweaked and become: > {noformat} > if (queryExpl.getValue() == 1.0f) { > return fieldExpl; > } > result.addDetail(fieldExpl); > // combine them > result.setValue(queryExpl.getValue() * fieldExpl.getValue()); > return result; > } > {noformat} > And thats really just for a start... > Itamar. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org