Skip to content

De-normalization of facets with nested bucket aggregations #150

@wkdewey

Description

@wkdewey

So, under the new API setup and new version of ES, the ES facet result contains a normalized key, and a set of non-normalized values (with capitalization, punctuation, etc which we might want to show in the facets). The find_source_from_top_hits method in app/services/search_item_res.rb, tries to match up this value. In the case of the nested bucket aggregations, (finding a nested value, filtered on a different nested value), the code doesn't know how to search for the proper value. We create an arbitrary aggregation name for the sake of the Elasticsearch query, but this can't be used to find under which key the _source can be found. Although looking at the result from ES, the result is there so there
One possibility is to use the field we are searching as the aggregation_name, for instance spatial.title. I believed that this wouldn't work, but it seems that it does. It may require changing some existing code in repos that used this functionality.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions