[ 
https://issues.apache.org/jira/browse/SOLR-3823?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13453421#comment-13453421
 ] 

Jack Krupansky commented on SOLR-3823:
--------------------------------------

It turns out that it is the white space that causes the problem.

Looking at the code, I see that edismax calls SolrPluginUtils.parseFieldBoosts 
to "parse" the "bq" value, which is absurd since it simply breaks up the param 
value based on whitespace, even in the middle of the query. Then the code calls 
QParser.subQuery to parse the portions of the query, which of course makes no 
sense unless the original query contained no whitespace or was a sequence of 
non-white space queries separated with whitespace.

Dismax, OTOH, treats "bq" as an array of query strings (multiple "bq" params) 
and parses each as a separate sub-query.

Edismax in 3.6/3.6.1 has the old dismax code.

The culprit? SOLR-3278: "edismax support for negative boost with "bq" 
parameter" introduced the error, back in March.

                
> Parentheses in a boost query cause errors
> -----------------------------------------
>
>                 Key: SOLR-3823
>                 URL: https://issues.apache.org/jira/browse/SOLR-3823
>             Project: Solr
>          Issue Type: Bug
>          Components: query parsers
>    Affects Versions: 4.0-BETA
>         Environment: Mac, jdk 1.6, Chrome
>            Reporter: Mathos Marcer
>
> When using a boost query (bq) that contains a parentheses (like this example 
> from the Relevancy Cookbook section of the wiki):
> {noformat}
>  ? defType = dismax 
>     & q = foo bar 
>     & bq = (*:* -xxx)^999 
> {noformat}
> You get the following error:
> org.apache.lucene.queryparser.classic.ParseException: Cannot parse '-xxx)': 
> Encountered " ")" ") "" at line 1, column 12. Was expecting one of: <EOF> 
> <AND> ... <OR> ... <NOT> ... "+" ... "-" ... <BAREOPER> ... "(" ... "*" ... 
> "^" ... <QUOTED> ... <TERM> ... <FUZZY_SLOP> ... <PREFIXTERM> ... <WILDTERM> 
> ... <REGEXPTERM> ... "[" ... "{" ... <NUMBER> ...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to