Files
telefind-rs/crates/telefind-core/src/search/mod.rs
T

33 lines
587 B
Rust

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>,
}