Skip to content Skip to sidebar Skip to footer

How To Convert Curl Into Uri In Elasticsearch

I have a curl command for elasticsearch aggregation as below. curl -XGET 'http://localhost:9200/employee/_search?search_type=count&pretty' -d '{ 'aggregations': { 'profil

Solution 1:

You can use the source query string parameter in order to pass the body directly in the 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

Post a Comment for "How To Convert Curl Into Uri In Elasticsearch"