Implement fielded Telegram search with a pluggable index store

This commit is contained in:
2026-12-02 18:44:32 +08:00
parent 311a43f85a
commit a1fbdd33eb
14 changed files with 609 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
pub(crate) mod analysis;
pub(crate) mod rank;
pub(crate) mod retrieve;
use crate::{Document, Kind, Media};
#[derive(Clone, Debug)]
pub struct Query<'a> {
pub text: &'a str,
pub kind: Option<Kind>,
pub media: Option<Media>,
pub offset: usize,
pub limit: usize,
}
impl<'a> Query<'a> {
pub fn new(text: &'a str) -> Self {
Self {
text,
kind: None,
media: None,
offset: 0,
limit: 10,
}
}
}
#[derive(Debug)]
pub struct SearchPage {
pub total: usize,
pub hits: Vec<Document>,
}