2022-04-15 03:50:37 +00:00
|
|
|
use pyo3::prelude::*;
|
2019-06-04 09:09:58 +00:00
|
|
|
use tantivy as tv;
|
|
|
|
|
|
|
|
/// Tantivy's Query
|
|
|
|
#[pyclass]
|
|
|
|
pub(crate) struct Query {
|
2020-09-19 13:17:07 +00:00
|
|
|
pub(crate) inner: Box<dyn tv::query::Query>,
|
2020-09-19 09:36:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Query {
|
2020-09-19 13:17:07 +00:00
|
|
|
pub(crate) fn get(&self) -> &dyn tv::query::Query {
|
|
|
|
&self.inner
|
2020-09-19 09:36:31 +00:00
|
|
|
}
|
2019-06-04 09:09:58 +00:00
|
|
|
}
|
|
|
|
|
2022-04-15 03:50:37 +00:00
|
|
|
#[pymethods]
|
|
|
|
impl Query {
|
2019-08-02 11:23:10 +00:00
|
|
|
fn __repr__(&self) -> PyResult<String> {
|
2020-09-19 09:36:31 +00:00
|
|
|
Ok(format!("Query({:?})", self.get()))
|
2019-06-04 09:09:58 +00:00
|
|
|
}
|
|
|
|
}
|