Return-Path: Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: (qmail 63794 invoked from network); 8 Jun 2010 05:26:21 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Jun 2010 05:26:21 -0000 Received: (qmail 58986 invoked by uid 500); 8 Jun 2010 05:26:20 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 58660 invoked by uid 500); 8 Jun 2010 05:26:19 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 58653 invoked by uid 99); 8 Jun 2010 05:26:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jun 2010 05:26:19 +0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=AWL,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of john.wang@gmail.com designates 209.85.212.48 as permitted sender) Received: from [209.85.212.48] (HELO mail-vw0-f48.google.com) (209.85.212.48) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jun 2010 05:26:12 +0000 Received: by vws2 with SMTP id 2so646838vws.35 for ; Mon, 07 Jun 2010 22:25:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=gsDqywiEvdMIk//jR5FZfBSzRz9ccPU/AoAEEg9UHKo=; b=lcxBzXH2bLbmDGWeGSYV5T0ScWL8XyFbaROIvtkuXq/EjbehoH45XaF+rN/JtlhyOU cNbgZZ68QwfqGSIkTO214Bilntb95zLx/rnBr2MyKCMRXjTXHJPUASlp9aq6xixNnsTK gnxRm1V8Plmc+ErpWwIokebyh2bOwLQHi8Piw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=rVIAol/LyH3zUM5HYpudNnV+uG82SvCN1RmYwI904hktT8XGkn/WM4Fsvpa6jd+dQt jjBUTJi/bQhRG7bMpuiOZ4McQwGBGVB3+7NufauppXY/EWDGxXg9d3kPQGSpbKFrCDoS qgHXjSN4O9bgs0D+5WnFu85BQlCRJsv0s6QM4= MIME-Version: 1.0 Received: by 10.229.250.81 with SMTP id mn17mr5280298qcb.182.1275974751651; Mon, 07 Jun 2010 22:25:51 -0700 (PDT) Received: by 10.229.233.133 with HTTP; Mon, 7 Jun 2010 22:25:51 -0700 (PDT) Date: Mon, 7 Jun 2010 22:25:51 -0700 Message-ID: Subject: Proposal: Scorer api change From: John Wang To: dev@lucene.apache.org Content-Type: multipart/alternative; boundary=0016363b8eb0d0878804887e05e1 --0016363b8eb0d0878804887e05e1 Content-Type: text/plain; charset=ISO-8859-1 Hi guys: I'd like to make a proposal to change the Scorer class/api to the following: public abstract class Scorer{ DocIdSetIterator getDocIDSetIterator(); float score(int docid); } Reasons: 1) To build a Scorer from an existing Scorer (e.g. that produces raw scores from tfidf), one would decorate it, and it would introduce overhead (in function calls) around nextDoc and advance, even if you just want to augment the score method which is called much fewer times. 2) The current contract forces scoring on the currentDoc in the underlying iterator. So once you pass "current", you can no longer score. In one of our use-cases, it is very inconvenient. What do you think? I can go ahead and open an issue and work on a patch if I get some agreement. Thanks -John --0016363b8eb0d0878804887e05e1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi guys:

=A0=A0=A0 I'd like to make a proposal to change the Sco= rer class/api to the following:


public abstract class Scorer{=A0=A0 DocIdSetIterator getDocIDSetIterator();
=A0=A0 float score(int d= ocid);
}

Reasons:

1) To build a Scorer from an existing Scorer (e.g. that= produces raw scores from tfidf), one would decorate it, and it would intro= duce overhead (in function calls) around nextDoc and advance, even if you j= ust want to augment the score method which is called much fewer times.

2) The current contract forces scoring on the currentDoc in the underly= ing iterator. So once you pass "current", you can no longer score= . In one of our use-cases, it is very inconvenient.

What do you thin= k? I can go ahead and open an issue and work on a patch if I get some agree= ment.

Thanks

-John
--0016363b8eb0d0878804887e05e1--