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

JSON Faceting NPE & 500 Error when attempting to sort on non-existent agg (ie: typo)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 8.3
    • None
    • None

    Description

      JSON Faceting does not provide good error handling in the event of a typo / non-existent agg stat name when sorting. the parsing logic happily accepts the bogus sortVariable w/o validation, and the subsequent execution logic trows an NPE when it can't be found.

      Request...

      curl http://localhost:8983/solr/techproducts/query -d 'rows=0&q=*:*&
      json.facet={
        categories:{
          type : terms,
          field : cat,
          sort : "xxxxx desc",
        }
      }'
      

      Response...

      {
        "responseHeader":{
          "status":500,
          "QTime":1,
          "params":{
            "q":"*:*",
            "json.facet":"{\n  categories:{\n    type : terms,\n    field : cat,\n    sort : \"xxxxx desc\",\n  }\n}",
            "rows":"0"}},
        "response":{"numFound":32,"start":0,"docs":[]
        },
        "error":{
          "trace":"java.lang.NullPointerException\n\tat org.apache.solr.search.facet.FacetFieldProcessor.lambda$findTopSlots$1(FacetFieldProcessor.java:287)
          ...
      

      Attachments

        1. SOLR-13022.patch
          11 kB
          Munendra S N
        2. SOLR-13022.patch
          8 kB
          Munendra S N

        Issue Links

          Activity

            People

              munendrasn Munendra S N
              hossman Chris M. Hostetter
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: