I have a database where I want to see which countries an organization exists in (one organization can exist in multiple countries like USA and Mexico). What would the correct Json syntax be if I wanted to see organizations that exist in USA but can exist in other countries as well?
When I execute the query:
GET iorganization/_search
{
"query": {
"bool": {
"must": [
{"match" : {"Countries" : "USA"}}
]
}
}
}
I get only results where the organization exists exclusively in USA so I am omitting countries that exist in USA among others.
Could you provide a full recreation script as described in About the Elasticsearch category. It will help to better understand what you are doing. Please, try to keep the example as simple as possible.
A full reproduction script will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.
It turns out that the bool query does return results where USA can be one of many countries, but the relevance score is highly weighted towards results where USA is the only/one of the few countries. This problem was created by mistake. Thanks for your help and I apologize about that.
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.