gszr / gszr/ChatNotes

Improve search relevance scoring

Open
#5 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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_whitespace over 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_whitespace over the raw query.
References
  • crates/core/src/lib.rsSearchDocument::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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.