Make language aggregations a separate Elasticsearch call

Summary

Currently the Elasticsearch blobs scope search includes a language aggregation that is returned with the search results. The aggregation needs to be refactored to be a separate call to Elasticsearch because when search is filtered by a language the aggregations returned also change. The new Elasticsearch query to return aggregations needs to ignore the language filter

Improvements

This will allow the UI to function as intended. Language facets will be presented to the user as a multi-select checkbox and the user will be able to select multiple languages which then filter the results down to include only those languages selected.

Risks

This feature is not released and is behind an off by default feature flag.

This is an initial iteration which combines two Elasticsearch calls when a blobs scoped search is run. This could increase search response times. A second iteration would be to make this a separate internal endpoint for the frontend to consume (issue will be opened to do so).

Involved components

the blob_aggregations within GitClassProxy should be modified to make a new Elasticsearch call which ignores the language filter selected

Optional: Intended side effects

The way this is currently implemented, the UI will show language facets available which will be reduced every time a language is selected to that language. It may be impossible to select more than one language at a time (which is the intent of the feature).

Edited by Terri Chu