Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 82381 invoked from network); 24 Jun 2009 09:27:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Jun 2009 09:27:19 -0000 Received: (qmail 66212 invoked by uid 500); 24 Jun 2009 09:27:29 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 66129 invoked by uid 500); 24 Jun 2009 09:27:29 -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 66120 invoked by uid 99); 24 Jun 2009 09:27:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Jun 2009 09:27:29 +0000 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; Wed, 24 Jun 2009 09:27:27 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 6BC2C234C1E6 for ; Wed, 24 Jun 2009 02:27:07 -0700 (PDT) Message-ID: <673504618.1245835627440.JavaMail.jira@brutus> Date: Wed, 24 Jun 2009 02:27:07 -0700 (PDT) From: "Michael McCandless (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Resolved: (LUCENE-1652) Enhancements to Scorers following the changes to DocIdSetIterator In-Reply-To: <312862623.1242938865637.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-1652?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael McCandless resolved LUCENE-1652. ---------------------------------------- Resolution: Invalid The ideas in this issue were largely fixed under other issues... > Enhancements to Scorers following the changes to DocIdSetIterator > ----------------------------------------------------------------- > > Key: LUCENE-1652 > URL: https://issues.apache.org/jira/browse/LUCENE-1652 > Project: Lucene - Java > Issue Type: Improvement > Components: Search > Reporter: Shai Erera > Fix For: 3.0 > > > In LUCENE-1614, we changed the semantics of DocIdSetIterator's methods to return a sentinel NO_MORE_DOCS (= Integer.MAX_VALUE) when the iterator has exhausted. Due to backward compatibility issues, we couldn't implement that semantics in doc(). Therefore this issue, which can be introduced in 3.0 only will: > # Implement the new semantics in all extending classes, such that doc() will return NO_MORE_DOCS when the iterator has exhausted. > # Change BooleanScorer to take advantage of that by removing sub.done from SubScorer and operate under the assumption that NO_MORE_DOCS is larger than any doc ID (Integer.MAX_VALUE). > # Change ConjunctionScorer to operate under the same assumptions and remove 'more'. > # Change ReqExclScorer to not rely on reqScorer in doc(), since the latter may be null. > # Make more changes to ConjunctionScorer's init() and remove 'firstTime' to improve the performance of nextDoc(), score(), advance(). > # Add start()/finish() to DISI? > A snippet from LUCENE-1614 regarding the change in BooleanScorer > {code} > int doc = sub.done ? -1 : scorer.doc(); > while (!sub.done && doc < end) { > sub.collector.collect(doc); > doc = scorer.nextDoc(); > sub.done = doc < 0; > } > {code} > To this: > {code} > int doc = scorer.doc(); > while (doc < end) { > sub.collector.collect(doc); > doc = scorer.nextDoc(); > } > {code} > And in ConjunctionScorer, change this: > {code} > while (more && (firstScorer=scorers[first]).doc() < (lastDoc=lastScorer.doc())) { > more = firstScorer.advance(lastDoc) >= 0; > lastScorer = firstScorer; > first = (first == (scorers.length-1)) ? 0 : first+1; > } > return more; > {code} > To this: > {code} > while ((firstScorer=scorers[first]).doc() < (lastDoc=lastScorer.doc())) { > firstScorer.advance(lastDoc); > lastScorer = firstScorer; > first = (first == (scorers.length-1)) ? 0 : first+1; > } > return lastDoc != DOC_SENTINEL; > {code} -- 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