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

Jan Høydahl commented on SOLR-8812:
-----------------------------------

Also, in SOLR-2649 we have
{code}
     public ExtendedSolrQueryParser(QParser parser, String defaultField) {
       super(parser, defaultField);
-      // don't trust that our parent class won't ever change its default
-      setDefaultOperator(QueryParser.Operator.OR);
+      // Respect the q.op parameter before mm will be applied later
+      SolrParams defaultParams = 
SolrParams.wrapDefaults(parser.getLocalParams(), parser.getParams());
+      QueryParser.Operator defaultOp = 
QueryParsing.getQueryParserDefaultOperator(
+          parser.getReq().getSchema(), defaultParams.get(QueryParsing.OP));
+      setDefaultOperator(defaultOp);
     }
{code}
This means the mm calculations may now get REQUIRED clauses as input, while 
before SOLR-2649 when defaultOperator was forced to OR, all clauses would enter 
as OPTIONAL. Since {{minShouldMatch}} is supposed to be calculated only between 
optional clauses, this will fail.

> ExtendedDismaxQParser (edismax) ignores Boolean OR when q.op=AND
> ----------------------------------------------------------------
>
>                 Key: SOLR-8812
>                 URL: https://issues.apache.org/jira/browse/SOLR-8812
>             Project: Solr
>          Issue Type: Bug
>          Components: query parsers
>    Affects Versions: 5.5
>            Reporter: Ryan Steinberg
>            Priority: Blocker
>             Fix For: 6.0, 5.5.1
>
>         Attachments: SOLR-8812.patch
>
>
> The edismax parser ignores Boolean OR in queries when q.op=AND. This behavior 
> is new to Solr 5.5.0 and an unexpected major change.
> Example:
>       "q": "id:12345 OR zzzzzzzzzz",
>       "defType": "edismax",
>       "q.op": "AND",
> where "12345" is a known document ID and "zzzzzzzzzz" is a string NOT present 
> in my data
> Version 5.5.0 produces zero results:
>     "rawquerystring": "id:12345 OR zzzzzzzzzz",
>     "querystring": "id:12345 OR zzzzzzzzzz",
>     "parsedquery": "(+((id:12345 
> DisjunctionMaxQuery((text:zzzzzzzzzz)))~2))/no_coord",
>     "parsedquery_toString": "+((id:12345 (text:zzzzzzzzzz))~2)",
>     "explain": {},
>     "QParser": "ExtendedDismaxQParser"
> Version 5.4.0 produces one result as expected
>   "rawquerystring": "id:12345 OR zzzzzzzzzz",
>     "querystring": "id:12345 OR zzzzzzzzzz",
>     "parsedquery": "(+(id:12345 
> DisjunctionMaxQuery((text:zzzzzzzzzz))))/no_coord",
>     "parsedquery_toString": "+(id:12345 (text:zzzzzzzzzz))"
>     "explain": {},
>     "QParser": "ExtendedDismaxQParser"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to