String searchText = "TEST";
.query(q -> q.bool(b -> b .must(c-> c .match(t -> t .field("FIELD NAME").query(searchText) ))
I need to pass String Array to query. Whats the best way I can do it.
If you want to use a list of values, I believe you should use Terms Query.
Below is my suggestion:
var array = new ArrayList<FieldValue>();
var termsQuery = TermsQuery.of(ts -> ts
.terms(TermsQueryField.of(t -> t.value(array))));
var searchRequest = SearchRequest.of(sr -> sr
Thank you @RabBit_BR . This is the solution I was looking for.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.