Improve search relevance scoring
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
The search index in crates/core/src/lib.rs (SearchDocument::search, lines ~360-376) is a naive substring matcher that assigns fixed bucket scores (100/75/25) and requires every term to appear via path.contains(term).
Problem
- Fixed bucket scoring (100/75/25) does not reflect actual relevance.
- Every term must appear via
path.contains(term), so partial words and typos never match. split_whitespaceover the raw query (lines ~317-322) produces crude tokens that won't match partial words.
Suggested direction
- Replace fixed buckets with term-frequency / proximity-based scoring.
- Support fuzzy and prefix matching.
- Add proper tokenization (stemming, word-boundary handling) instead of
split_whitespaceover the raw query.
References
crates/core/src/lib.rs—SearchDocument::search(lines ~360-376)crates/core/src/lib.rs— query tokenization (lines ~317-322)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in crates/core/src/lib.rs by reading query tokenization around lines 317-322 and SearchDocument::search around lines 360-376. Trace the current substring and fixed-bucket scoring behavior, then define and validate relevance behavior that covers improved tokenization, prefix or fuzzy matching, and term frequency or proximity instead of requiring exact term presence.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- search
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100