Problem when indexing nested object (Elasticsearch 7.0.0 released)

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"
      }
   ]
}

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. 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.

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 !!!

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

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