Currently, we have fixed 3 search queries in our multi-search query. The code looks like:
var results = elasticClient.MultiSearch(a => a
.Search<StockBaseEntity>(s => s
.Type("<docType>")
.Index(<indexName>)
.Take(<count>)
.Query(qq => qq
...
.Search<StockBaseEntity>(s => s
.Type("<docType>")
.Index(<indexName>)
.Take(<count>)
.Query(qq => qq
....
.Search<StockBaseEntity>(s => s
.Type("<docType>")
.Index(<indexName>)
.Take(<count>)
.Query(qq => qq
....
All three search queries have some different query parameters, for example, first query returns "type1" doc, second & third return "type2 and type3" docs respectively.
We want to build this multi search nest query in such a way that we can have any number of search nest queries in multi searach query (and not only 3). It could be 3/4/5 or any number of search queries based on some condition. This can be achived if we can append search queries to multisearch? can we do this?
I read this article but can't get same for nest version 5.X and I have no clue how to write query with QueryContainer?