我尝试按照以下方式使用邮递员添加示例数据集,
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]的处理程序
请有人帮我解决这个问题。谢谢
答案 0 :(得分:1)
您的请求存在某些问题:
您的网址应采用以下格式:
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 Reference Guide。
希望有帮助!