Skip to content

fix(search): honor filters and history options - #28

Merged
mstuart merged 2 commits into
mainfrom
fix/search-filters-history
Sep 25, 2026
Merged

mstuart merged 2 commits into
mainfrom
fix/search-filters-history

Conversation

@mstuart

@mstuart mstuart commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • honor the MCP path and language search filters
  • honor include_git_history by showing the three newest commits for each match
  • apply the existing CLI --language option and correct the documented MCP arguments

Why

These public options were accepted but silently ignored, so callers received unfiltered results and no requested history.

Verification

  • cargo fmt --all -- --check
  • cargo clippy -- -D warnings
  • cargo test (all pass; one pre-existing ignored semantic-search test)
  • npm run check
  • live MCP JSON-RPC call with path, language, and history options

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-25T22:27:11.463655Z aaad6f0 New commits
🔒 Security Review ✅ Completed 2026-09-25T22:18:37.508343Z b093393 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/mcp/tools.rs Outdated
Comment thread src/search/fulltext.rs Outdated
Comment thread src/mcp/tools.rs Outdated
@mstuart
mstuart merged commit 7e8363f into main Sep 25, 2026
3 checks passed
@mstuart
mstuart deleted the fix/search-filters-history branch September 25, 2026 22:27

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/indexer/code_index.rs
Comment on lines +68 to +71
drop(existing);
std::fs::remove_dir_all(index_path)?;
std::fs::create_dir_all(index_path)?;
Index::create_in_dir(index_path, schema.clone())?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread src/search/fulltext.rs
Comment on lines +73 to +77
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)?),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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.

1 participant