lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Smiley (Updated) (JIRA)" <>
Subject [jira] [Updated] (SOLR-435) QParser must validate existance/absense of "q" parameter
Date Fri, 23 Mar 2012 22:01:26 GMT


David Smiley updated SOLR-435:

    Attachment: SOLR-435_q_defaults_to_all-docs.patch

Attached is a patch that I'd like to apply on Monday end of day (EST).  My changes.txt is
as follows:

* SOLR-435: For the lucene, dismax, and edismax query parsers: if no query string is supplied,
or if its blank or just whitespace, then the default is to match all documents.  It used to
be an error. This basically means 'q' isn't required and q.alt=*:* is redundant. (dsmiley)

I also discovered and fixed a bug in edismax in which a query of pure whitespace threw an
error. dismax didn't do this. It was a trivial fix in which a trim() was forgotten.

There are many ways to approach addressing this issue with different pros/cons; it was hard
to ultimately settle on what I chose to do.  I could have modified QueryComponent, or just
QParser, or just the actual QParser subclasses.  A universal choice couldn't be made for all
qparsers because most qparsers don't even use the query string.  Feedback please! 

> 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