lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shai Erera (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LUCENE-3146) IndexReader.setNorms is no op if one of the field instances omits norms
Date Mon, 30 May 2011 16:25:47 GMT

    [ 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


Mime
View raw message