File tree 3 files changed +5
-14
lines changed
main/java/org/elasticsearch/action/search
test/java/org/elasticsearch/action/search
3 files changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -205,17 +205,14 @@ public SearchRequest(StreamInput in) throws IOException {
205
205
localClusterAlias = in .readOptionalString ();
206
206
if (localClusterAlias != null ) {
207
207
absoluteStartMillis = in .readVLong ();
208
+ finalReduce = in .readBoolean ();
208
209
} else {
209
210
absoluteStartMillis = DEFAULT_ABSOLUTE_START_MILLIS ;
211
+ finalReduce = true ;
210
212
}
211
213
} else {
212
214
localClusterAlias = null ;
213
215
absoluteStartMillis = DEFAULT_ABSOLUTE_START_MILLIS ;
214
- }
215
- //TODO move to the 6_7_0 branch once backported to 6.x
216
- if (in .getVersion ().onOrAfter (Version .V_7_0_0 )) {
217
- finalReduce = in .readBoolean ();
218
- } else {
219
216
finalReduce = true ;
220
217
}
221
218
if (in .getVersion ().onOrAfter (Version .V_7_0_0 )) {
@@ -245,12 +242,9 @@ public void writeTo(StreamOutput out) throws IOException {
245
242
out .writeOptionalString (localClusterAlias );
246
243
if (localClusterAlias != null ) {
247
244
out .writeVLong (absoluteStartMillis );
245
+ out .writeBoolean (finalReduce );
248
246
}
249
247
}
250
- //TODO move to the 6_7_0 branch once backported to 6.x
251
- if (out .getVersion ().onOrAfter (Version .V_7_0_0 )) {
252
- out .writeBoolean (finalReduce );
253
- }
254
248
if (out .getVersion ().onOrAfter (Version .V_7_0_0 )) {
255
249
out .writeBoolean (ccsMinimizeRoundtrips );
256
250
}
Original file line number Diff line number Diff line change @@ -91,14 +91,10 @@ public void testRandomVersionSerialization() throws IOException {
91
91
if (version .before (Version .V_6_7_0 )) {
92
92
assertNull (deserializedRequest .getLocalClusterAlias ());
93
93
assertAbsoluteStartMillisIsCurrentTime (deserializedRequest );
94
+ assertTrue (deserializedRequest .isFinalReduce ());
94
95
} else {
95
96
assertEquals (searchRequest .getLocalClusterAlias (), deserializedRequest .getLocalClusterAlias ());
96
97
assertEquals (searchRequest .getOrCreateAbsoluteStartMillis (), deserializedRequest .getOrCreateAbsoluteStartMillis ());
97
- }
98
- //TODO move to the 6_7_0 branch once backported to 6.x
99
- if (version .before (Version .V_7_0_0 )) {
100
- assertTrue (deserializedRequest .isFinalReduce ());
101
- } else {
102
98
assertEquals (searchRequest .isFinalReduce (), deserializedRequest .isFinalReduce ());
103
99
}
104
100
}
Original file line number Diff line number Diff line change @@ -171,6 +171,7 @@ public void testFinalReduce() {
171
171
assertEquals (2 , searchResponse .getHits ().getTotalHits ().value );
172
172
Aggregations aggregations = searchResponse .getAggregations ();
173
173
LongTerms longTerms = aggregations .get ("terms" );
174
+ assertEquals (2 , longTerms .getBuckets ().size ());
174
175
}
175
176
}
176
177
}
You can’t perform that action at this time.
0 commit comments