I'm having weird trouble with enterprise app search hosted on Elastic Cloud.
I've several documents indexed with a field called customer_groups, when I make the following query: customer_groups:"112" OR customer_groups:"118" I get the expected results (documents with 112 or 118 in their customer_groups field) but when I add another condition, for example, customer_groups:"112" OR customer_groups:"118" OR customer_groups:"322" it doesn't return any result.
If I keep adding more OR conditions don't work either, I've tried this other way with the same result:
When adding terms to a query, a minimum of the fields should match in order for the query to succeed. At the default precision level (2), less than half of the terms must match. That means that even though you're using OR clauses, at least half of them needs to match for a result to be returned. This is related to how Lucene (the underlying search Engine for Elasticsearch) works.
For solving this, you can tweak precision and use precision level 1 for your query.
Based on your use case, it might be possible that you need to perform filtering instead. You can combine filters for retrieving results that match any of your customer_groups field:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.