lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hoss Man (Commented) (JIRA)" <>
Subject [jira] [Commented] (SOLR-435) QParser must validate existance/absense of "q" parameter
Date Sat, 24 Mar 2012 00:53:24 GMT


Hoss Man commented on SOLR-435:

bq. if no query string is supplied, or if its blank or just whitespace, then the default is
to match all documents. 

-0 ... the risk with this approach is that (new) users who make typos in queries or are missinformed
about the name "q" param (ie: {{/search?Q=foo}} or {{/search?query=foo}}) will be really confused
when they query they specify is completely ignored w/o explanation and all docs are returned
in it's place.  I think it's much better to throw a clear error "q param is not specified"
but i certainly see the value in adding q.alt support to the LuceneQParser with the same semantics
as dismax (used if q is missing or all whitespace) .. not sure why we've never considered
that before.  (obviosly it wouldn't make sense for all QParsers, like "field" or "term" since
all whitespace and or empty strings are totally valid input for them)

bq. I could have modified QueryComponent, or just QParser, or just the actual QParser subclasses.
A universal choice couldn't be made for all qparsers...

we definitely shouldn't modify QueryComponent ... the entire point of the issue is that QueryComponent
can't attempt to validate the q param, because it doesn't know if/when the defType QParser
requires it to exist -- the individual QParsers all need to throw clear errors if they require
it and it's not specified, that's really the whole reason this issue was opened in the first
> QParser must validate existance/absense of "q" parameter
> --------------------------------------------------------
>                 Key: SOLR-435
>                 URL:
>             Project: Solr
>          Issue Type: Bug
>          Components: search
>    Affects Versions: 1.3
>            Reporter: Ryan McKinley
>            Assignee: Ryan McKinley
>             Fix For: 3.6, 4.0
>         Attachments: SOLR-435_q_defaults_to_all-docs.patch
> Each QParser should check if "q" exists or not.  For some it will be required others
> currently it throws a null pointer:
> {code}
> java.lang.NullPointerException
> 	at org.apache.solr.common.util.StrUtils.splitSmart(
> 	at
> 	at
> 	at org.apache.solr.handler.component.QueryComponent.prepare(
> 	at org.apache.solr.handler.SearchHandler.handleRequestBody(
>         ...
> {code}
> see:

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message