Skip to content

Support multi-substring search in project selector#22840

Merged
wielinde merged 3 commits into
devfrom
claude/multi-substring-project-search-7n7mH
Apr 22, 2026
Merged

Support multi-substring search in project selector#22840
wielinde merged 3 commits into
devfrom
claude/multi-substring-project-search-7n7mH

Conversation

@wielinde
Copy link
Copy Markdown
Member

@wielinde wielinde commented Apr 20, 2026

I was a bit fed up with the UX of the project selector. I usually search by multiple "gorilla" words and not just by one.

Implementation:

Split the search query on whitespace and require each token to appear
in the project name, so e.g. "big fish" matches "the big beautiful fish"
and "big fi" matches as a partial-word substring.

  • Backend:
    • Differentiate between the "~" and the "**" operator.
    • For the "**" operator generate AND-connected LIKE clauses, one per
      space-separated token, for the ~ and ** operators
  • Frontend:
    • Instead of the name filter use the more flexible/wider typeahead filter with the extended "**" operator (The typeahead filter is currently inheriting from the name filter and I didn't touch that). This will become handy in the future when we likely want to also search for project identifiers, soon.
    • mirror the same logic of splitting the query in multiple terms for the client-side post-filter that removes non-matching ancestors

Closes https://community.openproject.org/work_packages/74199

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 20, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@wielinde wielinde marked this pull request as draft April 20, 2026 20:41
@wielinde wielinde force-pushed the claude/multi-substring-project-search-7n7mH branch from 79e0775 to 6024c23 Compare April 22, 2026 04:43
@wielinde wielinde marked this pull request as ready for review April 22, 2026 05:00
Comment thread app/models/queries/projects/filters/name_filter.rb Outdated
Comment thread spec/features/projects/project_autocomplete_spec.rb
Copy link
Copy Markdown
Contributor

@NobodysNightmare NobodysNightmare left a comment

Choose a reason for hiding this comment

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

While I agree to the high-level approach to reach the given goal, as implemented right now, this would have a higher blast radius, than just the project selector. It would also affect all other places where we filter projects by their name.

I think that separating ~ and ** is the intended way to fix this, so this should be fixable.

Separate the ~ (contains) and ** (everywhere/typeahead) operator paths
in NameFilter: ~ keeps single-substring LIKE behavior for explicit
user-facing filters; ** now splits on whitespace and ANDs all tokens,
enabling multi-term search.

Switch SearchableProjectListService from ['name', '~', ...] to
['typeahead', '**', ...] so the project selector routes through
TypeaheadFilter, which inherits the multi-term ** behavior automatically.
@wielinde wielinde force-pushed the claude/multi-substring-project-search-7n7mH branch from 1712def to 62ac6e8 Compare April 22, 2026 14:20
@wielinde wielinde merged commit 7606b87 into dev Apr 22, 2026
20 checks passed
@wielinde wielinde deleted the claude/multi-substring-project-search-7n7mH branch April 22, 2026 15:23
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants