Repository navigation
Docs search ignores letter case, so search_docs("Mcp") finds the "Agents over MCP" sections instead of nothing - #1432
Open
rudycelekli wants to merge 1 commit into
Open
rudycelekli wants to merge 1 commit into
rudycelekli wants to merge 1 commit into
Conversation
…nts over MCP" sections instead of nothing Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The
search_docstool (in chat and over MCP) searches the built-in Charter docs throughDocsIndex. That index tokenizes with jieba alone, which keeps the original letter case, so a query term only matches if its case matches the markdown. The corpus is English (ingest.md,mcp.md), and the model writes queries in whatever case it likes. Sosearch_docs("Mcp")orsearch_docs("settings")returns nothing, even though the "Agents over MCP" article and its sections say exactly that. The chat then tells the user that Utopia has no docs on the topic.What changes
The docs index registers jieba followed by tantivy's
LowerCaser. The same analyzer is used at query time, so both sides are lowercased.DocsIndexis built in RAM from compile-time markdown at every start, so nothing on disk changes and no reindex is needed. The persistedSearchIndexis untouched.How it was checked
a_query_finds_the_section_whatever_its_letter_case, indexes two sections and expectsMCP client,mcp client,Mcp,settingsandSETTINGSeach to find a hit, withmcpranking the MCP section first andaccess TOKENranking the token section first."Mcp" found nothing.cargo test -p utopia-search: 8 passed.cargo fmt --all --checkandcargo clippy -p utopia-search --all-targets -- -D warningspass.Before review
git commit -s)cargo fmt --all --check,cargo clippyandcargo testpass for the touched crate