On 12/12/2012 5:51 AM, Burgmans, Tom wrote:
I have some documents indexed; 3 of them contain “Thomas” and 4 of
them contain “Michael”, but none of the contain both. A search for
http://localhost:8983/solr/collection1/browse?defType=edismax&q=(Thomas+Michael)
<http://localhost:8983/solr/collection1/browse?defType=edismax&q=%28Thomas+Michael%29>
returns 0 results as expected since there is an implicit AND between
the two terms and there is no document that matches both. But a search
for
http://localhost:8983/solr/collection1/browse?defType=edismax&q=(Thomas+Michael)+OR+xxxmatchesnothingxxx
<http://localhost:8983/solr/collection1/browse?defType=edismax&q=%28Thomas+Michael%29+OR+xxxmatchesnothingxxx>
returns 7 results. For some reason the implicit AND turns into an
implicit OR, in case an Explicit OR is added to the query expression.
The parsedquery information confirms this behavior.
I'll give you my best guess, nothing to back this up but instinct. The
following statements (especially the second one) may be wrong:
When you do not include any boolean operators, edismax is using its "mm"
parameter, which defaults to 100%, meaning that all search terms must
match (equivalent to a default operator of AND).
When you DO include a boolean operator, mm goes out the window and
edismax reverts to using the default operator for solr, your schema, or
the request handler, which unless you have changed it, is OR.
Thanks,
Shawn