# Nested terms

**URL:** <https://discuss.elastic.co/t/nested-terms/244593>\
**Category:** Elasticsearch\
**Created:** [August 11, 2020, 4:14pm UTC](https://discuss.elastic.co/t/nested-terms/244593 "2020-08-11T16:14:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![krathore](https://avatars.discourse-cdn.com/v4/letter/k/a6a055/32.png) [@krathore](https://discuss.elastic.co/u/krathore)\
**Post date:** [August 11, 2020, 4:14pm UTC](https://discuss.elastic.co/t/nested-terms/244593/1 "2020-08-11T16:14:18Z")

</div>

Can some one pls help me to write a query , i cannot get result back

body: {  
query: {

```
                        bool: {

                            must: [

                                {

                                    nested: {

                                        path: "Permissions",

                                        query: {

                                            terms: {

                                                "Permissions.PermissionCode ": cod

                                            }

                                        }

                                    }

                                }

                            ]

                        }

                    }

                }

```

}

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 12, 2020, 9:20am UTC](https://discuss.elastic.co/t/nested-terms/244593/2 "2020-08-12T09:20:19Z")

</div>

Please take some more time to write a proper question. See also [https://www.elastic.co/help](https://www.elastic.co/help)

This is an incomplete query, and not a full search request, so noone knows if this is the full query. Also, it is badly formatted with lots of newlines and whitespace, which makes it hard to read.

However the most important part is to create a reproducible example, which **includes** index creation, index mapping, document indexing and a search request. If these information are missing, then every try to debug is more of a guess than a good tip.

Thanks!

---

<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:** [September 9, 2020, 9:20am UTC](https://discuss.elastic.co/t/nested-terms/244593/3 "2020-09-09T09:20:27Z")

</div>

Closed on September 9, 2020, 9:20am UTC

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