diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ff8342620..dc2a7b1c6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,6 +29,11 @@ jobs: override: true components: rustfmt, clippy + - uses: actions-rs/cargo@v1 + with: + command: check + args: --all + - uses: actions-rs/cargo@v1 with: command: build @@ -37,6 +42,11 @@ jobs: with: command: test + - uses: actions-rs/cargo@v1 + with: + command: bench + args: --no-run -p benchmarks + # - uses: actions-rs/cargo@v1 # with: # command: bench diff --git a/benchmarks/benches/songs.rs b/benchmarks/benches/songs.rs index 3f2822ca3..e5da16a99 100644 --- a/benchmarks/benches/songs.rs +++ b/benchmarks/benches/songs.rs @@ -30,7 +30,7 @@ fn base_conf(builder: &mut Settings) { .iter() .map(|s| s.to_string()) .collect(); - builder.set_faceted_fields(faceted_fields); + builder.set_filterable_fields(faceted_fields); } const BASE_CONF: Conf = Conf { @@ -156,17 +156,17 @@ fn bench_songs(c: &mut criterion::Criterion) { /* we bench the filters with the default request */ utils::Conf { group_name: "basic filter: <=", - facet_condition: Some("released-timestamp <= 946728000"), // year 2000 + filter: Some("released-timestamp <= 946728000"), // year 2000 ..BASE_CONF }, utils::Conf { group_name: "basic filter: TO", - facet_condition: Some("released-timestamp 946728000 TO 1262347200"), // year 2000 to 2010 + filter: Some("released-timestamp 946728000 TO 1262347200"), // year 2000 to 2010 ..BASE_CONF }, utils::Conf { group_name: "big filter", - facet_condition: Some("released-timestamp != 1262347200 AND (NOT (released-timestamp = 946728000)) AND (duration-float = 1 OR (duration-float 1.1 TO 1.5 AND released-timestamp > 315576000))"), + filter: Some("released-timestamp != 1262347200 AND (NOT (released-timestamp = 946728000)) AND (duration-float = 1 OR (duration-float 1.1 TO 1.5 AND released-timestamp > 315576000))"), ..BASE_CONF }, diff --git a/benchmarks/benches/utils.rs b/benchmarks/benches/utils.rs index 83367a7ca..be66d7f84 100644 --- a/benchmarks/benches/utils.rs +++ b/benchmarks/benches/utils.rs @@ -4,7 +4,7 @@ use criterion::BenchmarkId; use heed::EnvOpenOptions; use milli::{ update::{IndexDocumentsMethod, Settings, UpdateBuilder, UpdateFormat}, - FacetCondition, Index, + FilterCondition, Index, }; pub struct Conf<'a> { @@ -21,7 +21,7 @@ pub struct Conf<'a> { pub criterion: Option<&'a [&'a str]>, /// the last chance to configure your database as you want pub configure: fn(&mut Settings), - pub facet_condition: Option<&'a str>, + pub filter: Option<&'a str>, /// enable or disable the optional words on the query pub optional_words: bool, /// primary key, if there is None we'll auto-generate docids for every documents @@ -36,7 +36,7 @@ impl Conf<'_> { queries: &[], criterion: None, configure: |_| (), - facet_condition: None, + filter: None, optional_words: true, primary_key: None, }; @@ -64,7 +64,7 @@ pub fn base_setup(conf: &Conf) -> Index { let mut builder = update_builder.settings(&mut wtxn, &index); if let Some(criterion) = conf.criterion { - builder.reset_faceted_fields(); + builder.reset_filterable_fields(); builder.reset_criteria(); builder.reset_stop_words(); @@ -105,10 +105,10 @@ pub fn run_benches(c: &mut criterion::Criterion, confs: &[Conf]) { let rtxn = index.read_txn().unwrap(); let mut search = index.search(&rtxn); search.query(query).optional_words(conf.optional_words); - if let Some(facet_condition) = conf.facet_condition { - let facet_condition = - FacetCondition::from_str(&rtxn, &index, facet_condition).unwrap(); - search.facet_condition(facet_condition); + if let Some(filter) = conf.filter { + let filter = + FilterCondition::from_str(&rtxn, &index, filter).unwrap(); + search.filter(filter); } let _ids = search.execute().unwrap(); }); diff --git a/benchmarks/benches/wiki.rs b/benchmarks/benches/wiki.rs index 99ecff2ce..11ffe87d5 100644 --- a/benchmarks/benches/wiki.rs +++ b/benchmarks/benches/wiki.rs @@ -83,7 +83,7 @@ fn bench_songs(c: &mut criterion::Criterion) { group_name: "words", queries: &[ "the black saint and the sinner lady and the good doggo ", // four words to pop, 27 results - "Kameya Tokujirō mingus monk ", // two words to pop, 55 + "Kameya Tokujirō mingus monk ", // two words to pop, 55 "Ulrich Hensel meilisearch milli ", // two words to pop, 306 "Idaho Bellevue pizza ", // one word to pop, 800 "Abraham machin ", // one word to pop, 1141