Skip to content

feat(pass): upgrade search with field weighting and match quality - #518

Open
Themistoklis wants to merge 3455 commits into
ProtonMail:mainfrom
Themistoklis:pass-search-upgrade
Open

feat(pass): upgrade search with field weighting and match quality#518
Themistoklis wants to merge 3455 commits into
ProtonMail:mainfrom
Themistoklis:pass-search-upgrade

Conversation

@Themistoklis

Copy link
Copy Markdown
Contributor

Description

Replaced the Boolean item search with a weighted relevance score, so the item you actually meant ranks first instead of every item that merely contains the term.

Each match scores as $fieldWeight * matchQuality$:
Field weight (which field matched): title > primary (login email/username, alias address, cardholder name) > url > everything else (notes, content & extra fields). The title sits far above the rest, so a title match always wins. Fixes, e.g., searching for protonmail surfacing every account using a protonmail address before the one named Protonmail.

Match quality (where the needle lands): exact > prefix > word-prefix > substring.

Results sort by score, and ties fall back to the selected sort drop-down (recent, title, …). Match semantics unchanged (every needle must match at least one field).

@D-Bao

D-Bao commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR!
Some UX issues/suggestions:
With this, the search results will no longer respect the sort order so users won't be able to sort the results by date etc, and the search will no longer be consistent with our mobile apps. Instead, could you scope this search upgrade to only apply when a new Relevant sort option is selected in the dropdown below? It can be selected by default:
image
And then the date sections "Today", "Last month" etc can be hidden when a Relevant search is selected, similar to how selecting "Alphabetical" will remove those date labels.

@Themistoklis

Copy link
Copy Markdown
Contributor Author

@D-Bao thanks for the feedback.

I addressed it all in the latest push.

  • Added a new Relevant sort option in the dropdown, set as the default. The relevance ranking now only applies when Relevant is selected;
  • Date sections ("Today", "Last month", …) are now hidden during a Relevant search, same as Alphabetical. While browsing with no search term, Relevant falls back to recency, so the date sections still show.

MargeBot and others added 28 commits July 7, 2026 09:02
Account: switch to first tab with validation error in Modal with tabs

See merge request web/clients!26202
Temporarily ignore echarts vulnerability

See merge request web/clients!26210
feat(mail): add sentry tracking for mailbox redirects

See merge request web/clients!26208
feat(mail): fetch category beta flag in bootstrap

See merge request web/clients!26211
Remove TransactionsView feature flag

See merge request web/clients!26183
Remove tgz

See merge request web/clients!26218
MEET-1217: adding waiting room UI to schedule meeting form

See merge request web/clients!26148
[IDTEAM-6294] Fix TotpInput overflow caused by decoupled margin and inputWidth calculation

See merge request web/clients!26181
Select all category view label fix

See merge request web/clients!24961
Sheets: use editor bridge for feature flags

See merge request web/clients!26219
Update Mail plus/Unlimited 12M renewal price

See merge request web/clients!26165
Add waiting room functions to Meet Core Client

See merge request web/clients!26122
Add recording support for safari 17

See merge request web/clients!26166
MargeBot and others added 7 commits July 9, 2026 14:34
Add recording telemetry

See merge request web/clients!26312
Add setting menu to app switcher

See merge request web/clients!26309
Update app switcher in signup flow to use localID

See merge request web/clients!26316
Update direct share report abuse icon

See merge request web/clients!26249
Comment thread packages/pass/components/Item/Filters/Sort.tsx
Comment thread packages/pass/lib/items/item.utils.ts Outdated
Comment thread packages/pass/lib/search/match-items.ts Outdated
@Themistoklis
Themistoklis force-pushed the pass-search-upgrade branch from 7a82011 to 93d7fc5 Compare July 9, 2026 20:53
Comment thread packages/pass/components/Item/Filters/Sort.tsx Outdated
@Themistoklis
Themistoklis requested a review from D-Bao July 10, 2026 09:26
Comment thread packages/pass/components/Item/Filters/Sort.tsx Outdated
@Themistoklis
Themistoklis requested a review from D-Bao July 10, 2026 12:41
@D-Bao

D-Bao commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

All your commits were merged on main. Thanks a lot for your contribution! 🚀

@mmso
mmso force-pushed the main branch 9 times, most recently from 6e496e5 to bfa5069 Compare July 31, 2026 08:17
@mmso
mmso force-pushed the main branch 2 times, most recently from 896ff9e to 06694ac Compare August 5, 2026 16:22
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.