Fix the benchmarks compilation

This commit is contained in:
Kerollmops 2021-06-03 10:33:42 +02:00
parent 6b7841fefc
commit 82fb5f0bef
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4
3 changed files with 13 additions and 13 deletions

View File

@ -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
},

View File

@ -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();
});

View File

@ -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