From 78786a0007fda6244f9d810a0ba2fa0e4e78439f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Thu, 10 Jan 2019 20:13:40 +0100 Subject: [PATCH] feat: Introduce binary group by in the query builder --- Cargo.toml | 2 +- src/rank/query_builder.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 115600bc0..f2cb036fe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ rev = "306e201" [dependencies.group-by] git = "https://github.com/Kerollmops/group-by.git" -rev = "f1f5d8f" +rev = "5a113fe" [features] default = ["simd"] diff --git a/src/rank/query_builder.rs b/src/rank/query_builder.rs index 6b03bf4e9..b8686b071 100644 --- a/src/rank/query_builder.rs +++ b/src/rank/query_builder.rs @@ -4,7 +4,7 @@ use std::error::Error; use std::hash::Hash; use std::rc::Rc; -use group_by::GroupByMut; +use group_by::BinaryGroupByMut; use hashbrown::HashMap; use fst::Streamer; use rocksdb::DB; @@ -154,7 +154,7 @@ where D: Deref, group.sort_unstable_by(|a, b| criterion.evaluate(a, b, view)); - for group in GroupByMut::new(group, |a, b| criterion.eq(a, b, view)) { + for group in BinaryGroupByMut::new(group, |a, b| criterion.eq(a, b, view)) { documents_seen += group.len(); groups.push(group); @@ -231,7 +231,7 @@ where D: Deref, group.sort_unstable_by(|a, b| criterion.evaluate(a, b, view)); - for group in GroupByMut::new(group, |a, b| criterion.eq(a, b, view)) { + for group in BinaryGroupByMut::new(group, |a, b| criterion.eq(a, b, view)) { // we must compute the real distinguished len of this sub-group for document in group.iter() { let filter_accepted = match &self.inner.filter {