2023-04-13 16:46:09 +08:00
|
|
|
pub mod attribute_fid;
|
|
|
|
pub mod attribute_position;
|
2023-04-05 00:02:46 +08:00
|
|
|
pub mod distinct;
|
2023-04-24 22:57:12 +08:00
|
|
|
pub mod exactness;
|
2023-04-13 19:45:34 +08:00
|
|
|
pub mod geo_sort;
|
2023-05-01 22:26:01 +08:00
|
|
|
pub mod integration;
|
2023-04-05 00:02:46 +08:00
|
|
|
#[cfg(feature = "default")]
|
|
|
|
pub mod language;
|
2023-04-04 22:18:22 +08:00
|
|
|
pub mod ngram_split_words;
|
2023-04-05 00:02:46 +08:00
|
|
|
pub mod proximity;
|
2023-04-05 19:33:23 +08:00
|
|
|
pub mod proximity_typo;
|
2023-04-05 00:02:46 +08:00
|
|
|
pub mod sort;
|
2023-05-01 22:26:01 +08:00
|
|
|
pub mod stop_words;
|
2023-04-04 22:18:22 +08:00
|
|
|
pub mod typo;
|
2023-04-05 19:33:23 +08:00
|
|
|
pub mod typo_proximity;
|
2023-04-04 22:18:22 +08:00
|
|
|
pub mod words_tms;
|
2023-04-05 00:02:46 +08:00
|
|
|
|
|
|
|
fn collect_field_values(
|
|
|
|
index: &crate::Index,
|
|
|
|
txn: &heed::RoTxn,
|
|
|
|
fid: &str,
|
|
|
|
docids: &[u32],
|
|
|
|
) -> Vec<String> {
|
|
|
|
let mut values = vec![];
|
|
|
|
let fid = index.fields_ids_map(txn).unwrap().id(fid).unwrap();
|
|
|
|
for doc in index.documents(txn, docids.iter().copied()).unwrap() {
|
|
|
|
if let Some(v) = doc.1.get(fid) {
|
|
|
|
let v: serde_json::Value = serde_json::from_slice(v).unwrap();
|
|
|
|
let v = v.to_string();
|
|
|
|
values.push(v);
|
|
|
|
} else {
|
|
|
|
values.push("__does_not_exist__".to_owned());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
values
|
|
|
|
}
|