Skip to content

Add "took" attribute to SearchHits/ReactiveSearchHits #2986

@ELHARROUGUI

Description

@ELHARROUGUI

I am working on a Spring API that integrates with Elasticsearch, and my current task involves migrating from the Elasticsearch Java API Client to Spring Data Elasticsearch. While doing so, I noticed that the response body in the Elasticsearch Java API Client includes a valuable attribute called "took", which shows the time (in milliseconds) it took to complete the request. However, this attribute is not accessible in the SearchHits (or ReactiveSearchHits) body in Spring Data Elasticsearch.

This feature is important for performance monitoring and debugging, as it allows developers to measure the responsiveness of Elasticsearch queries.

I propose adding support for retrieving the "took" attribute from SearchHits objects in Spring Data Elasticsearch, ensuring feature parity with the Elasticsearch Java API Client. This enhancement would improve the developer experience by providing essential timing information for queries.

I would be happy to contribute to this feature by submitting a PR if accepted. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions