Skip to content

Implement stats parameter for count queries #67528

@anti-social

Description

@anti-social

Search API has stats parameter:

(Optional, string) Specific tag of the request for logging and statistical purposes.

It would be nice to have the same parameter for Count API.

At the moment a bad request error is returned:

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "request [/test_index/_count] contains unrecognized parameter: [stats]"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "request [/test_index/_count] contains unrecognized parameter: [stats]"
  },
  "status": 400
}

As I understand statistics for count queries goes to common search statistics. Think it will be logical to be able to tag count queries.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions