Lucene - Core
  1. Lucene - Core
  2. LUCENE-4712

NullPointer Exception in MemoryIndex.MemoryIndexReader

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.1
    • Fix Version/s: 4.2, 6.0
    • Component/s: modules/other
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      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;

      1. LUCENE-4712.patch
        3 kB
        Simon Willnauer

        Activity

        Hide
        Simon Willnauer added a comment -

        here is a patch with fix and test. Thanks for raising this!

        Show
        Simon Willnauer added a comment - here is a patch with fix and test. Thanks for raising this!
        Hide
        Michael McCandless added a comment -

        +1

        Show
        Michael McCandless added a comment - +1
        Hide
        Commit Tag Bot added a comment -

        [trunk commit] Simon Willnauer
        http://svn.apache.org/viewvc?view=revision&revision=1437604

        LUCENE-4712: MemoryIndex throws NPE in #normValues(String) if field does not exist

        Show
        Commit Tag Bot added a comment - [trunk commit] Simon Willnauer http://svn.apache.org/viewvc?view=revision&revision=1437604 LUCENE-4712 : MemoryIndex throws NPE in #normValues(String) if field does not exist
        Hide
        Simon Willnauer added a comment -

        fixed! thanks

        Show
        Simon Willnauer added a comment - fixed! thanks
        Hide
        Commit Tag Bot added a comment -

        [branch_4x commit] Simon Willnauer
        http://svn.apache.org/viewvc?view=revision&revision=1437606

        LUCENE-4712: MemoryIndex throws NPE in #normValues(String) if field does not exist

        Show
        Commit Tag Bot added a comment - [branch_4x commit] Simon Willnauer http://svn.apache.org/viewvc?view=revision&revision=1437606 LUCENE-4712 : MemoryIndex throws NPE in #normValues(String) if field does not exist
        Hide
        Uwe Schindler added a comment -

        Closed after release.

        Show
        Uwe Schindler added a comment - Closed after release.

          People

          • Assignee:
            Simon Willnauer
            Reporter:
            Ricky Pritchett
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development