![](/img/trans.png)
[英]Elasticsearch - How to add or edit array of strings in a JSON object using Java?
[英]How to add JSON array to elasticsearch using Postman
我嘗試使用郵遞員通過以下方式添加示例數據集,
POST URL: http://localhost:9200/allData
以json的形式添加到郵遞員的正文中
{
"index": "allData",
"type": "all",
"id": 1006,
"body": {
"id": 1006,
"url": "https://en.wikiversity.org/wiki/Principles_of_Management",
"title": "Principles of Management",
"author": "",
"rate": 0,
"ratedBy": 0,
"datePublished": "2018-01-01T00:00:00",
"publishedDate": "2018-01-01"
}
}
但是它給出以下錯誤。
找不到uri [/]和方法[POST]的處理程序
有人請幫我解決這個問題。 謝謝
您的請求存在某些問題:
您的網址應采用以下格式:
http://localhost:9200/{indexname}/{type}/{id}
您的情況必須是:
http://localhost:9200/alldata/all/1006
因此,您應該使用以下內容對上述網址執行POST請求:
{
"id": 1006,
"url": "https://en.wikiversity.org/wiki/Principles_of_Management",
"title": "Principles of Management",
"author": "",
"rate": 0,
"ratedBy": 0,
"datePublished": "2018-01-01T00:00:00",
"publishedDate": "2018-01-01"
}
看一下《 Elasticsearch參考指南》 。
希望能幫助到你 !
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.