Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

search: FTS special characters are deleted, not separated, so leaf(entry) matches nothing

オープン 初心者向け
#2,971 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@kjgggggg がすでに取り組んでいます。

2026年10月28日 から。

  • #2987 @kjgggggg による — オープン

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
88/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
search

調査の方向性

src/db/queries.ts の 2036 行目付近から始めてください。そこでは FTS5 の特殊文字を処理する replace が検索語を組み立てています。まずサンプルファイルに対して codegraph query "leaf(entry)" を実行し、結果が空であることを再現してください。置換先をスペースに変更し、両側がそれぞれ引用符で囲まれた別々の語になるようにしてから、leaf(entry)、leaf^entry、leaf()、そして単純な leaf entry のクエリを再実行し、回帰がないことを確認してください。関数呼び出しのクエリが名前付きシンボルを返し、既存の検索テストが引き続き通れば完了です。

索引モデルが issue の本文から書いたものです。

説明

Full-text search deletes FTS5 special characters instead of turning them into separators, so identifiers on either side of a (, ), ^, :, ", ' or * merge into one token that matches nothing.

// a.ts
export function entry() { mid1(); mid2(); }
export function leaf() { return 1; }
query result on main
codegraph query "leaf entry" entry, leaf ✓
codegraph query "leaf(entry)" No results found
codegraph query "leaf()" leaf ✓ (nothing follows the paren)

The same happens through the library (searchNodes('leaf(entry)'), 'leaf^entry', 'leaf"entry' all return []). The LIKE and fuzzy fallbacks don't recover it.

Cause. db/queries.ts#L2036: .replace(/['"*():^]/g, '') // Remove FTS5 special chars turns leaf(entry) into the single term "leafentry"*.

Reproduced on main at 7973df0d with CODEGRAPH_KERNEL=0. Linux/WSL2, Node 22.23.2.

Why it matters. Agents and people paste call expressions and signatures into search (render(props), getUser(id), Foo::bar(x)), and those come back empty instead of finding the named symbols.

Fix. Replace with a space instead of the empty string (.replace(/['"*():^]/g, ' ')). Each side then becomes its own quoted term.

主要言語
C
スター
73.2k
フォーク
4.7k
平均マージ
3時間 15分
マージ済み PR(30日)
576

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

colbymchenry/codegraph のほかの issue

colbymchenry/codegraph の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。