[英]Create a JSON document, elasticsearch
我将引用“ www.elastic.co”的部分文档中有关JSON文档创建的内容:
将简单的客户文档索引为ID为1的“外部”类型的客户索引,如下所示:我们的JSON文档:{“ name”:“ John Doe”}
curl -XPUT 'localhost:9200/customer/external/1?pretty' -d '{"name": "John Doe"}'
我从网址中删除了引号,
curl -XPUT localhost:9200/customer/external/1?pretty -d '{"name": "John Doe"}'
结果是一个错误
{ "error" : "Content-Type header [application/x-www-formurlencoded] is not supported", "status" : 406
}
卷曲查询中缺少内容类型。
curl -XPUT -H "Content-Type: application/json" 'localhost:9200/customer/external/1?pretty' -d '{"name": "John Doe"}'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.