opensearch-project / OpenSearch

🔎 Open source distributed and RESTful search engine.
https://opensearch.org/docs/latest/opensearch/index/
Apache License 2.0
9.47k stars 1.74k forks source link

[BUG] Add support for Top Metrics Aggregation #15025

Open jmcclanahan1 opened 1 month ago

jmcclanahan1 commented 1 month ago

What is the bug?

Top Metrics Aggregation Exists in the Java Client, but is not supported by OpenSearch

How can one reproduce the bug?

Create an aggregation query with top metrics aggregation

What is the expected behavior?

Preferably support for this aggregation would be added and work the same as elasticsearch implementation. https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-top-metrics.html

What is your host/environment?

Do you have any screenshots?

none

Do you have any additional context?

Opensearch-java version: 2.11 Opensearch cluster version: 2.11

Error: [parsing_exception] Unknown aggregation type [top_metrics] did you mean [top_hits]?

related: https://github.com/opensearch-project/opensearch-java/issues/420

Workaround

Use top_hits aggregation for now

dblock commented 1 month ago

I moved this issue to the server. In the meantime the client should get rid of this option.

peternied commented 1 month ago

[Triage - attendees 1 2 3 4 5] @jmcclanahan1 Thanks for creating this issue. What do you think about creating a pull request to add support for this feature?

Note; this is likely due to the java client be out of sync with OpenSearch core when it was forked.

jmcclanahan1 commented 1 month ago

@peternied - sure I can take a look when I have some time if no one else is working on this.

peternied commented 1 month ago

@jmcclanahan1 I've assigned this issue to you, thanks for picking it up!

getsaurabh02 commented 1 week ago

@jmcclanahan1 Looks like this is an important feature. I think many people will be interested in having this. Can you help to take this forward?