mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-01-31 07:23:15 +08:00
commit
06d5a10902
@ -21,7 +21,6 @@ const DATA_SCHEMA: &[u8] = b"data-schema";
|
|||||||
|
|
||||||
pub mod schema;
|
pub mod schema;
|
||||||
pub(crate) mod index;
|
pub(crate) mod index;
|
||||||
mod deserializer;
|
|
||||||
mod document_key;
|
mod document_key;
|
||||||
mod serde;
|
mod serde;
|
||||||
mod update;
|
mod update;
|
||||||
|
@ -19,6 +19,7 @@ pub mod find_id;
|
|||||||
pub mod key_to_string;
|
pub mod key_to_string;
|
||||||
pub mod serializer;
|
pub mod serializer;
|
||||||
pub mod indexer_serializer;
|
pub mod indexer_serializer;
|
||||||
|
pub mod deserializer;
|
||||||
|
|
||||||
pub fn calculate_hash<T: Hash>(t: &T) -> u64 {
|
pub fn calculate_hash<T: Hash>(t: &T) -> u64 {
|
||||||
let mut s = DefaultHasher::new();
|
let mut s = DefaultHasher::new();
|
||||||
|
@ -9,7 +9,7 @@ use serde::de::DeserializeOwned;
|
|||||||
|
|
||||||
use crate::database::{DocumentKey, DocumentKeyAttr};
|
use crate::database::{DocumentKey, DocumentKeyAttr};
|
||||||
use crate::database::{retrieve_data_schema, retrieve_data_index};
|
use crate::database::{retrieve_data_schema, retrieve_data_index};
|
||||||
use crate::database::deserializer::Deserializer;
|
use crate::database::serde::deserializer::Deserializer;
|
||||||
use crate::database::schema::Schema;
|
use crate::database::schema::Schema;
|
||||||
use crate::database::index::Index;
|
use crate::database::index::Index;
|
||||||
use crate::rank::{QueryBuilder, FilterFunc};
|
use crate::rank::{QueryBuilder, FilterFunc};
|
||||||
|
@ -18,7 +18,7 @@ pub struct Document {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Document {
|
impl Document {
|
||||||
pub fn from_raw(raw: &RawDocument) -> Document {
|
fn from_raw(raw: &RawDocument) -> Document {
|
||||||
let len = raw.matches.range.len();
|
let len = raw.matches.range.len();
|
||||||
let mut matches = Vec::with_capacity(len);
|
let mut matches = Vec::with_capacity(len);
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ where D: Deref<Target=DB>,
|
|||||||
FI: Fn(DocumentId, &DatabaseView<D>) -> bool,
|
FI: Fn(DocumentId, &DatabaseView<D>) -> bool,
|
||||||
{
|
{
|
||||||
pub fn query(self, query: &str, range: Range<usize>) -> Vec<Document> {
|
pub fn query(self, query: &str, range: Range<usize>) -> Vec<Document> {
|
||||||
// We give the filtering work to the query distinct builder,
|
// We delegate the filter work to the distinct query builder,
|
||||||
// specifying a distinct rule that has no effect.
|
// specifying a distinct rule that has no effect.
|
||||||
if self.filter.is_some() {
|
if self.filter.is_some() {
|
||||||
let builder = self.with_distinct(|_, _| None as Option<()>, 1);
|
let builder = self.with_distinct(|_, _| None as Option<()>, 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user