You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Ricky Pritchett <ri...@gmail.com> on 2013/01/23 17:27:13 UTC

NullPointer Exception in MemoryIndex.MemoryIndexReader

Greetings,

Version: Lucene 4.1

I'm currently a user of the MemoryIndex, and I've noticed that after
Lucene-4515 patch, I experience NullPointer Exceptions when searching on an
index with a query that has a field that's not in the index.

The NullPointer is thrown at line 1141:

public DocValues normValues(String field) {
      if (fieldInfos.get(field).omitsNorms())  <---- //If fieldInfos
doesn't contain the field then a NullPointer is thrown.
        return null;

Is this expected behavior?

Thanks,

Ricky



--
"If you can make one heap of all your winnings, And risk it on one turn of
pitch-and-toss, And lose, and start again at your beginnings, And never
breathe a word about your loss"
--  Rudyard Kipling

Re: NullPointer Exception in MemoryIndex.MemoryIndexReader

Posted by Michael McCandless <lu...@mikemccandless.com>.
This is not expected: the method should return null if the field isn't
in the FieldInfos.

Can you open an issue?  Thanks!

Mike McCandless

http://blog.mikemccandless.com

On Wed, Jan 23, 2013 at 11:27 AM, Ricky Pritchett
<ri...@gmail.com> wrote:
> Greetings,
>
> Version: Lucene 4.1
>
> I'm currently a user of the MemoryIndex, and I've noticed that after
> Lucene-4515 patch, I experience NullPointer Exceptions when searching on an
> index with a query that has a field that's not in the index.
>
> The NullPointer is thrown at line 1141:
>
> public DocValues normValues(String field) {
>       if (fieldInfos.get(field).omitsNorms())  <---- //If fieldInfos
> doesn't contain the field then a NullPointer is thrown.
>         return null;
>
> Is this expected behavior?
>
> Thanks,
>
> Ricky
>
>
>
> --
> "If you can make one heap of all your winnings, And risk it on one turn of
> pitch-and-toss, And lose, and start again at your beginnings, And never
> breathe a word about your loss"
> --  Rudyard Kipling

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org