Skip to content

Handle team filters for empty search - #489

Merged
rbjornstad merged 1 commit into
mainfrom
search-empty-team-filter
Jul 3, 2026
Merged

Handle team filters for empty search#489
rbjornstad merged 1 commit into
mainfrom
search-empty-team-filter

Conversation

@rbjornstad

Copy link
Copy Markdown
Contributor

Summary

  • use explicit filter.teams as the scope for empty search queries
  • keep user-team defaults only when no team filter is provided
  • preserve blank-search kind ranking for explicit team-scoped searches
  • add focused tests for team-scoped empty search, type filtering, and ranking

Testing

  • rtk go test ./internal/search
  • rtk mise run test:unit
  • rtk mise run fmt

@rbjornstad
rbjornstad requested a review from a team as a code owner July 3, 2026 12:05
@rbjornstad
rbjornstad requested a review from Copilot July 3, 2026 12:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request adjusts the Bleve-backed search behavior so that empty search queries use an explicit filter.teams scope when provided, while still falling back to the user’s team defaults when no team filter is given. This fits the internal/search package’s responsibility for shaping query semantics and ranking before converting hits into GraphQL nodes.

Changes:

  • Change empty-query behavior to scope results by filter.Teams when provided; otherwise use the user’s team slugs (and return empty when neither exists).
  • Preserve empty-query kind boosting (TEAM before APPLICATION/JOB/…) for explicit team-scoped searches.
  • Add focused unit tests covering explicit team scope for empty search, type filtering, and ranking.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
internal/search/bleve.go Updates empty-query scoping logic and factors team filtering into a helper disjunction query.
internal/search/bleve_test.go Adds unit tests for team-scoped empty search behavior, type filtering, and ranking order.

@rbjornstad
rbjornstad merged commit 4ab2a02 into main Jul 3, 2026
12 checks passed
@rbjornstad
rbjornstad deleted the search-empty-team-filter branch July 3, 2026 12:17
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