How NEST 1.x expression below could be rewritten to NEST 2.x or 5.x
var searchResult = _elasticClient.Search<SearchResult>(
request => request
.MinScore(0.7)
.Query(q =>
{
QueryContainer query = null;
query &= q.Terms<int>(t => t.Categories
.SelectMany(s => s.ChildCategories.Select(c => c.Id))
.ToArray(),
categories.Select(c => Convert.ToInt32(c)));
to accept List() which contains elements on what ids elastic search query should match
query &= q.Terms(c => c.Field(t => t.Categories.SelectMany(s => s.ChildCategories.Select(d => d.Id))));
This line will below complain about Terms has 1 parameter, but invoked with 2
query &= q.Terms(c => c.Field(t => t.Categories.SelectMany(s => s.ChildCategories.Select(d => d.Id))), new List<int> {1});
UPDATE:
The last example on elasticsearch documentation for 1.X contains field and qff.Terms(p => p.Country, userInput.Countries) which I want to achieve in NEST 5.x or 2.x