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

Investigate order of Browse by People -> Sort by Count #179

Closed
erinchambers opened this issue Nov 25, 2024 · 3 comments · May be fixed by CDRH/api#146
Closed

Investigate order of Browse by People -> Sort by Count #179

erinchambers opened this issue Nov 25, 2024 · 3 comments · May be fixed by CDRH/api#146
Assignees
Labels
tech_orchid relating to orchid

Comments

@erinchambers
Copy link

On the Browse by People page (https://cdrhrailsdev.unl.edu/family-letters/en/browse/person.name), the default sort Sort by Count (most first) isn't actually in descending numerical order

For example:
Screenshot 2024-11-25 at 3 43 00 PM

Sort by Count (least first) exhibits the same problem, just in reverse.

@erinchambers erinchambers added the tech_orchid relating to orchid label Nov 25, 2024
@wkdewey
Copy link
Contributor

wkdewey commented Dec 2, 2024

It is working for me in my local environment.

@wkdewey
Copy link
Contributor

wkdewey commented Dec 3, 2024

I see now that it is out of order. This is the order that it is coming out of Elasticsearch from the query that says sort by doc_count. There is a discrepancy between counts because of nested aggregations. It is sorting on the base doc_count , but the real count (and the one displayed on the side) is in field_to_item.doc_count and the result is out of order relative to that field.
I would either need to change the query to Elasticsearch or re-sort the items in the API app.

wkdewey added a commit to CDRH/api that referenced this issue Dec 4, 2024
wkdewey added a commit to CDRH/api that referenced this issue Dec 4, 2024
@wkdewey wkdewey linked a pull request Dec 4, 2024 that will close this issue
@wkdewey
Copy link
Contributor

wkdewey commented Dec 4, 2024

I figure out how to change the Elasticsearch query so it sorts nested fields properly, when sorting by count.

@wkdewey wkdewey closed this as completed Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech_orchid relating to orchid
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants