I try to find out how to build the following query with elasticsearch java api
{
"query": {
"bool": {
"must": [
{
"terms_set": {
"names": {
"minimum_should_match_field": "some_match_field",
"terms": [
"Ala",
"Bob"
]
}
}
}
]
}
}
}
I tried to build this query with following code, but there is no termsSetQuery method as well as minimumShouldMatchField in api.
NativeSearchQuery build = new NativeSearchQueryBuilder()
.withQuery(boolQuery()
.must(termsQuery("names", List.of("Ala", "Bob"))))
.build();
but it results as below
{
"bool": {
"must": [
{
"terms": {
"names": [
"Ala",
"Bob"
]
}
}
]
}
}