Skip to content

DLSR-285: change preferred title sort field to sort_title_ssort#1226

Merged
sourcefilter merged 2 commits into
mainfrom
DLSR-285/title_sort_field
May 29, 2026
Merged

DLSR-285: change preferred title sort field to sort_title_ssort#1226
sourcefilter merged 2 commits into
mainfrom
DLSR-285/title_sort_field

Conversation

@sourcefilter

Copy link
Copy Markdown
Member

Leaves a fallback sort by title_alpha_numeric_ssort, so current functionality will remain until solr config is updated and index is reindexed.

Sorting by exists(field_name) asc before sorting by the field itself ensures that records where the field is empty fall to the back. (Otherwise, they would come first in the descending search).

leaves a fallback sort by title_alpha_numeric_ssort, so current functionality will remain while updating solr config and reindexing. Sort first by whether each field exists to ensure that records where the field is not populated fall to the back.
@sourcefilter sourcefilter requested a review from akohler May 29, 2026 19:48
@sourcefilter sourcefilter changed the title change preferred title sort field to sort_title_ssort DLSR-285: change preferred title sort field to sort_title_ssort May 29, 2026
akohler
akohler previously approved these changes May 29, 2026

@akohler akohler left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sourcefilter Makes sense, approved. Checks are still running so I'll leave this for you to merge & deploy when all is ready.
Thanks --Andy

@akohler

akohler commented May 29, 2026

Copy link
Copy Markdown
Member

@sourcefilter I see the rspec check failed, in a way related to this change. Probably the test should be updated?

Failures:

  1) CatalogController sort fields has exactly expected sort fields
     Failure/Error: expect(sort_fields).to contain_exactly(*expected_sort_fields)

       expected collection contained:  ["date_dtsort asc", "date_dtsort desc", "score desc", "title_alpha_numeric_ssort asc", "title_alpha_numeric_ssort desc"]
       actual collection contained:    ["date_dtsort asc", "date_dtsort desc", "exists(sort_title_ssort) asc, sort_title_ssort  desc, exists...itle_ssort asc, exists(title_alpha_numeric_ssort) asc, title_alpha_numeric_ssort asc", "score desc"]
       the missing elements were:      ["title_alpha_numeric_ssort asc", "title_alpha_numeric_ssort desc"]
       the extra elements were:        ["exists(sort_title_ssort) asc, sort_title_ssort  desc, exists(title_alpha_numeric_ssort) asc, title_...t) asc, sort_title_ssort asc, exists(title_alpha_numeric_ssort) asc, title_alpha_numeric_ssort asc"]
     # ./spec/controllers/catalog_controller_spec.rb:237:in `block (3 levels) in <top (required)>'
     # /usr/local/bundle/ruby/2.7.0/gems/webmock-3.14.0/lib/webmock/rspec.rb:37:in `block (2 levels) in <top (required)>'

@akohler akohler left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All checks are passing now, feel free to merge & deploy. Thanks --Andy

@sourcefilter sourcefilter merged commit 9ebd906 into main May 29, 2026
5 checks passed
@sourcefilter sourcefilter deleted the DLSR-285/title_sort_field branch May 29, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants