如何在 Elasticsearch 中将 CURL 转换为 URI

How to convert CURL into URI in Elasticsearch

我有一个用于 elasticsearch 聚合的 curl 命令,如下所示。

curl -XGET "http://localhost:9200/employee/_search?search_type=count&pretty" -d '{
  "aggregations": {
    "profile": {
      "terms": {
        "field": "_type"
      },
      "aggs": {
        "hits": {
          "top_hits": {
            "size": 1
          }
        }
      }
    }
  }
}'

我想在浏览器中将上面的 curl 搜索到我的 html 页面中,如何将其转换为正常的 url 就像 elasticsearch 中的 URI 搜索一样?

请帮我把上面的转换成url ?

您可以使用 source query string parameter 以便直接在 URL

中传递正文
curl -XGET 'http://localhost:9200/employee/_search?search_type=count&pretty&source={"aggregations":{"profile":{"terms":{"field":"_type"},"aggs":{"hits":{"top_hits":{"size":1}}}}}}'
                                                                              ^
                                                                              |
                                                           use the source parameter