Skip to content

Commit

Permalink
update FFI free_index_reader
Browse files Browse the repository at this point in the history
  • Loading branch information
MochiXu committed Mar 26, 2024
1 parent 0c88c7e commit f622f09
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/search/implements/api_common_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ pub fn load_index_reader(index_path: &str) -> Result<bool, TantivySearchError> {

pub fn free_index_reader(index_path: &str) -> Result<bool, TantivySearchError> {
// remove bitmap cache
#[cfg(feature = "use-flurry-cache")]
{
let all_keys = CACHE_FOR_SKIP_INDEX.all_keys();
let keys_need_remove: Vec<_> = all_keys
.into_iter()
.filter(|(_, _, ref element, _)| element == &index_path)
.collect();
CACHE_FOR_SKIP_INDEX.remove_keys(keys_need_remove);
}
// #[cfg(feature = "use-flurry-cache")]
// {
// let all_keys = CACHE_FOR_SKIP_INDEX.all_keys();
// let keys_need_remove: Vec<_> = all_keys
// .into_iter()
// .filter(|(_, _, ref element, _)| element == &index_path)
// .collect();
// CACHE_FOR_SKIP_INDEX.remove_keys(keys_need_remove);
// }

// remove index reader from Reader Cache
if let Err(_) = FFI_INDEX_SEARCHER_CACHE.remove_index_reader_bridge(index_path.to_string()) {
Expand Down

0 comments on commit f622f09

Please sign in to comment.