Fix benchmarks

This commit is contained in:
ManyTheFish 2022-08-22 14:55:53 +02:00
parent 993aa1321c
commit f9029727e0

View File

@ -11,7 +11,7 @@ use milli::heed::EnvOpenOptions;
use milli::update::{ use milli::update::{
IndexDocuments, IndexDocumentsConfig, IndexDocumentsMethod, IndexerConfig, Settings, IndexDocuments, IndexDocumentsConfig, IndexDocumentsMethod, IndexerConfig, Settings,
}; };
use milli::{Filter, Index, Object}; use milli::{Filter, Index, Object, TermsMatchingStrategy};
use serde_json::Value; use serde_json::Value;
pub struct Conf<'a> { pub struct Conf<'a> {
@ -119,7 +119,7 @@ pub fn run_benches(c: &mut criterion::Criterion, confs: &[Conf]) {
b.iter(|| { b.iter(|| {
let rtxn = index.read_txn().unwrap(); let rtxn = index.read_txn().unwrap();
let mut search = index.search(&rtxn); let mut search = index.search(&rtxn);
search.query(query).optional_words(conf.optional_words); search.query(query).optional_words(TermsMatchingStrategy::default());
if let Some(filter) = conf.filter { if let Some(filter) = conf.filter {
let filter = Filter::from_str(filter).unwrap().unwrap(); let filter = Filter::from_str(filter).unwrap().unwrap();
search.filter(filter); search.filter(filter);