Difference between search results from Solr 5 and 8

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Difference between search results from Solr 5 and 8

heaven
Hi all,

We upgraded our Solr cluster from 5 to 8 and I've found a difference in search results.

Previously we had this in the schema.xml:
<solrQueryParser defaultOperator="AND"/>

Which stopped working in Solr 8, so we mowed this to solrconfig.xml as:
<str name="q.op">AND</str>

Now, this search gives 0 results while previously it worked fine and returned 2 records:
[ path=select parameters={fq: ["type:Member"], sort: "score desc", q: "[hidden email] [hidden email]", fl: "* score", qf: "email_words_ngram", defType: "edismax", mm: 1, start: 0, rows: 20} ]

At the same time the docs say that terms without explicit "+" or "-" are considered as optional and results of both terms should be returned.

This search works:
[ path=select parameters={fq: ["type:Member"], sort: "score desc", q: "[hidden email] OR [hidden email]", fl: "* score", qf: "email_words_ngram", defType: "edismax", mm: 1, start: 0, rows: 20} ]

I need help figuring out what's wrong with our configuration and how to handle this properly.

Thank you,
Alexander
Reply | Threaded
Open this post in threaded view
|

Re: Difference between search results from Solr 5 and 8

Shawn Heisey-2
On 8/5/2019 7:34 AM, Alexander Sherbakov wrote:
> Which stopped working in Solr 8, so we mowed this to solrconfig.xml as:
> <str name="q.op">AND</str>
>
> Now, this search gives 0 results while previously it worked fine and returned 2 records:
> [ path=select parameters={fq: ["type:Member"], sort: "score desc", q: "[hidden email] [hidden email]", fl: "* score", qf: "email_words_ngram", defType: "edismax", mm: 1, start: 0, rows: 20} ]
>
> At the same time the docs say that terms without explicit "+" or "-" are considered as optional and results of both terms should be returned.

Untagged clauses are indeed optional -- if you leave the default
operator at "OR".  You've set it to "AND", which means that effectively
any query clause without a +/- or a boolean operator has an implicit +
-- it will be required.

The behavior in Solr 5 should be the same with a default operator of
AND, unless you were perhaps running into a bug there.  Or maybe
everything was not entirely the same before.

Thanks,
Shawn