Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-13944

CollapsingQParserPlugin throws NPE instead of bad request

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 7.3.1
    • 8.6
    • None
    • None

    Description

       I noticed the following NPE:

      java.lang.NullPointerException at org.apache.solr.search.CollapsingQParserPlugin$OrdFieldValueCollector.finish(CollapsingQParserPlugin.java:1021) at org.apache.solr.search.CollapsingQParserPlugin$OrdFieldValueCollector.finish(CollapsingQParserPlugin.java:1081) at org.apache.solr.search.SolrIndexSearcher.buildAndRunCollectorChain(SolrIndexSearcher.java:230) at org.apache.solr.search.SolrIndexSearcher.getDocListNC(SolrIndexSearcher.java:1602) at org.apache.solr.search.SolrIndexSearcher.getDocListC(SolrIndexSearcher.java:1419) at org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher.java:584)
      

      If I am correct, the problem was already addressed in SOLR-8807. The fix does was not working in this case though, because of a syntax error in the query (I used the local parameter syntax twice instead of combining it). The relevant part of the query is:

      &fq={!tag=collapser}{!collapse field=productId sort='merchantOrder asc, price asc, id asc'}
      

      After discussing that on the mailing list, I was asked to open a ticket, because this situation should result in a bad request instead of a NullpointerException (see https://mail-archives.apache.org/mod_mbox/lucene-solr-user/201911.mbox/%3CCAMJgJxTuSb%3D8szO8bvHiAafJOs08O_NMB4pcaHOXME4Jj-GO2A%40mail.gmail.com%3E)

      Attachments

        1. SOLR-13944.patch
          4 kB
          Munendra S N
        2. SOLR-13944.patch
          5 kB
          Munendra S N
        3. SOLR-13944.patch
          4 kB
          Munendra S N
        4. SOLR-13944.patch
          4 kB
          Munendra S N

        Activity

          People

            munendrasn Munendra S N
            Walter Stefan
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: