Implement fielded Telegram search with a pluggable index store
This commit is contained in:
@@ -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>,
|
||||
}
|
||||
Reference in New Issue
Block a user