ElasticSearch {"error":"MapperParsingException[failed to parse];JsonParseException[Unexpected charac
来源:互联网 发布:linux 建立用户 编辑:程序博客网 时间:2024/04/29 01:47
{"error":"MapperParsingException[failed to parse]; nested: JsonParseException[Un
expected character (''' (code 39)): expected a valid value (number, String, arra
y, object, 'true', 'false' or 'null')\n at [Source: [B@6b36b647; line: 1, column
: 2]]; ","status":400}curl: (6) Could not resolve host: John,last_name
curl: (6) Could not resolve host: Smith,age
curl: (6) Could not resolve host: 25,about
curl: (6) Could not resolve host: I love to go rock climbing,interests
curl: (3) [globbing] bad range in column 2
报错的原图如下:
本来是打算,安装书上的教程,学习 ElasticSearch ,然后新建文档的时候,用这个curl插件,新建文档的。
命令如下:
curl -XPUT http://localhost:9200/blog/article/1 -d '{"title": "New version of Elasticsearch released!", "content": "Version 1.0 released today!", "tags": ["announce", "elasticsearch", "release"] }'
但是一直报错。刚刚开始,我发现是书上的json对象少了个双引号,然后给补上去之后,还是一样的问题,还是报错。然后检查json也是没问题的,但是还是不行。
我同桌的电脑是mac,然后我就把命令发给他,他在mac上执行了一下,OK,没有报错。
我就郁闷了,什么情况,mac的命令行怎么就可以呢!
然后查了下,在 Stack Overflow 网站上看到个解决方法,找到原因,原来Windows的命令行对这个双引号的识别问题。
把上面的原来的命令修改为如下格式,就可以正常运行。
curl -XPUT "http://localhost:9200/blog/article/1" -d "{"""title""": """New version of Elasticsearch released!""", """content""": """Version 1.0 released today!""","""tags""":"""["announce", "elasticsearch", "release"]"""}"
上面的json对象,我又稍作修改,又加了个属性,值为字符串数组类型。也是可以正确执行的。
- ElasticSearch {"error":"MapperParsingException[failed to parse];JsonParseException[Unexpected charac
- Windows下elasticsearch插入数据报错!"error":"MapperParsingException[failed to parse]
- elasticsearch MapperParsingException[failed to parse [auditDate]]; nested: NumberFormatException[Fo
- elasticsearch failed to parse date field
- Failed to parse json Unexpected token '\u0000' at 1:1
- general error c1010070: Failed to load and parse the manifest.
- Parse error: syntax error, unexpected T_PUBLIC in
- Parse error: syntax error, unexpected T_VARIABLE in
- PHP Parse error: syntax error, unexpected '.'
- JsonParseException: Unexpected character ('?' (code 255))
- JsonParseException: Unexpected character ('?' (code 239)): was expecting comma to separate OBJECT en
- Failed to parse mapping resource......
- PHP 解决Parse error: syntax error, unexpected $end问题
- PHP Parse Error: syntax error, unexpected $end 解决方法
- 莫名其妙的Parse error: syntax error, unexpected $end
- 莫名其妙的Parse error: syntax error, unexpected $end
- Parse error: syntax error, unexpected end of file in
- phpcms Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE错误
- struct 成员的对齐方式
- 简单工厂和工厂方法模式Java示例
- 警告:针对Windows Patch Bundles 11.2.0.4.8到11.2.0.4.161018 版本的db,需要进行scn 检查.
- angularJS搭建简单应用程序的基本架构分析
- 字典树(trie)简介以及两种实现
- ElasticSearch {"error":"MapperParsingException[failed to parse];JsonParseException[Unexpected charac
- Java语言的关键字(保留字)
- 取消电脑关机提示是否强制关机
- C语言中.h和.c文件解析(很精彩)
- QuickxDev插件(一) 简介
- JavaScript 数据类型
- 117. Populating Next Right Pointers in Each Node II 非常精炼的代码,值得好好体会
- Web 前端趋势
- leetcode 84 Largest Rectangle in Histogram