The previous type of search works very well for single term search. If you want to achieve a multiterm search, you can process in two ways: by using an and/or filter or using the multiterm query.
You need a working ElasticSearch cluster and an index populated with the script available in online code.
For executing a terms query/filter, we need to perform the following steps:
We execute a terms query, from command line as follows:
curl -XPOST 'http://127.0.0.1:9200/test-index/test-type/_search' -d '{ "query": { "terms": { "uuid": ["33333", "32222"] } } }'
The result returned by ElasticSearch, is the same as the previous recipe.
If you want use the terms query in a filter. The query should be as follows:
curl -XPOST 'http://127.0.0.1:9200/test-index/test-type/_search' -d '{ "query": { "filtered": { "filter": { "terms": { "uuid": ["33333", "32222...