fix(search): honor filters and history options - #28
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b09339345c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aaad6f068c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| drop(existing); | ||
| std::fs::remove_dir_all(index_path)?; | ||
| std::fs::create_dir_all(index_path)?; | ||
| Index::create_in_dir(index_path, schema.clone())? |
There was a problem hiding this comment.
Reindex after replacing the legacy schema
When an existing installation first runs the CLI search command after upgrading, CodeIndex::open_or_create deletes the populated legacy index and creates an empty one, but cmd_search immediately searches it without calling index_project. The command therefore reports no results and leaves the user without an index until they manually run reindex; rebuild or migrate the documents before returning the new index.
Useful? React with 👍 / 👎.
| if let Some(path) = normalized_path.as_deref().filter(|path| !path.is_empty()) { | ||
| let pattern = format!(r"{}(/.*)?", regex::escape(path)); | ||
| clauses.push(( | ||
| Occur::Must, | ||
| Box::new(RegexQuery::from_pattern(&pattern, self.schema.path_exact)?), |
There was a problem hiding this comment.
Normalize indexed paths before applying path filters
On Windows, walker::index_project stores relative paths produced by Path::to_string_lossy(), which use backslashes, while normalize_path_filter converts every filter to forward slashes and this regex only matches / separators. Consequently any non-empty MCP path filter returns no matches on Windows; normalize the stored path_exact value to the same separator convention before indexing.
Useful? React with 👍 / 👎.
Summary
pathandlanguagesearch filtersinclude_git_historyby showing the three newest commits for each match--languageoption and correct the documented MCP argumentsWhy
These public options were accepted but silently ignored, so callers received unfiltered results and no requested history.
Verification
cargo fmt --all -- --checkcargo clippy -- -D warningscargo test(all pass; one pre-existing ignored semantic-search test)npm run check