How to define field alias to nested objects


(Mahendra Shinde) #1

Hi,
I have mapping like this

{
 "mappings": {
   "my_data": {
     "properties": {
   emotion_json": {
         "type": "nested",
         "properties": {
           "total_count": {
             "type": "integer"
           },
           "emotion_type": {
             "type": "text"
           },
           "name": {
             "type": "keyword"
           },
           "matches": {
             "properties": {
               "phrase": {
                 "type": "text"
               },
               "count": {
                 "type": "integer"
               }
             }
           }
         }
       }        
     }
   }
 }
}

And I wish to create alias to 'name' field. I need create it to use in Kibana.
I tried to create using below command

PUT /data_mahendra_288/_mapping/my_data
{
  "my_data": {
    "properties": {
      "emotion_json_name_alias": {
        "type": "alias",
        "path": "emotion_json.name"
      }
    }
  }
}

but not working. Any guess why?


(system) #2

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