# Problem when indexing nested object (Elasticsearch 7.0.0 released)

**URL:** <https://discuss.elastic.co/t/problem-when-indexing-nested-object-elasticsearch-7-0-0-released/180368>\
**Category:** Elasticsearch\
**Created:** [May 9, 2019, 1:06pm UTC](https://discuss.elastic.co/t/problem-when-indexing-nested-object-elasticsearch-7-0-0-released/180368 "2019-05-09T13:06:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aeljazouli](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@aeljazouli](https://discuss.elastic.co/u/aeljazouli)\
**Post date:** [May 9, 2019, 1:06pm UTC](https://discuss.elastic.co/t/problem-when-indexing-nested-object-elasticsearch-7-0-0-released/180368/1 "2019-05-09T13:06:34Z")

</div>

Hi there,  
I have some problem when i want to index (by Kibana console) nested object.

I got this error :

[ "type": "illegal\_argument\_exception",  
"reason": "object mapping [transcription] can't be changed from nested to non-nested" ]

```
{
   "mappings":{
      "properties":{
         "meta":{
            "properties":{
               "ID_FICHIER":{
                  "type":"keyword"
               },
               "DATE_APPEL":{
                  "type":"date",
                  "format":"yyyy-MM-dd HH:mm:ss"
               },
               "SITE":{
                  "type":"keyword"
               },
               "ID_AGENT":{
                  "type":"keyword"
               }
            }
         },
         "transcription":{
            "type":"nested",
            "properties":{
               "confidence":{
                  "type":"text"
               },
               "word":{
                  "type":"text"
               }
            }
         }
      }
   }
}

```

And there is my document

```
{
   "meta":{
      "ID_FICHIER":127740,
      "DATE_APPEL":"2018-10-15 15:17:42",
      "SITE":"Rabat",
      "ID_AGENT":2053265
   },
   "transcription":[
      {
         "confidence":0.985514,
         "word":"bonjour"
      },
      {
         "confidence":0.633511,
         "word":"allo"
      },
      {
         "confidence":0.533511,
         "word":"monsieur"
      },
      {
         "confidence":0.767069,
         "word":"oui"
      },
      {
         "confidence":0.901756,
         "word":"total"
      }
   ]
}
```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 9, 2019, 3:49pm UTC](https://discuss.elastic.co/t/problem-when-indexing-nested-object-elasticsearch-7-0-0-released/180368/2 "2019-05-09T15:49:52Z")

</div>

There is no trace in your mapping example of any field named `restaurant_customer_review_details`.

Are you sure the trace matches the query you sent?

Could you provide a full recreation script as described in [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

---

<div class="post-metadata">

**Author:** ![aeljazouli](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@aeljazouli](https://discuss.elastic.co/u/aeljazouli)\
**Post date:** [May 10, 2019, 8:42am UTC](https://discuss.elastic.co/t/problem-when-indexing-nested-object-elasticsearch-7-0-0-released/180368/3 "2019-05-10T08:42:58Z")

</div>

Thank you David for this remark. In fact it is the field "transcription". I have just corrected the publication.

I managed to index the document in the index type "\_doc" and not another one. I think I need to specify the type of index in my mapping.

So Will this mapping help me for example : on a document to calculate the number of words that are equal to "pizza" ?

Thanks !!!

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 10, 2019, 8:56am UTC](https://discuss.elastic.co/t/problem-when-indexing-nested-object-elasticsearch-7-0-0-released/180368/4 "2019-05-10T08:56:29Z")

</div>

May be this would help? [https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-termvectors.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-termvectors.html)

---

<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:** [June 7, 2019, 8:56am UTC](https://discuss.elastic.co/t/problem-when-indexing-nested-object-elasticsearch-7-0-0-released/180368/5 "2019-06-07T08:56:35Z")

</div>

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