簡體   English   中英

創建一個JSON文檔elasticsearch

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM