|
89 | 89 | import static io.github.nik9000.mapmatcher.MapMatcher.matchesMap;
|
90 | 90 | import static org.hamcrest.Matchers.equalTo;
|
91 | 91 | import static org.hamcrest.Matchers.greaterThan;
|
| 92 | +import static org.hamcrest.Matchers.greaterThanOrEqualTo; |
92 | 93 | import static org.hamcrest.Matchers.hasSize;
|
93 | 94 | import static org.hamcrest.Matchers.instanceOf;
|
94 | 95 | import static org.hamcrest.Matchers.nullValue;
|
@@ -411,7 +412,7 @@ public void testRangeFilter() throws IOException {
|
411 | 412 | matchesMap().entry("segments_with_doc_count_field", 0)
|
412 | 413 | .entry("segments_with_deleted_docs", 0)
|
413 | 414 | .entry("segments_collected", 0)
|
414 |
| - .entry("segments_counted", 1) |
| 415 | + .entry("segments_counted", greaterThanOrEqualTo(1)) |
415 | 416 | .entry("filters", matchesList().item(matchesMap().entry("query", "test:[1577836800000 TO 1583020799999]")))
|
416 | 417 | )
|
417 | 418 | );
|
@@ -471,7 +472,7 @@ public void testMatchAll() throws IOException {
|
471 | 472 | debug,
|
472 | 473 | matchesMap().entry(
|
473 | 474 | "test",
|
474 |
| - matchesMap().entry("segments_counted", 1) |
| 475 | + matchesMap().entry("segments_counted", greaterThanOrEqualTo(1)) |
475 | 476 | .entry("segments_collected", 0)
|
476 | 477 | .entry("segments_with_doc_count_field", 0)
|
477 | 478 | .entry("segments_with_deleted_docs", 0)
|
@@ -513,9 +514,9 @@ public void testMatchAllWithDocCount() throws IOException {
|
513 | 514 | debug,
|
514 | 515 | matchesMap().entry(
|
515 | 516 | "test",
|
516 |
| - matchesMap().entry("segments_counted", 1) |
| 517 | + matchesMap().entry("segments_counted", greaterThanOrEqualTo(1)) |
517 | 518 | .entry("segments_collected", 0)
|
518 |
| - .entry("segments_with_doc_count_field", 1) |
| 519 | + .entry("segments_with_doc_count_field", greaterThanOrEqualTo(1)) |
519 | 520 | .entry("segments_with_deleted_docs", 0)
|
520 | 521 | .entry(
|
521 | 522 | "filters",
|
@@ -583,7 +584,7 @@ public void onCache(ShardId shardId, Accountable accountable) {}
|
583 | 584 | aggregator.collectDebugInfo(debug::put);
|
584 | 585 | assertMap(
|
585 | 586 | debug,
|
586 |
| - matchesMap().entry("segments_counted", 1) |
| 587 | + matchesMap().entry("segments_counted", greaterThanOrEqualTo(1)) |
587 | 588 | .entry("segments_collected", 0)
|
588 | 589 | .entry("segments_with_doc_count_field", 0)
|
589 | 590 | .entry("segments_with_deleted_docs", 0)
|
@@ -670,7 +671,7 @@ public void testMatchNoneFilter() throws IOException {
|
670 | 671 | matchesMap().entry("segments_with_doc_count_field", 0)
|
671 | 672 | .entry("segments_with_deleted_docs", 0)
|
672 | 673 | .entry("segments_collected", 0)
|
673 |
| - .entry("segments_counted", 1) |
| 674 | + .entry("segments_counted", greaterThanOrEqualTo(1)) |
674 | 675 | .entry(
|
675 | 676 | "filters",
|
676 | 677 | matchesList().item(
|
@@ -707,7 +708,7 @@ public void testMatchNoneTopLevel() throws IOException {
|
707 | 708 | matchesMap().entry("segments_with_doc_count_field", 0)
|
708 | 709 | .entry("segments_with_deleted_docs", 0)
|
709 | 710 | .entry("segments_collected", 0)
|
710 |
| - .entry("segments_counted", 1) |
| 711 | + .entry("segments_counted", greaterThanOrEqualTo(1)) |
711 | 712 | .entry(
|
712 | 713 | "filters",
|
713 | 714 | matchesList().item(
|
@@ -746,7 +747,7 @@ public void testTermFilter() throws IOException {
|
746 | 747 | matchesMap().entry("segments_with_doc_count_field", 0)
|
747 | 748 | .entry("segments_with_deleted_docs", 0)
|
748 | 749 | .entry("segments_collected", 0)
|
749 |
| - .entry("segments_counted", 1) |
| 750 | + .entry("segments_counted", greaterThanOrEqualTo(1)) |
750 | 751 | .entry(
|
751 | 752 | "filters",
|
752 | 753 | matchesList().item(
|
@@ -787,7 +788,7 @@ public void testTermTopLevel() throws IOException {
|
787 | 788 | matchesMap().entry("segments_with_doc_count_field", 0)
|
788 | 789 | .entry("segments_with_deleted_docs", 0)
|
789 | 790 | .entry("segments_collected", 0)
|
790 |
| - .entry("segments_counted", 1) |
| 791 | + .entry("segments_counted", greaterThanOrEqualTo(1)) |
791 | 792 | .entry(
|
792 | 793 | "filters",
|
793 | 794 | matchesList().item(
|
@@ -874,7 +875,7 @@ public void testSubAggs() throws IOException {
|
874 | 875 | "test",
|
875 | 876 | matchesMap().entry("segments_with_doc_count_field", 0)
|
876 | 877 | .entry("segments_with_deleted_docs", 0)
|
877 |
| - .entry("segments_collected", 1) |
| 878 | + .entry("segments_collected", greaterThanOrEqualTo(1)) |
878 | 879 | .entry("segments_counted", 0)
|
879 | 880 | .entry(
|
880 | 881 | "filters",
|
@@ -952,7 +953,7 @@ public void testSubAggsManyDocs() throws IOException {
|
952 | 953 | "test",
|
953 | 954 | matchesMap().entry("segments_with_doc_count_field", 0)
|
954 | 955 | .entry("segments_with_deleted_docs", 0)
|
955 |
| - .entry("segments_collected", 1) |
| 956 | + .entry("segments_collected", greaterThanOrEqualTo(1)) |
956 | 957 | .entry("segments_counted", 0)
|
957 | 958 | .entry("filters", hasSize(2))
|
958 | 959 | ).entry("test.s", matchesMap()).entry("test.m", matchesMap())
|
@@ -1033,7 +1034,7 @@ public void testSubAggsManyFilters() throws IOException {
|
1033 | 1034 | "test",
|
1034 | 1035 | matchesMap().entry("segments_with_doc_count_field", 0)
|
1035 | 1036 | .entry("segments_with_deleted_docs", 0)
|
1036 |
| - .entry("segments_collected", 1) |
| 1037 | + .entry("segments_collected", greaterThanOrEqualTo(1)) |
1037 | 1038 | .entry("segments_counted", 0)
|
1038 | 1039 | .entry("filters", hasSize(buckets.size()))
|
1039 | 1040 | ).entry("test.s", matchesMap()).entry("test.m", matchesMap())
|
|
0 commit comments