I'm trying to write a simple query in ES 5.6.4 to be the equivalent of "SELECT * FROM index WHERE Location LIKE '%Michigan%' OR Location LIKE '%Main%', and it's working but the second term in the "or" does not match as many results as when I use it in an "or" by itself ? Which doesn't make any sense to me, for Example:
Note that you can have only 1 bool query with 2 should and a minimum_should_match = 1, instead of a must with 2 bool. With you first query you have only 1 result ?
I'm using curl, I'm just trying to run a query to match "SELECT * FROM index WHERE Location LIKE '%Michigan%' OR Location LIKE '%Main%'". My goal is to retrieve every building containing Michigan OR Main in the "Location" term.
I tried running the script you suggested and got the same result unfortunately. It returned many results for "Michigan" but only one result for "Main":
When you run your query with the "OR", how many documents do you receive ? The default size of a query is 10. It's possible that ES return 9 Michigan et 1 Main ?
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.