Skip to content

Fix general search bar not restricting to current space#1315

Open
fbacall wants to merge 1 commit into
masterfrom
fix-space-search
Open

Fix general search bar not restricting to current space#1315
fbacall wants to merge 1 commit into
masterfrom
fix-space-search

Conversation

@fbacall
Copy link
Copy Markdown
Member

@fbacall fbacall commented Jun 3, 2026

Summary of changes

  • Scopes the general search to the current space (if spaces enabled)

Motivation and context

It was returning results from all spaces.

Checklist

  • I have read and followed the CONTRIBUTING guide.
  • I confirm that I have the authority necessary to make this contribution on behalf of its copyright owner and agree to license it to the TeSS codebase under the BSD license.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the general /search (SearchController#index) to scope “general search bar” Solr queries to the current space when the spaces feature is enabled, preventing cross-space results from appearing unintentionally.

Changes:

  • Apply the existing Facets.across_all_spaces Solr constraint (defaulting to “current space only”) within general search queries.
  • Gate the constraint behind Facets.applicable? so it only affects models that are space-associated when spaces are enabled.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +16 to +18
if Facets.applicable?(:across_all_spaces, model)
Facets.across_all_spaces(self, false, current_user)
end
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