mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-30 00:55:00 +08:00
feat: Introduce binary group by in the query builder
This commit is contained in:
parent
3d820a27ee
commit
78786a0007
@ -30,7 +30,7 @@ rev = "306e201"
|
|||||||
|
|
||||||
[dependencies.group-by]
|
[dependencies.group-by]
|
||||||
git = "https://github.com/Kerollmops/group-by.git"
|
git = "https://github.com/Kerollmops/group-by.git"
|
||||||
rev = "f1f5d8f"
|
rev = "5a113fe"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["simd"]
|
default = ["simd"]
|
||||||
|
@ -4,7 +4,7 @@ use std::error::Error;
|
|||||||
use std::hash::Hash;
|
use std::hash::Hash;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
use group_by::GroupByMut;
|
use group_by::BinaryGroupByMut;
|
||||||
use hashbrown::HashMap;
|
use hashbrown::HashMap;
|
||||||
use fst::Streamer;
|
use fst::Streamer;
|
||||||
use rocksdb::DB;
|
use rocksdb::DB;
|
||||||
@ -154,7 +154,7 @@ where D: Deref<Target=DB>,
|
|||||||
|
|
||||||
group.sort_unstable_by(|a, b| criterion.evaluate(a, b, view));
|
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();
|
documents_seen += group.len();
|
||||||
groups.push(group);
|
groups.push(group);
|
||||||
|
|
||||||
@ -231,7 +231,7 @@ where D: Deref<Target=DB>,
|
|||||||
|
|
||||||
group.sort_unstable_by(|a, b| criterion.evaluate(a, b, view));
|
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
|
// we must compute the real distinguished len of this sub-group
|
||||||
for document in group.iter() {
|
for document in group.iter() {
|
||||||
let filter_accepted = match &self.inner.filter {
|
let filter_accepted = match &self.inner.filter {
|
||||||
|
Loading…
Reference in New Issue
Block a user