# Create and search nested document

**URL:** <https://discuss.elastic.co/t/create-and-search-nested-document/288946>\
**Category:** Elasticsearch\
**Created:** [November 11, 2021, 4:51am UTC](https://discuss.elastic.co/t/create-and-search-nested-document/288946 "2021-11-11T04:51:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Odunayo\_Ogundepo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/odunayo_ogundepo/32/81599_2.png) [@Odunayo\_Ogundepo](https://discuss.elastic.co/u/Odunayo_Ogundepo)\
**Post date:** [November 11, 2021, 4:51am UTC](https://discuss.elastic.co/t/create-and-search-nested-document/288946/1 "2021-11-11T04:51:42Z")

</div>

Hi,

I have a document that looks like this

```auto

{"rid" : "1", 
  "oid":"23,  
  "data" :{
         "ticks": [{
              "a": "xx",
               "b" : "yy"
                 },
              {
              "a": "xxx",
               "b" : "yyy"}
]}

```

I see that Elasticsearch 7.14 does not allow explicit definitions of mapping when creating indices. how can I index this such that I can search "b" field and return only this source of documents that match the query {  
"a": "xx",  
"b" : "yy"  
}

---

<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:** [December 9, 2021, 4:51am UTC](https://discuss.elastic.co/t/create-and-search-nested-document/288946/2 "2021-12-09T04:51:49Z")

</div>

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