2

How to add a new data field to an existing dataset using Update API in elsticsearch. For example if dataset already contains fields like id but now I need to add a new field name Name and pass a value A.

Tony Stark
  • 511
  • 2
  • 15

1 Answers1

0

you can use below code to add for example an email field to your existing index

PUT /my-index-000001/_mapping
{
  "properties": {
    "email": {
      "type": "keyword"
    }
  }
}

refrence: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html

Omk
  • 1
  • 2
  • 16