Skip to content

Commit d4b4db1

Browse files
committed
[API] cat.count now uses the POST method
Starting in Elasticsearch 9.3.0, this endpoint also supports the `POST` method. This is primarily intended for project routing in serverless environments.
1 parent 51e0a25 commit d4b4db1

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

  • elasticsearch-api/lib/elasticsearch/api/actions/cat

elasticsearch-api/lib/elasticsearch/api/actions/cat/count.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ module Actions
2727
# The document count only includes live documents, not deleted documents which have not yet been removed by the merge process.
2828
# IMPORTANT: CAT APIs are only intended for human consumption using the command line or Kibana console.
2929
# They are not intended for use by applications. For application consumption, use the count API.
30+
# NOTE: Starting in Elasticsearch 9.3.0, this endpoint also supports the `POST` method. This is primarily intended for project routing in serverless environments.
3031
#
3132
# @option arguments [String, Array] :index A comma-separated list of data streams, indices, and aliases used to limit the request.
3233
# It supports wildcards (`*`).
@@ -80,12 +81,7 @@ def count(arguments = {})
8081

8182
_index = arguments.delete(:index)
8283

83-
method = if body
84-
Elasticsearch::API::HTTP_POST
85-
else
86-
Elasticsearch::API::HTTP_GET
87-
end
88-
84+
method = Elasticsearch::API::HTTP_POST
8985
path = if _index
9086
"_cat/count/#{Utils.listify(_index)}"
9187
else

0 commit comments

Comments
 (0)