Repository navigation
docs(mcp): recommend quoted Lucene values for exact matches and bare terms for body text #3548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
efa31bc
b2db875
d70c51f
afdf4b4
22bdba7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| '@hyperdx/api': patch | ||
| --- | ||
|
|
||
| docs: MCP tool descriptions and the query guide now recommend the quoted Lucene | ||
| form `field:"value"` for exact matches, and bare terms or phrases for log body | ||
| text, so agents keep the primary key and the text index |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,14 @@ const WHERE_DESCRIPTION = | |
| 'WRONG: level = "error" (SQL syntax with whereLanguage:"lucene")\n\n' + | ||
| 'SUBSTRING TRAP: Lucene field:value matches ANY row containing "value" as a substring, not exact equality.\n' + | ||
| ' SpanKind:Server matches "Server", "ServerStreaming", "InternalServer", etc.\n' + | ||
| " For exact match, use SQL: SpanKind = 'Server'"; | ||
| ' For exact match, quote the value: SpanKind:"Server" (compiles to a case-sensitive =, so a sort-key\n' + | ||
| " column such as ServiceName can use the primary key), or use SQL: SpanKind = 'Server'\n\n" + | ||
| 'BODY TEXT: write the term or phrase without a field name, e.g. timeout or "connection refused".\n' + | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 major — Bare-term advice drops substring matches that Body LIKE/Body:term returned, and the docs don't say so Say that a bare term matches whole tokens. In Nothing blocks merge automatically, but a maintainer will expect this fixed if it is a real defect in code this PR changes. If it is about surrounding code, reply and say so instead of patching. Do not widen the PR. How to respond |
||
| " That searches the source's default search column (the body for logs) and uses its text index\n" + | ||
| ' when the source has one. With an index it matches whole tokens: timeout does not match ConnectionTimeoutException.\n' + | ||
| " For a substring inside a word, use SQL ILIKE '%timeout%' (reads the whole column).\n" + | ||
| ' Body:timeout, Body LIKE and Body ILIKE read the whole column, and Body:"..." is exact equality on the\n' + | ||
| ' whole body.'; | ||
|
|
||
| const WHERE_LANGUAGE_DESCRIPTION = | ||
| 'Language of the "where" filter. The syntax in "where" MUST match this setting.\n' + | ||
|
|
@@ -30,7 +37,8 @@ const WHERE_LANGUAGE_DESCRIPTION = | |
| 'and map attributes via dot notation. Use "sql" for IN(...) lists, complex expressions, or function calls.\n' + | ||
| 'IMPORTANT: Lucene field:value is a SUBSTRING match (ilike), not exact equality. ' + | ||
| 'field:val* is prefix-within-substring, not a true prefix match. ' + | ||
| "For exact matching or reliable wildcards, use SQL: WHERE field = 'value' or WHERE field LIKE 'val%'.\n\n" + | ||
| 'For exact matching, quote the value (field:"value", case-sensitive) or use SQL: WHERE field = \'value\'. ' + | ||
| "For reliable wildcards, use SQL: WHERE field LIKE 'val%'.\n\n" + | ||
| 'Common mistake: writing Column:value (Lucene) but setting whereLanguage to "sql". ' + | ||
| 'If your filter uses colon syntax, use "lucene".'; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔵 minor — The new heading "For true prefix/suffix/contains patterns, use SQL instead" sits above a list that still starts with
Exact:Either move the
Exact: SpanKind = 'Server'line next to the new quoted-Lucene paragraph above it, or change the heading back to "For exact matching or true prefix/suffix/contains patterns, use SQL". As written, the heading and the first example disagree.Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond