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 CB7976AA9 for ; Mon, 30 May 2011 16:26:31 +0000 (UTC) Received: (qmail 68550 invoked by uid 500); 30 May 2011 16:26:30 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 68438 invoked by uid 500); 30 May 2011 16:26:30 -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 68431 invoked by uid 99); 30 May 2011 16:26:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 May 2011 16:26:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 May 2011 16:26:28 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 5FCB2E9869 for ; Mon, 30 May 2011 16:25:47 +0000 (UTC) Date: Mon, 30 May 2011 16:25:47 +0000 (UTC) From: "Shai Erera (JIRA)" To: dev@lucene.apache.org Message-ID: <1586912228.53717.1306772747389.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1117064883.44774.1306399907337.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (LUCENE-3146) IndexReader.setNorms is no op if one of the field instances omits norms 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-3146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13041189#comment-13041189 ] Shai Erera commented on LUCENE-3146: ------------------------------------ Adding that info to .fnx is a good idea. But I'm not sure it will solve the problem demonstrated in the test, only in different order. Say the app adds field "a" w/ omitNorms=false and commit(). Then .fnx records that field "a" stores norms and you can call IR.setNorms. Afterwards it adds field "a" w/ omitNorms=true -- now what? Do we fail the addDocument() (I think we should)? If we don't, then norms will be merged away, according to trunk's semantics. So I think we should fix the jdocs + throw the ex from IR.setNorms in this issue, and open a separate one for tracking norms in .fnx + fixing the scenario I've described above? Do we have a ready-to-use exception? If not, how about IllegalArgEx (cause the field is an illegal arg, but weak), IllegalStateEx (cause the field does not track norms, but that ex is usually associated w/ Threads' states), IllegalOpEx (is there such ex)? At any rate, we must throw a RuntimeEx (at least in 3x) to not break apps, compile-wise. > IndexReader.setNorms is no op if one of the field instances omits norms > ----------------------------------------------------------------------- > > Key: LUCENE-3146 > URL: https://issues.apache.org/jira/browse/LUCENE-3146 > Project: Lucene - Java > Issue Type: Bug > Components: core/search > Reporter: Shai Erera > Fix For: 4.0 > > Attachments: LUCENE-3146.patch > > > If I add two documents to an index w/ same field, and one of them omit norms, then IndexReader.setNorms is no-op. I'll attach a patch w/ test case -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org