Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

De-normalization of facets with nested bucket aggregations #150

Open
wkdewey opened this issue Dec 9, 2024 · 1 comment
Open

De-normalization of facets with nested bucket aggregations #150

wkdewey opened this issue Dec 9, 2024 · 1 comment
Assignees
Labels

Comments

@wkdewey
Copy link
Contributor

wkdewey commented Dec 9, 2024

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.

@wkdewey wkdewey self-assigned this Dec 9, 2024
@wkdewey wkdewey added the bug label Dec 9, 2024
@wkdewey
Copy link
Contributor Author

wkdewey commented Dec 9, 2024

In fact, if I use the original field as the aggregation_name, the code works as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant