mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-08-18 03:58:21 +00:00
add missing to benchmark
This commit is contained in:
@@ -87,6 +87,7 @@ fn bench_agg(mut group: InputGroup<Index>) {
|
||||
register!(group, terms_many_with_avg_sub_agg);
|
||||
register!(group, terms_status_with_avg_sub_agg);
|
||||
register!(group, nested_terms_status_and_zipf_1000);
|
||||
register!(group, nested_terms_status_and_zipf_1000_with_missing);
|
||||
register!(group, nested_terms_zipf_1000_and_status);
|
||||
register!(group, nested_terms_many_and_zipf_1000);
|
||||
register!(group, nested_terms_many_and_zipf_1000_and_status);
|
||||
@@ -115,6 +116,11 @@ fn bench_agg(mut group: InputGroup<Index>) {
|
||||
multi_terms_status_and_zipf_1000,
|
||||
multi_terms_status_and_zipf_1000_filtered
|
||||
);
|
||||
register!(
|
||||
group,
|
||||
multi_terms_status_and_zipf_1000_with_missing,
|
||||
multi_terms_status_and_zipf_1000_with_missing_filtered
|
||||
);
|
||||
register!(
|
||||
group,
|
||||
multi_terms_zipf_1000_and_status,
|
||||
@@ -431,6 +437,26 @@ fn nested_terms_status_and_zipf_1000(index: &Index) {
|
||||
execute_agg(index, agg_req);
|
||||
}
|
||||
|
||||
fn nested_terms_status_and_zipf_1000_with_missing(index: &Index) {
|
||||
let agg_req = json!({
|
||||
"my_texts": {
|
||||
"terms": {
|
||||
"field": "text_few_terms_status",
|
||||
"missing": "MISSING_STATUS"
|
||||
},
|
||||
"aggs": {
|
||||
"nested_terms": {
|
||||
"terms": {
|
||||
"field": "text_1000_terms_zipf",
|
||||
"missing": "MISSING_ZIPF"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
execute_agg(index, agg_req);
|
||||
}
|
||||
|
||||
fn nested_terms_zipf_1000_and_status(index: &Index) {
|
||||
let agg_req = json!({
|
||||
"my_texts": {
|
||||
@@ -717,6 +743,23 @@ define_multi_terms_benchmark!(
|
||||
}),
|
||||
);
|
||||
|
||||
define_multi_terms_benchmark!(
|
||||
/// multi_terms equivalent of nested_terms_status_and_zipf_1000_with_missing.
|
||||
multi_terms_status_and_zipf_1000_with_missing,
|
||||
multi_terms_status_and_zipf_1000_with_missing_filtered,
|
||||
json!({
|
||||
"mt": {
|
||||
"multi_terms": {
|
||||
"terms": [
|
||||
{"field": "text_few_terms_status", "missing": "MISSING_STATUS"},
|
||||
{"field": "text_1000_terms_zipf", "missing": "MISSING_ZIPF"}
|
||||
],
|
||||
"size": 100
|
||||
}
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
||||
define_multi_terms_benchmark!(
|
||||
/// multi_terms equivalent of nested_terms_zipf_1000_and_status:
|
||||
/// flat GroupBy(zipf_1000, status) vs nested terms(zipf_1000) -> terms(status)
|
||||
|
||||
@@ -291,6 +291,7 @@ impl OptionalIndex {
|
||||
doc_ids_out: &mut Vec<DocId>,
|
||||
row_ids_out: &mut Vec<RowId>,
|
||||
) {
|
||||
// TODO: change the API to require sorted input, and remove the fallback.
|
||||
if !doc_ids.is_sorted() {
|
||||
for &doc_id in doc_ids {
|
||||
if let Some(row_id) = self.rank_if_exists(doc_id) {
|
||||
|
||||
Reference in New Issue
Block a user