【发布时间】:2019-09-05 16:01:55
【问题描述】:
在ElasticSearch document 中,它解释了如何提交查询:
GET /_search
{
"query": {
"match" : {
"message" : "this is a test"
}
}
}
但是 GET 没有正文,它只是获取文档的链接。
文档中的相关CURL:
curl -X GET "localhost:9200/_search" -H 'Content-Type: application/json' -d'
{
"query": {
"match" : {
"message" : "this is a test"
}
}
}
'
如果我在 CURL 文档中阅读 -d 的含义,它会说
-d,--数据
(HTTP) 将 POST 请求中的指定数据发送到 HTTP 服务器, 就像浏览器在用户填写 HTML 时所做的一样 表单并按下提交按钮。
意思是 GET 应该转换为 POST?我很困惑,我需要从 Java 程序向 ElasticSearch 引擎提交 GET 或 POST 吗?
【问题讨论】:
-
这个答案也可能有帮助:stackoverflow.com/questions/34795053/…
标签: java http elasticsearch