Skip to content

Keep non-English query terms searchable - #964

Merged
safishamsi merged 1 commit into
Graphify-Labs:v8from
candy-Tong:fix/query-non-english-short-terms
May 22, 2026
Merged

safishamsi merged 1 commit into
Graphify-Labs:v8from
candy-Tong:fix/query-non-english-short-terms

Conversation

@candy-Tong

Copy link
Copy Markdown
Contributor

Summary

  • Centralize graph query tokenization in _query_terms
  • Keep pure-English short-token filtering for noise like to / of
  • Preserve non-English and mixed tokens such as 前端, 依赖, 安装, and a前
  • Reuse the same query-term helper in benchmark query simulation

Fixes #962

Tests

  • uv run --with pytest pytest tests/test_serve.py tests/test_query_cli.py tests/test_benchmark.py
  • graphify update .

Graph queries filtered every token with len > 2, which dropped common two-character Chinese search terms while trying to suppress short English noise. Centralize query token selection and apply the length gate only to pure-English tokens so mixed or non-English terms remain searchable.

Constraint: Issue Graphify-Labs#962 reports space-separated Chinese query terms such as 前端, 依赖, and 安装 are lost by graphify query.

Rejected: Add Chinese segmentation now | the reported failure is fixed by preserving existing space-separated non-English tokens without expanding query behavior.

Confidence: high

Scope-risk: narrow

Directive: Keep CLI, MCP query, and benchmark query tokenization on one helper when changing query-term rules.

Tested: uv run --with pytest pytest tests/test_serve.py tests/test_query_cli.py tests/test_benchmark.py

Tested: graphify update .

Not-tested: Full test suite.

Co-authored-by: OmX <[email protected]>
@safishamsi
safishamsi merged commit 020cca2 into Graphify-Labs:v8 May 22, 2026
PerryLin-0420 pushed a commit to PerryLin-0420/graphify-decouple that referenced this pull request Aug 13, 2026
Graph queries filtered every token with len > 2, which dropped common two-character Chinese search terms while trying to suppress short English noise. Centralize query token selection and apply the length gate only to pure-English tokens so mixed or non-English terms remain searchable.

Constraint: Issue Graphify-Labs#962 reports space-separated Chinese query terms such as 前端, 依赖, and 安装 are lost by graphify query.

Rejected: Add Chinese segmentation now | the reported failure is fixed by preserving existing space-separated non-English tokens without expanding query behavior.

Confidence: high

Scope-risk: narrow

Directive: Keep CLI, MCP query, and benchmark query tokenization on one helper when changing query-term rules.

Tested: uv run --with pytest pytest tests/test_serve.py tests/test_query_cli.py tests/test_benchmark.py

Tested: graphify update .

Not-tested: Full test suite.

Co-authored-by: OmX <[email protected]>
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.

Is graphify will filter string that length < 2?

2 participants