opensearch-project / query-insights

Query Insights plugin offers frameworks and APIs for analyzing and optimizing query performance in OpenSearch.
Apache License 2.0
7 stars 4 forks source link

Top n queries historical queries from local index and time range #84

Closed LilyCaroline17 closed 1 week ago

LilyCaroline17 commented 2 weeks ago

Description

When the local index exporter is enabled, historical top N queries data is stored there. Previously, obtaining these historical queries required manually searching through each index. To simplify this process for users, we've introduced two parameters: 'from' and 'to', to the top n queries request. This allows users to define the time range for retrieving historical data. Please ensure that from and to are in ISO format.

For example, you could make this following call to retrieve the top N queries from August 25, 2024, at 15:00 UTC to August 30, 2024, at 17:00 UTC. curl -X GET "http://localhost:9200/_insights/top_queries?from=2024-08-25T15:00:00.000Z&to=2024-08-30T17:00:00.000Z"

Issues Resolved

Closes #12

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

deshsidd commented 2 weeks ago

Looks like one of the build is failing please take a look

ansjcy commented 1 week ago

Thanks for making the changes! Overall it looks good to me and I'm merging it now, but we still need to follow up one several things before 2.18 release: