问题描述:

I can search our database using a single search e.g

.Term("productName", "test")

We got some scenarios where we got a list of product names to lookup.To avoid a GET request for each product name in the list, I would like to make one GET request containing multiple queries. Problem is that the endpoint doesn't support MultiSearch (_msearch).

My question is, is it possible to do multiple searches using one GET request using the _search endpoint?

The queries are implemented in C# and the Nest framework.

Thanks.

网友答案:

Instead of Term method you should use .Query extension method, like this:

.Query(q =>
   q.Terms(p=> p.Key, values)

For more info check out the documentation here

相关阅读:
Top