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)

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          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:

              Slack

                Issue deployment