Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4
    • Fix Version/s: 3.5, 4.0-ALPHA
    • Component/s: modules/other
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      BooleanFilter getDISI() method used with QueryWrapperFilter occur NullPointerException,
      if any QueryWrapperFilter not match terms in IndexReader.

      ---------------------------------------------------
      java.lang.NullPointerException
      at org.apache.lucene.util.OpenBitSetDISI.inPlaceAnd(OpenBitSetDISI.java:66)
      at org.apache.lucene.search.BooleanFilter.getDocIdSet(BooleanFilter.java:102)
      at org.apache.lucene.search.IndexSearcher.searchWithFilter(IndexSearcher.java:551)
      at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:532)
      at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:463)
      at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:433)
      at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:356)
      at test.BooleanFilterTest.main(BooleanFilterTest.java:50)
      ---------------------------------------------------

      null-check below lines.
      ---------------------------------------------------
      res = new OpenBitSetDISI(getDISI(shouldFilters, i, reader), reader.maxDoc());
      res.inPlaceOr(getDISI(shouldFilters, i, reader));
      res = new OpenBitSetDISI(getDISI(notFilters, i, reader), reader.maxDoc());
      res.inPlaceNot(getDISI(notFilters, i, reader));
      res = new OpenBitSetDISI(getDISI(mustFilters, i, reader), reader.maxDoc());
      res.inPlaceAnd(getDISI(mustFilters, i, reader));
      ---------------------------------------------------

      1. LUCENE-3446.patch
        18 kB
        Uwe Schindler
      2. LUCENE-3446.patch
        19 kB
        Uwe Schindler
      3. LUCENE-3446.patch
        10 kB
        Uwe Schindler

        Activity

        Hide
        Uwe Schindler added a comment -

        Bulk close after release of 3.5

        Show
        Uwe Schindler added a comment - Bulk close after release of 3.5
        Hide
        Uwe Schindler added a comment -

        Backported to 3.x branch revision: 1174418

        Show
        Uwe Schindler added a comment - Backported to 3.x branch revision: 1174418
        Hide
        Uwe Schindler added a comment -

        Committed trunk revision: 1174380

        Show
        Uwe Schindler added a comment - Committed trunk revision: 1174380
        Hide
        Uwe Schindler added a comment -

        Patch update.

        Show
        Uwe Schindler added a comment - Patch update.
        Hide
        Uwe Schindler added a comment -

        Patch (contains LUCENE-3448) using FixedBitSets new methods. OpenBitSetDISI no longer needed.

        Show
        Uwe Schindler added a comment - Patch (contains LUCENE-3448 ) using FixedBitSets new methods. OpenBitSetDISI no longer needed.
        Hide
        Uwe Schindler added a comment -

        Patch for trunk.

        This patch handles filters returning null DocIdSet and also those returning null DISIs (like QueryWrapperFilter when scorer==null). I also added tests for all combinations.

        This patch also optimized the filter building, as getDocIdSet is not called unnecessarily twice (which is expensive for lots of filters).

        I added a TODO: The Filter uses OpenBitSet and has optimizations for OpenBitSets that no longer apply to Lucene core's filters: Core filters mostly return FixedBitSet now. A move to FixedBitSet for BooleanFilter is not possible at the moment, as and() and andNot() are missing in this class.

        Show
        Uwe Schindler added a comment - Patch for trunk. This patch handles filters returning null DocIdSet and also those returning null DISIs (like QueryWrapperFilter when scorer==null). I also added tests for all combinations. This patch also optimized the filter building, as getDocIdSet is not called unnecessarily twice (which is expensive for lots of filters). I added a TODO: The Filter uses OpenBitSet and has optimizations for OpenBitSets that no longer apply to Lucene core's filters: Core filters mostly return FixedBitSet now. A move to FixedBitSet for BooleanFilter is not possible at the moment, as and() and andNot() are missing in this class.
        Hide
        Uwe Schindler added a comment -

        Thanks for reporting this bug. Indeed, getDocIdSet() and DISI.getDocIdSetIterator() can return null, if no documents match. BooleanFilter must respect this.

        I will take care.

        Show
        Uwe Schindler added a comment - Thanks for reporting this bug. Indeed, getDocIdSet() and DISI.getDocIdSetIterator() can return null, if no documents match. BooleanFilter must respect this. I will take care.

          People

          • Assignee:
            Uwe Schindler
            Reporter:
            Shuji Umino
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development