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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s