wellcomecollection / catalogue-api

:crystal_ball: The API for searching the Wellcome Collection catalogue.
https://developers.wellcomecollection.org
MIT License
4 stars 0 forks source link

limit self aggregation to filter value list size #713

Closed paul-butcher closed 12 months ago

paul-butcher commented 12 months ago

Placing in a PR in case it does turn out to be useful.

This PR implements https://github.com/wellcomecollection/catalogue-api/issues/712

However, AFAICT, it doesn't make a noticeable difference to performance, and introduces a possible source of error (where the self agg should return more buckets than the filter value count due to terms with different ids but same label). So I'm not going to merge it.