Elasticsearch: root mapping definition has an index of unsupported parameters: not_analyzed

Hi everyone, I am trying to create a test circuit.

PUT /test { "mappings": { "field1": { "type": "integer" }, "field2": { "type": "integer" }, "field3": { "type": "string", "index": "not_analyzed" }, "field4": { "type": "string", "analyzer": "autocomplete", "search_analyzer": "standard" } }, "settings": { bla bla bla } } 

I get the following error

 { "error": { "root_cause": [{ "type": "mapper_parsing_exception", "reason": "Root mapping definition has unsupported parameters: [index : not_analyzed] [type : string]" }], "type": "mapper_parsing_exception", "reason": "Failed to parse mapping [featured]: Root mapping definition has unsupported parameters: [index : not_analyzed] [type : string]", "caused_by": { "type": "mapper_parsing_exception", "reason": "Root mapping definition has unsupported parameters: [index : not_analyzed] [type : string]" } }, "status": 400 } 

Please help me resolve this error.

+41
mapping elasticsearch
source share
3 answers

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.

+63
source share

I hope the answer above works for elastic search <7.0, but in 7.0 we cannot specify the document type and it is no longer supported. And in this case, if we indicate the type of document, we get a similar error.

If you are using Elastic search 7.0 and the latest version of Nest C # (6.6). There are some major changes in ES 7.0 that cause this problem. This is because we cannot specify the type of document and in version 6.6 NEST they use doctype. Thus, in order to decide that before the release of NEST 7.0, we need to download their beta version

Please follow this link to fix it.

https://xyzcoder.imtqy.com/elasticsearch/nest/2019/04/12/es-70-and-nest-mapping-error.html

EDIT: NEST 7.0 is now released. NEST 7.0 works with Elastic 7.0. See the release notes here for details.

+16
source share

Check your version of Elastic.

I had these problems because I was looking for documentation on the wrong version.

enter image description here

+2
source share

All Articles