mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-23 21:20:24 +01:00
reformat all the files
This commit is contained in:
parent
7086009f93
commit
5d5d115608
@ -69,10 +69,15 @@ fn bench_songs(c: &mut criterion::Criterion) {
|
||||
.map(|s| {
|
||||
s.trim()
|
||||
.split(' ')
|
||||
.map(|s| format!(r#""{}""#, s)).collect::<Vec<String>>().join(" ")
|
||||
.map(|s| format!(r#""{}""#, s))
|
||||
.collect::<Vec<String>>()
|
||||
.join(" ")
|
||||
})
|
||||
.collect();
|
||||
let basic_with_quote: &[&str] = &basic_with_quote.iter().map(|s| s.as_str()).collect::<Vec<&str>>();
|
||||
let basic_with_quote: &[&str] = &basic_with_quote
|
||||
.iter()
|
||||
.map(|s| s.as_str())
|
||||
.collect::<Vec<&str>>();
|
||||
|
||||
let confs = &[
|
||||
/* first we bench each criterion alone */
|
||||
@ -133,7 +138,6 @@ fn bench_songs(c: &mut criterion::Criterion) {
|
||||
criterion: Some(&["desc(released-timestamp)"]),
|
||||
..BASE_CONF
|
||||
},
|
||||
|
||||
/* then we bench the asc and desc criterion on top of the default criterion */
|
||||
utils::Conf {
|
||||
group_name: "asc + default",
|
||||
@ -145,14 +149,11 @@ fn bench_songs(c: &mut criterion::Criterion) {
|
||||
criterion: Some(&desc_default[..]),
|
||||
..BASE_CONF
|
||||
},
|
||||
|
||||
/* the we bench some global / normal search with all the default criterion in the default
|
||||
* order */
|
||||
utils::Conf {
|
||||
group_name: "basic placeholder",
|
||||
queries: &[
|
||||
"",
|
||||
],
|
||||
queries: &[""],
|
||||
..BASE_CONF
|
||||
},
|
||||
utils::Conf {
|
||||
@ -173,10 +174,7 @@ fn bench_songs(c: &mut criterion::Criterion) {
|
||||
group_name: "prefix search",
|
||||
queries: &[
|
||||
"s", // 500k+ results
|
||||
"a",
|
||||
"b",
|
||||
"i",
|
||||
"x", // only 7k results
|
||||
"a", "b", "i", "x", // only 7k results
|
||||
],
|
||||
..BASE_CONF
|
||||
},
|
||||
|
@ -1,8 +1,14 @@
|
||||
use std::{fs::{File, create_dir_all, remove_dir_all}, time::Duration};
|
||||
use std::{
|
||||
fs::{create_dir_all, remove_dir_all, File},
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
use heed::EnvOpenOptions;
|
||||
use criterion::BenchmarkId;
|
||||
use milli::{FacetCondition, Index, update::{IndexDocumentsMethod, Settings, UpdateBuilder, UpdateFormat}};
|
||||
use heed::EnvOpenOptions;
|
||||
use milli::{
|
||||
update::{IndexDocumentsMethod, Settings, UpdateBuilder, UpdateFormat},
|
||||
FacetCondition, Index,
|
||||
};
|
||||
|
||||
pub struct Conf<'a> {
|
||||
/// where we are going to create our database.mmdb directory
|
||||
@ -36,7 +42,6 @@ impl Conf<'_> {
|
||||
facet_condition: None,
|
||||
optional_words: true,
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
pub fn base_setup(conf: &Conf) -> Index {
|
||||
@ -77,7 +82,8 @@ pub fn base_setup(conf: &Conf) -> Index {
|
||||
builder.index_documents_method(IndexDocumentsMethod::ReplaceDocuments);
|
||||
// we called from cargo the current directory is supposed to be milli/milli
|
||||
let dataset_path = format!("benches/{}", conf.dataset);
|
||||
let reader = File::open(&dataset_path).expect(&format!("could not find the dataset in: {}", &dataset_path));
|
||||
let reader = File::open(&dataset_path)
|
||||
.expect(&format!("could not find the dataset in: {}", &dataset_path));
|
||||
builder.execute(reader, |_, _| ()).unwrap();
|
||||
wtxn.commit().unwrap();
|
||||
|
||||
|
@ -38,10 +38,15 @@ fn bench_songs(c: &mut criterion::Criterion) {
|
||||
.map(|s| {
|
||||
s.trim()
|
||||
.split(' ')
|
||||
.map(|s| format!(r#""{}""#, s)).collect::<Vec<String>>().join(" ")
|
||||
.map(|s| format!(r#""{}""#, s))
|
||||
.collect::<Vec<String>>()
|
||||
.join(" ")
|
||||
})
|
||||
.collect();
|
||||
let basic_with_quote: &[&str] = &basic_with_quote.iter().map(|s| s.as_str()).collect::<Vec<&str>>();
|
||||
let basic_with_quote: &[&str] = &basic_with_quote
|
||||
.iter()
|
||||
.map(|s| s.as_str())
|
||||
.collect::<Vec<&str>>();
|
||||
|
||||
let confs = &[
|
||||
/* first we bench each criterion alone */
|
||||
|
Loading…
x
Reference in New Issue
Block a user