The following queries works fine using the Solr 4.0 example schema:

  http://localhost:8983/solr/select/?q={!prefix+f=id+v=stat}
  http://localhost:8983/solr/select/?q={!prefix+f=id}stat

But the following, which SHOULD work, gets an NPE:

  http://localhost:8983/solr/select/?defType=prefix&f=id&v=stat
  http://localhost:8983/solr/select/?defType=prefix&f=id&q=stat

java.lang.NullPointerException at 
org.apache.solr.search.PrefixQParserPlugin$1.parse(PrefixQParserPlugin.java:43) 
at org.apache.solr.search.QParser.getQuery(QParser.java:143) at 
org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:118)
 at 

Similar NPE for “term” and other localparams query parsers.

It looks like there is no code to use solrParams if localParms is null.

Also, there should be code to default to the value of the “q” parameter if the 
“v” parameter is null.

I’m not sure if this is a bug per se, or just an unintended usage of defType 
and localParams query parsers, but either way it SHOULD work.

-- Jack Krupansky

Reply via email to