File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
rest-api-spec/src/main/resources/rest-api-spec/test/search
server/src/main/java/org/elasticsearch/action/search Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 5656---
5757" hits.total as an object " :
5858 - skip :
59- version : " - 6.99 .99"
59+ version : " - 7.0 .99"
6060 reason : hits.total is rendered as an object in 7.0.0
6161
6262 - do :
@@ -106,7 +106,7 @@ setup:
106106
107107 - do :
108108 search :
109- size : 3
109+ size : 0
110110 track_total_hits : 4
111111 body :
112112 query :
@@ -116,6 +116,18 @@ setup:
116116 - match : {hits.total.value: 4}
117117 - match : {hits.total.relation: gte}
118118
119+ - do :
120+ search :
121+ size : 0
122+ track_total_hits : 5
123+ body :
124+ query :
125+ match :
126+ foo : bar
127+
128+ - match : {hits.total.value: 5}
129+ - match : {hits.total.relation: eq}
130+
119131 - do :
120132 catch : /\[rest_total_hits_as_int\] cannot be used if the tracking of total hits is not accurate, got 100/
121133 search :
Original file line number Diff line number Diff line change @@ -754,7 +754,7 @@ TotalHits getTotalHits() {
754754 assert totalHitsRelation == Relation .EQUAL_TO ;
755755 return new TotalHits (totalHits , totalHitsRelation );
756756 } else {
757- if (totalHits < trackTotalHitsUpTo ) {
757+ if (totalHits <= trackTotalHitsUpTo ) {
758758 return new TotalHits (totalHits , totalHitsRelation );
759759 } else {
760760 /*
You can’t perform that action at this time.
0 commit comments