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,
"rating"="AA",
"occupation":"Architect",
"lender_yield"=1.0
},
{ "id":2,
"rating"="AA",
"occupation":"Architect",
"lender_yield"=1.1
},
{ "id":3,
"rating"="C",
"occupation":"Analyst",
"lender_yield"=3.0
},
{ "id":4,
"rating"="B",
"occupation":"Analyst",
"lender_yield"=2.8
},
{ "id":5,
"rating"="A",
"occupation":"Analyst",
"lender_yield"=2.0
}
]

Welcome!

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.