elasticsearch,Json,elasticsearch" /> elasticsearch,Json,elasticsearch" />

Json 如何修复空白分析器错误?

Json 如何修复空白分析器错误?,json,elasticsearch,Json,elasticsearch,我已尝试使用以下命令使用elasticdump导入映射: elasticdump --input=myMapping.json --output=http://localhost:9200/myIndex --type=mapping 获取以下输出: Fri, 18 Dec 2015 17:53:05 GMT | starting dump Fri, 18 Dec 2015 17:53:05 GMT | got 1 objects from source file (offset: 0) Fr

我已尝试使用以下命令使用elasticdump导入映射:

elasticdump --input=myMapping.json --output=http://localhost:9200/myIndex --type=mapping
获取以下输出:

Fri, 18 Dec 2015 17:53:05 GMT | starting dump
Fri, 18 Dec 2015 17:53:05 GMT | got 1 objects from source file (offset: 0)
Fri, 18 Dec 2015 17:53:05 GMT | Error Emitted => {"root_cause":[{"type":"mapper_parsing_exception","reason":"analyzer [whitespace_analyzer] not found for field [_all]"}],"type":"mapper_parsing_exception","reason":"analyzer [whitespace_analyzer] not found for field [_all]"}
Fri, 18 Dec 2015 17:53:05 GMT | Total Writes: 0
Fri, 18 Dec 2015 17:53:05 GMT | dump ended with error (set phase)  => [object Object]
我在谷歌上搜索了这个问题,但我找不到答案。有什么想法吗

编辑:MyMapping.json

[
"{\"myIndex\":{\"mappings\":{\"favourites\":{\"_all\":{\"index_analyzer\":\"nGram_analyzer\",\"search_analyzer\":\"whitespace_analyzer\"},\"_timestamp\":{\"enabled\":true,\"store\":true},\"properties\":{\"thing\":{\"properties\":{\"type_one_id\":{\"type\":\"long\",\"include_in_all\":false},\"type_two_id\":{\"type\":\"string\"},\"type_three_id\":{\"type\":\"string\"},\"att_one\":{\"type\":\"long\"},\"att_two\":{\"type\":\"string\"},\"att_three\":{\"type\":\"long\"},\"att_four\":{\"type\":\"string\"},\"att_five\":{\"type\":\"long\"},\"att_six\":{\"type\":\"string\"},\"att_seven\":{\"type\":\"long\",\"include_in_all\":false},\"att_eight\":{\"type\":\"string\"},\"att_nine\":{\"type\":\"long\",\"include_in_all\":false},\"att_ten\":{\"type\":\"long\",\"include_in_all\":false},\"att_eleven\":{\"type\":\"long\",\"include_in_all\":false},\"att_twelve\":{\"type\":\"string\"},\"att_thirteen\":{\"type\":\"string\"},\"att_fourteen\":{\"type\":\"string\"},\"att_fifteen\":{\"type\":\"string\"},\"att_sixteen\":{\"type\":\"long\",\"include_in_all\":false},\"seventeen\":{\"type\":\"string\"},\"eighteeen\":{\"type\":\"long\",\"include_in_all\":false},\"nineteen\":{\"type\":\"long\",\"include_in_all\":false},\"twenty\":{\"type\":\"long\",\"include_in_all\":false},\"twenty_one\":{\"type\":\"long\"}}},\"uuid\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"include_in_all\":false},\"versionId\":{\"type\":\"long\"},\"version_id\":{\"type\":\"long\",\"include_in_all\":false}}}}}}"
]

您首先需要定义您的
nGram_分析器
whitespace_分析器
,因为ES找不到它们,所以会出现错误,因此请创建如下索引(根据需要更改此索引)

然后你的命令会起作用,这是我得到的输出

Sat, 19 Dec 2015 02:55:24 GMT | starting dump
Sat, 19 Dec 2015 02:55:24 GMT | got 1 objects from source file (offset: 0)
Sat, 19 Dec 2015 02:55:24 GMT | sent 1 objects to destination elasticsearch, wrote 1
Sat, 19 Dec 2015 02:55:24 GMT | got 0 objects from source file (offset: 1)
Sat, 19 Dec 2015 02:55:24 GMT | sent 0 objects to destination elasticsearch, wrote 0
Sat, 19 Dec 2015 02:55:24 GMT | Total Writes: 1
Sat, 19 Dec 2015 02:55:24 GMT | dump complete

你能发布myMapping.json吗?
Sat, 19 Dec 2015 02:55:24 GMT | starting dump
Sat, 19 Dec 2015 02:55:24 GMT | got 1 objects from source file (offset: 0)
Sat, 19 Dec 2015 02:55:24 GMT | sent 1 objects to destination elasticsearch, wrote 1
Sat, 19 Dec 2015 02:55:24 GMT | got 0 objects from source file (offset: 1)
Sat, 19 Dec 2015 02:55:24 GMT | sent 0 objects to destination elasticsearch, wrote 0
Sat, 19 Dec 2015 02:55:24 GMT | Total Writes: 1
Sat, 19 Dec 2015 02:55:24 GMT | dump complete