Skip to content

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

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

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

Conversation

@Themistoklis

Copy link
Copy Markdown

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
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.

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