Search Filter Count
Case 1:
Use aggregation in the search query similar to booking.com: https://www.booking.com/city/id/jakarta.id.html This method can't apply to our current filter logic, which selects filters within a tag group (e.g. cuisine) using OR logic. This works great when all filters are using AND logic, similar to booking.com. Conclusion: Unless we change the filter logic to AND, it's not applicable.
Branch:
[
github.com
https://github.com/hungryhub-team/hh-search/tree/feat/opensearch-filter-count-v1
](https://github.com/hungryhub-team/hh-search/tree/feat/opensearch-filter-count-v1)
[
github.com
https://github.com/hungryhub-team/hh-pegasus/tree/feat/filter-count-v1
](https://github.com/hungryhub-team/hh-pegasus/tree/feat/filter-count-v1)
Status: FAILED
Case 2:
Use a different query to aggregate the filter count based on search parameters (keyword, filter, etc.). This works but adds a little complexity to our codebase.
Commits:
[
github.com
https://github.com/hungryhub-team/hh-search/commit/9212d07d1a7b7ec4bf18b7317b9361f8c9a82719
](https://github.com/hungryhub-team/hh-search/commit/9212d07d1a7b7ec4bf18b7317b9361f8c9a82719)
[
github.com
https://github.com/hungryhub-team/hh-pegasus/commit/9b14e6fd990f8aa849083b3e86c45a8ab0fcad5c
](https://github.com/hungryhub-team/hh-pegasus/commit/9b14e6fd990f8aa849083b3e86c45a8ab0fcad5c)
Status: SUCCESS
I have searched around the internet, but it seems this is the only way I have found. Please let me know if you have a better solution for this.