mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-30 02:09:57 +00:00
feat: Make the DatabaseView become Sync + Send
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
use std::cmp::Ordering;
|
||||
use std::ops::Deref;
|
||||
|
||||
use rocksdb::DB;
|
||||
use group_by::GroupBy;
|
||||
|
||||
use crate::database::DatabaseView;
|
||||
@ -19,8 +21,10 @@ fn sum_matches_attribute_index(matches: &[Match]) -> u32 {
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub struct SumOfWordsPosition;
|
||||
|
||||
impl Criterion for SumOfWordsPosition {
|
||||
fn evaluate(&self, lhs: &Document, rhs: &Document, _: &DatabaseView) -> Ordering {
|
||||
impl<D> Criterion<D> for SumOfWordsPosition
|
||||
where D: Deref<Target=DB>
|
||||
{
|
||||
fn evaluate(&self, lhs: &Document, rhs: &Document, _: &DatabaseView<D>) -> Ordering {
|
||||
let lhs = sum_matches_attribute_index(&lhs.matches);
|
||||
let rhs = sum_matches_attribute_index(&rhs.matches);
|
||||
|
||||
|
Reference in New Issue
Block a user