When type is declared as string, Elasticsearch 6.0 will show this error.
type
string
\"name\" => [ \"type\" => \"string\", \"analyzer\" =
Elasticsearch has dropped the string type and is now using text. So your code should be something like this
text
"name" => [ "type" => "text", "analyzer" => "ik_max_word" ]