This article is a mirror article of machine translation, please click here to jump to the original article.

View: 9077|Reply: 0

Elasticsearch:No handler for type [string] declared on field[XX]的解决办法

[Copy link]
Posted on 1/9/2019 10:29:11 AM | | | |
Error reason

{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "No handler for type [string] declared on field [upload_status]"
}
],
"type": "mapper_parsing_exception",
"reason": "No handler for type [string] declared on field [upload_status]"
},
"status": 400
}


I am using Elasticsearch version 6.2.2 and when creating fields according to the school documentation, I use {"type":"string","index":"not_analyzed"}.

Cause analysis

After checking the spelling, I decided to check the new version of Elasticsearch features, because I had also stepped on the pit of the installation method of the head plugin before, because of the version problem.
Sure enough, Elasticsearch introduced text and keyword from 5.X, where keyword is applied to non-segmentation fields, and can only match exactly when searching, at which point the string is still retained.

arrived6.X completely removes the stringFinish.

Other than thatThe value of "index" can only be a boolean variable

Workaround

{"type":"text","index":false}

So, the json modification is as follows:

But there are new errors that are as follows:

{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Rejecting mapping update to [restraunt] as the final mapping would have more than 1 type: [record, info]"
}
],
"type": "illegal_argument_exception",
"reason": "Rejecting mapping update to [restraunt] as the final mapping would have more than 1 type: [record, info]"
},
"status": 400
}
This is due to:A major change in Elasticsearch 6.x where Mapping only allows one type。 Indexes created in 5.x with multiple mapping types will continue to run in Elasticsearch 6.x as before. Mapping types will be completely removed in Elasticsearch 7.0.0.

After Elasticsearch 7.x release, the parameter in typeURL is optional. For example, indexing documents no longer requires a document type

Resources:

https://github.com/sirensolutions/sentinl/issues/257
https://www.elastic.co/guide/en/ ... moval-of-types.html







Previous:MD5 encryption
Next:How does C# code make your computer shut down, restart, log out, lock, shut down...
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com