Notify the index about a single changed file and commit immediately. This is the fastest path for keeping the index current after a single file edit — cheaper than a full rebuild or stale check.
(repo_root: &Path, changed_path: &Path)
| 38 | /// This is the fastest path for keeping the index current after a single |
| 39 | /// file edit — cheaper than a full rebuild or stale check. |
| 40 | pub fn notify_and_commit(repo_root: &Path, changed_path: &Path) -> Result<(), ContentSearchError> { |
| 41 | let config = content_config(repo_root); |
| 42 | let index = Index::open(config)?; |
| 43 | index.notify_change_immediate(changed_path)?; |
| 44 | Ok(()) |
| 45 | } |
| 46 | |
| 47 | /// Search the content index. |
| 48 | /// |
nothing calls this directly
no test coverage detected