opensearch-project / opensearch-py

Python Client for OpenSearch
https://opensearch.org/docs/latest/clients/python/
Apache License 2.0
338 stars 170 forks source link

Add MultiTerms Aggregation #663

Closed mckirk closed 1 month ago

mckirk commented 8 months ago

Description

This change makes it possible to use the multi_terms bucket aggregation, using the syntax

aggs.MultiTerms(terms=[{"field": "tags"}, {"field": "author.row"}])

It is similar to PR#1543 from the elasticsearch-dsl-py repo. I hope that is okay, since that project is also licensed under Apache 2.0.

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.

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 72.15%. Comparing base (d905bef) to head (22a970c). Report is 64 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #663 +/- ## ======================================= Coverage 72.14% 72.15% ======================================= Files 89 89 Lines 7945 7947 +2 ======================================= + Hits 5732 5734 +2 Misses 2213 2213 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

dblock commented 8 months ago

How does one use it? Maybe add to guides/ ?

saimedhi commented 6 months ago

Hello @mckirk, could you please implement the requested changes? Thank you!

dblock commented 1 month ago

Rebased in https://github.com/opensearch-project/opensearch-py/pull/797.