lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (Updated) (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LUCENE-3831) Passing a null fieldname to MemoryFields#terms in MemoryIndex throws a NPE
Date Tue, 28 Feb 2012 15:23:46 GMT

     [ https://issues.apache.org/jira/browse/LUCENE-3831?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Michael McCandless updated LUCENE-3831:
---------------------------------------

    Attachment: LUCENE-3831.patch

Thanks for the test cases Alan!

I folded those into a patch, added a few {{assert field != null}},
and then fixed SpanWeight to detect when its .getField() is
null and return a null scorer in that case.

I'd like to avoid the API break (changing Span*Query API to force
up-front providing of the field) if we can...

                
> Passing a null fieldname to MemoryFields#terms in MemoryIndex throws a NPE
> --------------------------------------------------------------------------
>
>                 Key: LUCENE-3831
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3831
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: core/index
>    Affects Versions: 4.0
>            Reporter: Alan Woodward
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-3831.patch, TestNullFieldAfterRegexpRewrite.java, mindex-null-field.patch
>
>
> I found this when querying a MemoryIndex using a RegexpQuery wrapped by a SpanMultiTermQueryWrapper.
 If the regexp doesn't match anything in the index, it gets rewritten to an empty SpanOrQuery
with a null field value, which then triggers the NPE.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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