tantivy: Merge our imports.
parent
2b77bb4b0c
commit
7af1b68a45
|
@ -2,20 +2,20 @@
|
||||||
#![allow(clippy::wrong_self_convention)]
|
#![allow(clippy::wrong_self_convention)]
|
||||||
|
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use pyo3::prelude::*;
|
use pyo3::{
|
||||||
use pyo3::types::{PyAny, PyDateTime, PyDict, PyList, PyTuple};
|
prelude::*,
|
||||||
use pyo3::types::{PyDateAccess, PyTimeAccess};
|
types::{
|
||||||
|
PyAny, PyDateAccess, PyDateTime, PyDict, PyList, PyTimeAccess, PyTuple,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
use chrono::offset::TimeZone;
|
use chrono::{offset::TimeZone, Datelike, Timelike, Utc};
|
||||||
use chrono::{Datelike, Timelike, Utc};
|
|
||||||
|
|
||||||
use tantivy as tv;
|
use tantivy as tv;
|
||||||
|
|
||||||
use crate::facet::Facet;
|
use crate::{facet::Facet, to_pyerr};
|
||||||
use crate::to_pyerr;
|
|
||||||
use pyo3::{PyMappingProtocol, PyObjectProtocol};
|
use pyo3::{PyMappingProtocol, PyObjectProtocol};
|
||||||
use std::collections::BTreeMap;
|
use std::{collections::BTreeMap, fmt};
|
||||||
use std::fmt;
|
|
||||||
use tantivy::schema::Value;
|
use tantivy::schema::Value;
|
||||||
|
|
||||||
fn value_to_py(py: Python, value: &Value) -> PyResult<PyObject> {
|
fn value_to_py(py: Python, value: &Value) -> PyResult<PyObject> {
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
use pyo3::basic::PyObjectProtocol;
|
use pyo3::{basic::PyObjectProtocol, prelude::*, types::PyType};
|
||||||
use pyo3::prelude::*;
|
|
||||||
use pyo3::types::PyType;
|
|
||||||
use tantivy::schema;
|
use tantivy::schema;
|
||||||
|
|
||||||
/// A Facet represent a point in a given hierarchy.
|
/// A Facet represent a point in a given hierarchy.
|
||||||
|
|
23
src/index.rs
23
src/index.rs
|
@ -1,17 +1,20 @@
|
||||||
#![allow(clippy::new_ret_no_self)]
|
#![allow(clippy::new_ret_no_self)]
|
||||||
|
|
||||||
use pyo3::exceptions;
|
use pyo3::{exceptions, prelude::*, types::PyAny};
|
||||||
use pyo3::prelude::*;
|
|
||||||
use pyo3::types::PyAny;
|
|
||||||
|
|
||||||
use crate::document::{extract_value, Document};
|
use crate::{
|
||||||
use crate::query::Query;
|
document::{extract_value, Document},
|
||||||
use crate::schema::Schema;
|
get_field,
|
||||||
use crate::searcher::Searcher;
|
query::Query,
|
||||||
use crate::{get_field, to_pyerr};
|
schema::Schema,
|
||||||
|
searcher::Searcher,
|
||||||
|
to_pyerr,
|
||||||
|
};
|
||||||
use tantivy as tv;
|
use tantivy as tv;
|
||||||
use tantivy::directory::MmapDirectory;
|
use tantivy::{
|
||||||
use tantivy::schema::{NamedFieldDocument, Term, Value};
|
directory::MmapDirectory,
|
||||||
|
schema::{NamedFieldDocument, Term, Value},
|
||||||
|
};
|
||||||
|
|
||||||
const RELOAD_POLICY: &str = "commit";
|
const RELOAD_POLICY: &str = "commit";
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
use pyo3::exceptions;
|
use pyo3::{exceptions, prelude::*};
|
||||||
use pyo3::prelude::*;
|
|
||||||
use tantivy as tv;
|
use tantivy as tv;
|
||||||
|
|
||||||
mod document;
|
mod document;
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
use pyo3::prelude::*;
|
use pyo3::{prelude::*, PyObjectProtocol};
|
||||||
use pyo3::PyObjectProtocol;
|
|
||||||
use tantivy as tv;
|
use tantivy as tv;
|
||||||
|
|
||||||
/// Tantivy's Query
|
/// Tantivy's Query
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#![allow(clippy::new_ret_no_self)]
|
#![allow(clippy::new_ret_no_self)]
|
||||||
|
|
||||||
use pyo3::exceptions;
|
use pyo3::{exceptions, prelude::*};
|
||||||
use pyo3::prelude::*;
|
|
||||||
|
|
||||||
use tantivy::schema;
|
use tantivy::schema;
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
#![allow(clippy::new_ret_no_self)]
|
#![allow(clippy::new_ret_no_self)]
|
||||||
|
|
||||||
use crate::document::Document;
|
use crate::{document::Document, get_field, query::Query, to_pyerr};
|
||||||
use crate::query::Query;
|
use pyo3::{exceptions::PyValueError, prelude::*, PyObjectProtocol};
|
||||||
use crate::{get_field, to_pyerr};
|
|
||||||
use pyo3::exceptions::PyValueError;
|
|
||||||
use pyo3::prelude::*;
|
|
||||||
use pyo3::PyObjectProtocol;
|
|
||||||
use tantivy as tv;
|
use tantivy as tv;
|
||||||
use tantivy::collector::{Count, MultiCollector, TopDocs};
|
use tantivy::collector::{Count, MultiCollector, TopDocs};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue