Skip to content

Change ES aggregations to use terms type

Terri Chu requested to merge 365052-switch-es-aggregations-to-terms into master

What does this MR do and why?

Related to #365052 (closed)

Note: this feature is behind a disabled by default search_blobs_language_aggregation feature flag and is not currently implemented in the frontend (yet)

  • Refactor type of Elasticsearch aggregation used to terms aggregation
  • Refactor existing specs to support returned json format

Screenshots or screen recordings

old - composite aggregation json response

note: not sorted by count

drawing
new - terms aggregation json response

note: sorted by count desc

drawing

How to set up and validate locally

  1. make sure gdk is setup with elasticsearch enabled and advanced search setup
  2. enable the feature flag: Feature.enable(:search_blobs_language_aggregation)
  3. hit the new endpoint: http://gdk.test:3000/search/aggregations?scope=blobs&search=*
  4. verify it comes back with json

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Terri Chu

Merge request reports

Loading