Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 52B2510F78 for ; Tue, 10 Feb 2015 14:59:13 +0000 (UTC) Received: (qmail 57981 invoked by uid 500); 10 Feb 2015 14:59:12 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 57911 invoked by uid 500); 10 Feb 2015 14:59:12 -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 57899 invoked by uid 99); 10 Feb 2015 14:59:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Feb 2015 14:59:12 +0000 Date: Tue, 10 Feb 2015 14:59:12 +0000 (UTC) From: "Robert Muir (JIRA)" To: dev@lucene.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LUCENE-6228) Do not expose full-fledged scorers in LeafCollector.setScorer MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LUCENE-6228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14314263#comment-14314263 ] Robert Muir commented on LUCENE-6228: ------------------------------------- another maybe more intuitive option is Scorable (interface) and keep Scorer as is, just implementing the interface. > Do not expose full-fledged scorers in LeafCollector.setScorer > ------------------------------------------------------------- > > Key: LUCENE-6228 > URL: https://issues.apache.org/jira/browse/LUCENE-6228 > Project: Lucene - Core > Issue Type: Improvement > Reporter: Adrien Grand > Assignee: Adrien Grand > Fix For: Trunk, 5.1 > > Attachments: LUCENE-6228.patch, LUCENE-6228.patch, LUCENE-6228.patch > > > Currently LeafCollector.setScorer takes a Scorer, which I don't like because several methods should never be called in the context of a Collector (like nextDoc or advance). > I think it's even more trappy for methods that might seem to work in some particular cases but will not work in the general case, like getChildren which will not work if you have a specialized BulkScorer or iterating over positions which will not work if you are in a MultiCollector and another leaf collector consumes positions too. > So I think we should restrict what can be seen from a collector to avoid such traps. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org