Hi everybody. I'm playing with elasticsearch a bit to understand it better (fairly new to me). Now I have created a getTermsQuery method. Which gets a field and a terms collection in the parameters. And all it actually does is check whether the first term in the terms collection matches the field. But now I have multiple objects with a field(id) and a terms collection with multiple ids of objects that I want to retrieve. How can I change this so that it doesn't just grab the first one, but checks with each id in the terms collection for a hit with an object?
private static Query getTermsQuery(final String field, final Collection<String> terms) {
return Query.of(qb -> qb.match(tb -> tb.field(field)
.query(q -> q.stringValue(terms.stream().findFirst().get()))));
}