Skip to content

Group search results by collection by default - #1702

Open
jcoyne wants to merge 1 commit into
mainfrom
default-grouped-results
Open

jcoyne wants to merge 1 commit into
mainfrom
default-grouped-results

Conversation

@jcoyne

@jcoyne jcoyne commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Fixes #1488

Search results are now grouped by collection by default. Results are shown ungrouped ("All results") when:

  • the user picks All results (the toggle now sends group=false, so the choice sticks as they page, sort and facet), or
  • the search is limited to a collection (any f[collection] filter, e.g. a This Collection search from a collection or component page).

An explicit group=true still groups results, even inside a collection.

The default applies only to HTML search results (catalog#index), so JSON API responses and other actions that use the search builder (e.g. hierarchy) are unchanged.

Configuration

Implementers who prefer ungrouped results (for example, single-collection sites) can turn this off:

# config/initializers/arclight.rb
Arclight::Engine.config.default_grouped_results = false

Upgrade note

This changes the default for existing applications: searches that don't specify group will now be grouped. Set default_grouped_results = false to keep the previous behavior.

Whether the collection itself should appear among a group's results is left to a separate issue, as discussed on #1488.

Screenshots

Default search — grouped by collection
http://localhost:3000/catalog?q=alpha+omega

Default search grouped by collection

"This Collection" search — all results
http://localhost:3000/catalog?q=alpha+omega&f%5Bcollection%5D%5B%5D=Alpha+Omega+Alpha+Archives%2C+1894-1992

Search within a collection shows all results

User chose "All results"
http://localhost:3000/catalog?q=alpha+omega&group=false

All results chosen

jcoyne added a commit that referenced this pull request Dec 2, 2026
Searches are grouped by collection unless the user chooses "All results"
(group=false) or the search is limited to a collection (e.g. a "This
Collection" search). Set Arclight::Engine.config.default_grouped_results
to false to keep ungrouped results as the default.

Fixes #1488
@jcoyne
jcoyne force-pushed the default-grouped-results branch from 236bf89 to e8225ea Compare December 3, 2026 13:29
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.

Make Grouped by Collection the default view of cross-collection search results

1 participant