|
88 | 88 | import static io.github.nik9000.mapmatcher.MapMatcher.matchesMap;
|
89 | 89 | import static org.hamcrest.Matchers.equalTo;
|
90 | 90 | import static org.hamcrest.Matchers.greaterThan;
|
| 91 | +import static org.hamcrest.Matchers.greaterThanOrEqualTo; |
91 | 92 | import static org.hamcrest.Matchers.hasSize;
|
92 | 93 | import static org.hamcrest.Matchers.instanceOf;
|
93 | 94 | import static org.hamcrest.Matchers.nullValue;
|
@@ -390,7 +391,7 @@ public void testRangeFilter() throws IOException {
|
390 | 391 | matchesMap().entry("segments_with_doc_count_field", 0)
|
391 | 392 | .entry("segments_with_deleted_docs", 0)
|
392 | 393 | .entry("segments_collected", 0)
|
393 |
| - .entry("segments_counted", 1) |
| 394 | + .entry("segments_counted", greaterThanOrEqualTo(1)) |
394 | 395 | .entry("filters", matchesList().item(matchesMap().entry("query", "test:[1577836800000 TO 1583020799999]")))
|
395 | 396 | )
|
396 | 397 | );
|
@@ -450,7 +451,7 @@ public void testMatchAll() throws IOException {
|
450 | 451 | debug,
|
451 | 452 | matchesMap().entry(
|
452 | 453 | "test",
|
453 |
| - matchesMap().entry("segments_counted", 1) |
| 454 | + matchesMap().entry("segments_counted", greaterThanOrEqualTo(1)) |
454 | 455 | .entry("segments_collected", 0)
|
455 | 456 | .entry("segments_with_doc_count_field", 0)
|
456 | 457 | .entry("segments_with_deleted_docs", 0)
|
@@ -488,9 +489,9 @@ public void testMatchAllWithDocCount() throws IOException {
|
488 | 489 | debug,
|
489 | 490 | matchesMap().entry(
|
490 | 491 | "test",
|
491 |
| - matchesMap().entry("segments_counted", 1) |
| 492 | + matchesMap().entry("segments_counted", greaterThanOrEqualTo(1)) |
492 | 493 | .entry("segments_collected", 0)
|
493 |
| - .entry("segments_with_doc_count_field", 1) |
| 494 | + .entry("segments_with_doc_count_field", greaterThanOrEqualTo(1)) |
494 | 495 | .entry("segments_with_deleted_docs", 0)
|
495 | 496 | .entry(
|
496 | 497 | "filters",
|
@@ -558,7 +559,7 @@ public void onCache(ShardId shardId, Accountable accountable) {}
|
558 | 559 | aggregator.collectDebugInfo(debug::put);
|
559 | 560 | assertMap(
|
560 | 561 | debug,
|
561 |
| - matchesMap().entry("segments_counted", 1) |
| 562 | + matchesMap().entry("segments_counted", greaterThanOrEqualTo(1)) |
562 | 563 | .entry("segments_collected", 0)
|
563 | 564 | .entry("segments_with_doc_count_field", 0)
|
564 | 565 | .entry("segments_with_deleted_docs", 0)
|
@@ -645,7 +646,7 @@ public void testMatchNoneFilter() throws IOException {
|
645 | 646 | matchesMap().entry("segments_with_doc_count_field", 0)
|
646 | 647 | .entry("segments_with_deleted_docs", 0)
|
647 | 648 | .entry("segments_collected", 0)
|
648 |
| - .entry("segments_counted", 1) |
| 649 | + .entry("segments_counted", greaterThanOrEqualTo(1)) |
649 | 650 | .entry(
|
650 | 651 | "filters",
|
651 | 652 | matchesList().item(
|
@@ -682,7 +683,7 @@ public void testMatchNoneTopLevel() throws IOException {
|
682 | 683 | matchesMap().entry("segments_with_doc_count_field", 0)
|
683 | 684 | .entry("segments_with_deleted_docs", 0)
|
684 | 685 | .entry("segments_collected", 0)
|
685 |
| - .entry("segments_counted", 1) |
| 686 | + .entry("segments_counted", greaterThanOrEqualTo(1)) |
686 | 687 | .entry(
|
687 | 688 | "filters",
|
688 | 689 | matchesList().item(
|
@@ -721,7 +722,7 @@ public void testTermFilter() throws IOException {
|
721 | 722 | matchesMap().entry("segments_with_doc_count_field", 0)
|
722 | 723 | .entry("segments_with_deleted_docs", 0)
|
723 | 724 | .entry("segments_collected", 0)
|
724 |
| - .entry("segments_counted", 1) |
| 725 | + .entry("segments_counted", greaterThanOrEqualTo(1)) |
725 | 726 | .entry(
|
726 | 727 | "filters",
|
727 | 728 | matchesList().item(
|
@@ -762,7 +763,7 @@ public void testTermTopLevel() throws IOException {
|
762 | 763 | matchesMap().entry("segments_with_doc_count_field", 0)
|
763 | 764 | .entry("segments_with_deleted_docs", 0)
|
764 | 765 | .entry("segments_collected", 0)
|
765 |
| - .entry("segments_counted", 1) |
| 766 | + .entry("segments_counted", greaterThanOrEqualTo(1)) |
766 | 767 | .entry(
|
767 | 768 | "filters",
|
768 | 769 | matchesList().item(
|
@@ -849,7 +850,7 @@ public void testSubAggs() throws IOException {
|
849 | 850 | "test",
|
850 | 851 | matchesMap().entry("segments_with_doc_count_field", 0)
|
851 | 852 | .entry("segments_with_deleted_docs", 0)
|
852 |
| - .entry("segments_collected", 1) |
| 853 | + .entry("segments_collected", greaterThanOrEqualTo(1)) |
853 | 854 | .entry("segments_counted", 0)
|
854 | 855 | .entry(
|
855 | 856 | "filters",
|
@@ -925,7 +926,7 @@ public void testSubAggsManyDocs() throws IOException {
|
925 | 926 | "test",
|
926 | 927 | matchesMap().entry("segments_with_doc_count_field", 0)
|
927 | 928 | .entry("segments_with_deleted_docs", 0)
|
928 |
| - .entry("segments_collected", 1) |
| 929 | + .entry("segments_collected", greaterThanOrEqualTo(1)) |
929 | 930 | .entry("segments_counted", 0)
|
930 | 931 | .entry("filters", hasSize(2))
|
931 | 932 | ).entry("test.s", matchesMap()).entry("test.m", matchesMap())
|
@@ -1004,7 +1005,7 @@ public void testSubAggsManyFilters() throws IOException {
|
1004 | 1005 | "test",
|
1005 | 1006 | matchesMap().entry("segments_with_doc_count_field", 0)
|
1006 | 1007 | .entry("segments_with_deleted_docs", 0)
|
1007 |
| - .entry("segments_collected", 1) |
| 1008 | + .entry("segments_collected", greaterThanOrEqualTo(1)) |
1008 | 1009 | .entry("segments_counted", 0)
|
1009 | 1010 | .entry("filters", hasSize(buckets.size()))
|
1010 | 1011 | ).entry("test.s", matchesMap()).entry("test.m", matchesMap())
|
|
0 commit comments