server: use query for search

This commit is contained in:
nym21
2025-03-05 16:55:37 +01:00
parent b27297cdc6
commit d2ca6f1d46
10 changed files with 104 additions and 155 deletions

View File

@@ -60,8 +60,17 @@ impl<'a> Query<'a> {
) -> color_eyre::Result<Output> {
let tuples = ids
.iter()
.map(|s| {
let mut id = s.to_lowercase().replace("_", "-");
.flat_map(|s| {
s.to_lowercase()
.replace("_", "-")
.split_whitespace()
.flat_map(|s| {
s.split(',')
.flat_map(|s| s.split('+').map(|s| s.to_string()))
})
.collect::<Vec<_>>()
})
.map(|mut id| {
let mut res = self.vecid_to_index_to_vec.get(&id);
if res.is_none() {
if let Ok(index) = Index::try_from(id.as_str()) {