Make fuzzy edit distance and transpositions configurable
メンテナーはふだん 1 日以内に返信
@kylebernhardy がすでに取り組んでいます。
2026年10月30日 から。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- node.js, rust, typescript
調査の方向性
Start by reading ts/native.ts and src/engine.rs at the assessed revision, then trace how query options pass through the packed protocol into native queries and tracing. Use the README wrapper contract and Tantivy’s fuzzy-query capability as references. Done means bounded distance and transposition options work for fuzzy and fuzzy-prefix clauses with consistent validation, preserved defaults, the specified Unicode, ranking, Boolean, and distance tests, and expansion/latency qualification.
索引モデルが issue の本文から書いたものです。
説明
Outcome
Make fuzzy edit distance and transpositions configurable.
Current behavior
Verified by source inspection of the public API and native implementation at the assessed revision; no runtime reproduction was performed. Native fuzzy and fuzzy-prefix queries hardcode edit distance 1 and transpositions enabled. Callers cannot request distance 2 or disable transposition matching.
Acceptance criteria
- Expose bounded edit-distance and transposition options for fuzzy and fuzzy-prefix clauses, preserving current defaults.
- Carry options through TypeScript, packed protocol, native queries, and tracing with consistent validation.
- Test Unicode edits and transpositions, exact-vs-fuzzy ranking, Boolean clauses, and both supported distances.
- Qualify expansion and latency on representative catalogs before promoting fuzzy-prefix beyond its current preview status.
References and scope
Parent: Epic: Extend fulltext search capabilities beyond the initial wrapper API.
Tantivy capability. Wrapper contract. This is proposed standalone-library capability with no committed release. Application-specific authorization, source projection, and product API integration are outside this issue.
Deferred matching-policy scope
Follow-up from Add bounded deep-result traversal and qualify autocomplete limits: continuation does not change edit distance, transpositions or ranking coefficients.
- Qualify exact-versus-fuzzy ranking coefficients and eligibility rules before changing their defaults. Document changes as matching/ranking policy, independently of result-page capacity.
- Measure vocabulary/postings growth and scorer-construction costs; exact-prefix expansion guards do not bound every fuzzy path.
Tantivy 0.27 reuse and query-cost follow-up
Follow-up from Upgrade fulltext to Tantivy 0.27 with safe index rebuilds; code-trace evidence against the reviewed engine, with no isolated performance measurement yet.
- Complete native automaton reuse for full-fuzzy tracing after measuring preparation costs. Fuzzy-prefix reuse is implemented in PR72; preserve current-source policy, UTF-16 spans, truncation and deadlines.
- Benchmark the repeated exact branch used to add the exact-match bonus in fuzzy and fuzzy-prefix queries. It currently composes the same matching query as BM25 and constant-score branches. Preserve score bits and exact-versus-fuzzy ordering; avoid adding a wrapper-owned scorer unless a measured win justifies its maintenance.
- Keep these refactors independent from changing fuzzy defaults or exposing new options. Report allocation/scorer costs separately from end-to-end latency and do not infer a speedup from fewer query objects.
Fuzzy-prefix tracing reuses native matching semantics; full-fuzzy reuse remains deferred following the measurements below. This does not expand this issue's release commitment.
Fixed fuzzy score contract
The planning review for Upgrade fulltext to Tantivy 0.27 with safe index rebuilds retained the explicit ConstScoreQuery layer. Although the pinned fuzzy scorer already returns a constant, removing that layer would make the wrapper's ranking contract depend on an upstream implementation detail.
- If revisiting this simplification, pin the authoritative constant-score contract with regression assertions across boosts, prefix/non-prefix modes and engine upgrades. Preserve score bits and continuation ordering; compare latency before accepting additional upstream coupling.
Native matching reuse: measured safe scope
Implemented in Upgrade fulltext to Tantivy 0.27 with safe index rebuilds: lazy Tantivy automata replace the fuzzy-prefix predicate. Exact prefixes avoid DFA construction. Eligibility, UTF-16 spans, current-source matching, deadlines and constant scores retain their existing behavior. The direct exact tantivy-fst dependency already existed transitively; lockstep upgrades are documented. No global cache or public API expansion is introduced.
Full-fuzzy native reuse was implemented and measured, then reverted before pushing: sixteen inflected query terms against twenty near-length source tokens increased median p50 from 0.0554 to 0.1874ms across three paired optimized macOS arm64 runs. This exceeded the preset threshold of both 10% and 0.1ms. The original allocation-free full-fuzzy predicate remains guarded by native dictionary parity checks. The retained eight-case driver covers actual prefix edits, preparation-heavy requests and first-call metadata.
For the final prefix-only scope, the corresponding full-fuzzy control was 0.0563→0.0568ms; small prefix requests were 0.0163→0.0213ms, and sixteen-term/10,000-token prefix requests were 2.4623→1.9810ms. These synthetic local measurements do not establish production or isolated Linux improvements. Fresh platform qualification remains pending.
- Revisit full-fuzzy native reuse only after acceptable short, many-term preparation cost is demonstrated without disproportionate caching or routing complexity.
- Public distance/transposition options and exact-bonus scorer simplification retain the existing acceptance criteria above.
Query-control review follow-up
Keep the existing four-character fuzzy-prefix minimum and native fuzzy dictionary traversal. At distance two this can match two-character prefix roots; the 50-term exact-prefix expansion cap does not bound the fuzzy branch at either distance. A finite 32,000-term reachable-dictionary profile passed correctness, latency, memory and timeout recovery, but does not qualify arbitrary corpus breadth or Linux deployment headroom. Fuzzy-prefix remains preview. Revisit eligibility or native expansion admission only with production-oriented workload evidence; preserve requested native semantics and source-trace parity.
Review-Deferral: 01438370a04a4d63 severity=minor category=performance
Comment generated by kAIle (GPT-6)
- 主要言語
- Rust
- スター
- 3
- フォーク
- 0
- 平均マージ
- 15時間 12分
- マージ済み PR(30日)
- 11
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
HarperFast/fulltext のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
HarperFast/fulltext#76 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
HarperFast/fulltext#74 ·
メンテナーはふだん 1 日以内に返信
-
Qualify Tantivy pruning for small-window ordinary ANY searches対応中かも @kylebernhardy が 9 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
HarperFast/fulltext#73 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Qualify Tantivy 0.27 upgrade and enforce the analyzer rebuild boundary対応中かも @kylebernhardy が 14 日前に担当しました。 オープンdependencies
HarperFast/fulltext#71 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Expose trace progress and per-record truncation for bounded highlight recovery対応中かも @kylebernhardy が 6 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
HarperFast/fulltext#68 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
HarperFast/fulltext の issue をすべて見る
似ている issue
-
area: cli kind:docs priority: P3
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
swc-project/swc-ai-issues#164 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
pop-os/cosmic-player#367 ·
-
good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
servo/rust-smallvec#873 ·