Update ES mapping

Assume that there is a session doc type under the index called abc.

The following example will update the existing field date and enforce the format.

PUT /abc/_mapping/session
{
  "properties": {
    "date": {
      "type": "date",
      "format" : "yyyy-MM-dd" 
    }
  } 
}

If you want to add a new nested type called scans,

PUT /abc/_mapping/session
{
  "properties": {
    "scans": {
      "type": "nested"
    }
  }
}
Advertisements