Kuan
Kuan

Reputation: 11389

How to tell the logic like plus sign with OR in solr

All:

Right now, I want to input a search in SOLR like this:

+keyword1 OR +keyword2
+keyword1 OR keyword2

Could anyone explain how SOLR process this logic? I am not sure if this above eaquals

keyword1 AND keyword2
keyword1

Thanks

Upvotes: 2

Views: 1729

Answers (1)

MattMcKnight
MattMcKnight

Reputation: 8290

I would not recommend mixing the prefix (+,-) syntax with the boolean (AND, OR) syntax. "+" corresponds to Occur.MUST. A term without a prefix corresponds to Occur.SHOULD, which means it gets a scoring boost, but documents lacking that term may be in the results.

I recommend reading this article: https://lucidworks.com/post/why-not-and-or-and-not/

Upvotes: 3

Related Questions