Skip to content

SCRUM-6682 reorder literature facets and list years newest first - #1680

Merged
oblodgett merged 1 commit into
stagefrom
SCRUM-6682
Oct 20, 2026
Merged

oblodgett merged 1 commit into
stagefrom
SCRUM-6682

Conversation

@oblodgett

Copy link
Copy Markdown
Member

Summary

  • Literature search facets now appear in the order curators asked for: Year, Journal (resourceTitle), Author, Reference Type.
  • Year facet values are sorted newest first (terms aggregation ordered by key, descending) instead of by count.

On stage ES, publicationYear has 220 distinct values, all 4-digit years, so ordering by key is chronological and all of them fit within the facet's 999-bucket size.

The UI part of the ticket (turning off the facet search box) is alliance-genome/agr_ui#1931.

Testing

  • agr_api compiles and its unit tests pass (10 tests)
  • No existing test covers the literature facets

@oblodgett
oblodgett requested a review from a team as a code owner October 20, 2026 17:16
@claude

claude Bot commented Oct 20, 2026

Copy link
Copy Markdown

Reviewed the change to SearchHelper. It looks correct and I found no blocking issues.

  • Reordering the literature facets only changes the order of the aggregations and of the facets returned for the LITERATURE category. Filtering and the aggregation names stay the same, so the API contract doesn't change.
  • BucketOrder.key(false) on publicationYear.keyword sorts years lexicographically in descending order. That gives the right result for 4-digit year strings. A year stored with a different width or format would sort out of place, which is unlikely for this data.
  • With size(999), sorting by key instead of by count means that if there were ever more than 999 distinct years, the oldest years would be dropped rather than the least common ones. This doesn't matter in practice.

No performance or security concerns.

@oblodgett
oblodgett merged commit 7252d2e into stage Oct 20, 2026
5 checks passed
@oblodgett
oblodgett deleted the SCRUM-6682 branch October 20, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants