mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 10:37:41 +08:00
Small code reorganisation
This commit is contained in:
parent
57fa689131
commit
4e266211bf
@ -70,6 +70,8 @@ pub mod update;
|
|||||||
#[macro_use]
|
#[macro_use]
|
||||||
pub mod snapshot_tests;
|
pub mod snapshot_tests;
|
||||||
|
|
||||||
|
pub use search::new::{execute_search, SearchContext};
|
||||||
|
|
||||||
use std::collections::{BTreeMap, HashMap};
|
use std::collections::{BTreeMap, HashMap};
|
||||||
use std::convert::{TryFrom, TryInto};
|
use std::convert::{TryFrom, TryInto};
|
||||||
use std::hash::BuildHasherDefault;
|
use std::hash::BuildHasherDefault;
|
||||||
|
@ -11,6 +11,8 @@ mod small_bitmap;
|
|||||||
mod sort;
|
mod sort;
|
||||||
mod words;
|
mod words;
|
||||||
|
|
||||||
|
pub use logger::{DefaultSearchLogger, SearchLogger};
|
||||||
|
|
||||||
use std::collections::BTreeSet;
|
use std::collections::BTreeSet;
|
||||||
|
|
||||||
use charabia::Tokenize;
|
use charabia::Tokenize;
|
||||||
@ -24,7 +26,6 @@ pub use ranking_rules::{
|
|||||||
use roaring::RoaringBitmap;
|
use roaring::RoaringBitmap;
|
||||||
|
|
||||||
use self::interner::Interner;
|
use self::interner::Interner;
|
||||||
use self::logger::SearchLogger;
|
|
||||||
use self::query_term::Phrase;
|
use self::query_term::Phrase;
|
||||||
use self::resolve_query_graph::{resolve_query_graph, NodeDocIdsCache};
|
use self::resolve_query_graph::{resolve_query_graph, NodeDocIdsCache};
|
||||||
use crate::search::new::query_term::located_query_terms_from_string;
|
use crate::search::new::query_term::located_query_terms_from_string;
|
||||||
@ -57,7 +58,7 @@ impl<'search> SearchContext<'search> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn resolve_maximally_reduced_query_graph<'search>(
|
fn resolve_maximally_reduced_query_graph<'search>(
|
||||||
ctx: &mut SearchContext<'search>,
|
ctx: &mut SearchContext<'search>,
|
||||||
universe: &RoaringBitmap,
|
universe: &RoaringBitmap,
|
||||||
query_graph: &QueryGraph,
|
query_graph: &QueryGraph,
|
||||||
|
@ -1,31 +1,3 @@
|
|||||||
// #[macro_export]
|
|
||||||
// macro_rules! iter_bitmap {
|
|
||||||
// ($bitmap:expr, $id:lifetime, $p:pat, $body:block) => {
|
|
||||||
// match $bitmap {
|
|
||||||
// SmallBitmap::Tiny(mut set) => {
|
|
||||||
// while set > 0 {
|
|
||||||
// let $p = set.trailing_zeros() as u16;
|
|
||||||
// $body;
|
|
||||||
// set &= set - 1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// SmallBitmap::Small(sets) => {
|
|
||||||
// let mut base = 0;
|
|
||||||
// for set in sets.iter() {
|
|
||||||
// let mut set = *set;
|
|
||||||
// while set > 0 {
|
|
||||||
// let idx = set.trailing_zeros() as u16;
|
|
||||||
// let $p = idx + base;
|
|
||||||
// set &= set - 1;
|
|
||||||
// $body;
|
|
||||||
// }
|
|
||||||
// base += 64;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub enum SmallBitmap {
|
pub enum SmallBitmap {
|
||||||
Tiny(u64),
|
Tiny(u64),
|
||||||
@ -256,16 +228,8 @@ mod tests {
|
|||||||
bitmap2.insert(x * 3);
|
bitmap2.insert(x * 3);
|
||||||
}
|
}
|
||||||
bitmap1.intersection(&bitmap2);
|
bitmap1.intersection(&bitmap2);
|
||||||
// println!("{}", bitmap.contains(12));
|
for v in bitmap1.iter() {
|
||||||
// bitmap1
|
println!("{v}");
|
||||||
// .iter(|x| {
|
}
|
||||||
// println!("{x}");
|
|
||||||
// Ok(())
|
|
||||||
// })
|
|
||||||
// .unwrap();
|
|
||||||
|
|
||||||
// iter_bitmap!(bitmap1, 'loop1, x, {
|
|
||||||
// println!("{x}");
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user