Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

columntypedescription
indextext name of the index, partition key
type textthe type for which the mapping should be applied, primary key
versionintpart of primary key, can be used for auditing or getting current mapping
mappingtextthe json of mapping called
statusintdenotes 1 for success, 0 for failure
responsetextresponse received from ES while calling update mapping
createdBytextuserId of person who called update mapping API
createdOntimestampwhen the API was invoked to update mapping


API Structure

Code Block
languagejs
themeEclipse
collapsetrue
Request
 
PUT /es/index/{indexName}/mapping
{
  "type": "_doc",
  "mapping": {
       	"dynamic": false,
  		"properties": {
    		"all_fields": {
      			"type": "text",
      			"fields": {
        			"raw": {
          				"type": "text",
          				"analyzer": "keylower"
        			}
      			},
      			"analyzer": "cs_index_analyzer",
      			"search_analyzer": "cs_search_analyzer"
    		},
    		"name": {
      			"type": "text",
      			"fields": {
        			"raw": {
          				"type": "text",
          				"analyzer": "keylower",
          				"fielddata": true
        				}
      				},
      			"copy_to": [
        			"all_fields"
      			],
      			"analyzer": "cs_index_analyzer",
      			"search_analyzer": "cs_search_analyzer",
      			"fielddata": true
    		}
		}
	}
  }
}
 
Response
 
{
  "id": "api.es.index.mapping",
  "result": {
		"response" : {
				// response from ES
			} 
	}
}