Introduce the AscDesc criterion

This commit is contained in:
Clément Renault
2021-02-19 15:45:15 +01:00
committed by Kerollmops
parent b5b7ec0162
commit 14f9f85c4b
3 changed files with 285 additions and 4 deletions

View File

@ -9,6 +9,7 @@ use super::query_tree::{Operation, Query, QueryKind};
pub mod typo;
pub mod words;
pub mod asc_desc;
pub trait Criterion {
fn next(&mut self) -> anyhow::Result<Option<CriterionResult>>;
@ -28,6 +29,7 @@ pub struct CriterionResult {
/// Either a set of candidates that defines the candidates
/// that are allowed to be returned,
/// or the candidates that must never be returned.
#[derive(Debug)]
enum Candidates {
Allowed(RoaringBitmap),
Forbidden(RoaringBitmap)