Skip to content

Document --fts query DSL operators in help and tool description #1844

Description

@Widthdom

Summary

--fts mode passes the user's query unchanged to FTS5, exposing the full DSL: column filters (title:foo), NEAR(...), OR, NOT, prefix *, parenthesized groups. None of this is mentioned in --help or the search tool description (ConsoleUi.cs:398, QueryCommandRunner.cs:3137). Users only discover the available syntax when they hit a "syntax error" path (cross-link #187 which complains about the error message). The complementary issue: when --fts is not set, the same operators may or may not pass through depending on sanitization — also undocumented.

Where

  • src/CodeIndex/Cli/ConsoleUi.cs:398 (search help text)
  • src/CodeIndex/Cli/QueryCommandRunner.cs:3137 (--fts handler)

Suggested approach

(1) Expand the --fts help text to enumerate the exposed operators with one example each: column:term, NEAR(a b, 5), term1 OR term2, term1 NOT term2, prefix*, "phrase". (2) Document the relationship between --fts (raw passthrough), default mode (implicit-AND, cross-link the just-filed #466), and --regex if it exists. (3) Mirror the operator list into the search MCP tool description (cross-link the just-filed #1810). (4) When a --fts query fails parsing, surface a syntax-error hint with link to the docs (cross-link #187). (5) Add a regression test that drives each documented operator and asserts non-error response. (6) Document under "Search query syntax" in USER_GUIDE.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions