# NEST syntax for Multi Search queries

**URL:** https://discuss.elastic.co/t/nest-syntax-for-multi-search-queries/205312
**Category:** Elasticsearch
**Created:** [October 25, 2019, 6:42pm UTC](https://discuss.elastic.co/t/nest-syntax-for-multi-search-queries/205312 "2019-10-25T18:42:20Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![han1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/han1/32/20141_2.png) [@han1](https://discuss.elastic.co/u/han1)
#### Post date: [October 25, 2019, 6:42pm UTC](https://discuss.elastic.co/t/nest-syntax-for-multi-search-queries/205312/1 "2019-10-25T18:42:21Z")

</div>

Can anyone assist us with the syntax of how a Multi Search Query is created in NEST 7.  
(This is getting a pain having to ask for NEST syntax everytime!)  
Many thanks

---

<div class="post-metadata">

### Author: ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)
#### Post date: [October 28, 2019, 9:07am UTC](https://discuss.elastic.co/t/nest-syntax-for-multi-search-queries/205312/2 "2019-10-28T09:07:33Z")

</div>

Take a look at the [`MultiSearchApiTests`](https://github.com/elastic/elasticsearch-net/blob/7.x/src/Tests/Tests/Search/MultiSearch/MultiSearchApiTests.cs) for an example with the object initializer and fluent API syntaxes.

Essentially,

- Object initializer syntax expects multiple searches to be supplied as a `Dictionary<string, ISearchRequest>`, where the key is some name that you provide for the request

and

- Fluent API syntax supplies multiple search requests by chaining calls to `.Search<T>(string name, Func<SearchDescriptor<T>, ISearchRequest>)`

Responses are then reference on the `MultiSearchResponse` using the key/name provided on the request.

---

<div class="post-metadata">

### Author: ![han1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/han1/32/20141_2.png) [@han1](https://discuss.elastic.co/u/han1)
#### Post date: [October 28, 2019, 9:31am UTC](https://discuss.elastic.co/t/nest-syntax-for-multi-search-queries/205312/3 "2019-10-28T09:31:07Z")

</div>

Thanks for the reply.  
Are there any actual concrete examples anywhere for us to try and learn how rto do it?

Regards

---

<div class="post-metadata">

### Author: ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)
#### Post date: [October 28, 2019, 9:49am UTC](https://discuss.elastic.co/t/nest-syntax-for-multi-search-queries/205312/4 "2019-10-28T09:49:22Z")

</div>

There aren't any long form documentation examples currently. This [stackoverflow answer](https://stackoverflow.com/a/37127974/1831) may also help

---

<div class="post-metadata">

### Author: ![han1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/han1/32/20141_2.png) [@han1](https://discuss.elastic.co/u/han1)
#### Post date: [October 28, 2019, 10:29am UTC](https://discuss.elastic.co/t/nest-syntax-for-multi-search-queries/205312/5 "2019-10-28T10:29:57Z")

</div>

Many thanks for your assistance.  
Regards

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [November 25, 2019, 10:30am UTC](https://discuss.elastic.co/t/nest-syntax-for-multi-search-queries/205312/6 "2019-11-25T10:30:02Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
