You are almost here, you are just missing a few things:
PUT /test { "mappings": { "type_name": { <--- add the type name "properties": { <--- enclose all field definitions in "properties" "field1": { "type": "integer" }, "field2": { "type": "integer" }, "field3": { "type": "string", "index": "not_analyzed" }, "field4,": { "type": "string", "analyzer": "autocomplete", "search_analyzer": "standard" } } } }, "settings": { ... } }
UPDATE
If your index already exists, you can also change your mappings as follows:
PUT test/_mapping/type_name { "properties": { <--- enclose all field definitions in "properties" "field1": { "type": "integer" }, "field2": { "type": "integer" }, "field3": { "type": "string", "index": "not_analyzed" }, "field4,": { "type": "string", "analyzer": "autocomplete", "search_analyzer": "standard" } } }
UPDATE :
Starting with ES 7, display types have been removed. You can read more details here.
Val
source share