Need an example to to multi value search

Hi Team,
We need an example to to multi value search using co.elastic.clients.elasticsearch._types.query_dsl.Query.
Assume we have a field called "rating" in Elasticsearch.
I want a JAVA Elasticsearch query written using co.elastic.clients.elasticsearch._types.query_dsl.Query.

For example consider below example
if query says rating= AA,B
Record "rating" should have either AA or B
then it should fetch records with id 1,2,4

{ "id":1,
{ "id":2,
{ "id":3,
{ "id":4,
{ "id":5,


What about a match query with "AA B"?
Or a simple_query_string query?

Thanks for responding David.
Yeah I would like to have sample example for both MatchQuery and simple_query.
Given query(AA,B) it should records with value either AA or B.

Is there anything unclear in the documentation?

Example provided in the documentation does not contain searching using multiple values.

I proposed searching for "AA B".

Thanks a lot David. It worked

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