No handler for type [string] declared on field [name]

ElasticsearchElasticsearch MappingElasticsearch 6

Elasticsearch Problem Overview


When type is declared as string, Elasticsearch 6.0 will show this error.

"name" => [
  "type" => "string",
  "analyzer" => "ik_max_word"
]

Elasticsearch Solutions


Solution 1 - Elasticsearch

Elasticsearch has dropped the string type and is now using text. So your code should be something like this

"name" => [
  "type" => "text",
  "analyzer" => "ik_max_word"
]

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionVidy VideniView Question on Stackoverflow
Solution 1 - ElasticsearchAryeetey Solomon AryeeteyView Answer on Stackoverflow