Beginner Elasticsearch question: AND vs +

I have a beginner's question about search syntax:

are the following searches identical? or if not what is the difference?

  • United AND Kingdom
  • United +Kingdom

Thank you

I think you meant

+United +Kingdom

Both then are equivalent.

Otherwise United is optional with

United +Kingdom

Thank you very much, and sorry for the basic question. Based on your answer, may I confirm that the text somewhere in the Kingdom WOULD MATCH the search text United +Kingdom (because, as you point out, "United" is optional) ?

Yes. That's correct.

But note that in general, you should prefer not using such a syntax as the end user should not care about the syntax... But this depends on the use case.

2 Likes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.