On 1/14/2016 5:24 PM, Shawn Heisey wrote:
> That exception, especially given the lack of an error message, is very
> unhelpful.  The average person wouldn't be able to deduce that it was a
> config problem.
>
> Perhaps the code in QParser that threw the NPE needs a null check,
> logging/throwing a useful error when it is tripped.

Based on the information I currently have, I tested this patch:

https://www.dropbox.com/s/k5rkrqm813986ha/QParser.java.patch?dl=0

This seems to work.  Here's a response with the patch, where you can see
the query I tried:|

{
  "responseHeader": {
    "status": 400,
    "QTime": 3,
    "params": {
      "q": "{!flonk}horse",
      "indent": "true",
      "wt": "json",
      "_": "1452841255470"
    }
  },
  "error": {
    "msg": "org.apache.solr.search.SyntaxError: Error getting
QParserPlugin.  Likely cause: the specified query parser 'flonk' may not
exist.",
    "code": 400
  }
}
|
The same thing happens with defType=flonk instead of the localparam.

I chose SyntaxError because that was already in the method signature,
and seems to describe the error reasonably well.  Would another
exception be better?

Thanks,
Shawn

Reply via email to