File tree 2 files changed +15
-7
lines changed
modules/elasticsearch/src/main/java/org/elasticsearch
2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -180,7 +180,11 @@ public String from() {
180
180
* first.
181
181
*/
182
182
public TermsRequest from (Object from ) {
183
- this .from = from .toString ();
183
+ if (from == null ) {
184
+ this .from = null ;
185
+ } else {
186
+ this .from = from .toString ();
187
+ }
184
188
return this ;
185
189
}
186
190
@@ -202,17 +206,21 @@ public TermsRequest fromInclusive(boolean fromInclusive) {
202
206
}
203
207
204
208
/**
205
- * The upper bound (lex) term to which the iteration will end. Defaults to unbound (<tt>null</tt>).
209
+ * The upper bound term to which the iteration will end. Defaults to unbound (<tt>null</tt>).
206
210
*/
207
211
public String to () {
208
212
return to ;
209
213
}
210
214
211
215
/**
212
- * The upper bound (lex) term to which the iteration will end. Defaults to unbound (<tt>null</tt>).
216
+ * The upper bound term to which the iteration will end. Defaults to unbound (<tt>null</tt>).
213
217
*/
214
218
public TermsRequest to (Object to ) {
215
- this .to = to .toString ();
219
+ if (to == null ) {
220
+ this .to = null ;
221
+ } else {
222
+ this .to = to .toString ();
223
+ }
216
224
return this ;
217
225
}
218
226
Original file line number Diff line number Diff line change @@ -72,13 +72,13 @@ public class RestTermsAction extends BaseRestHandler {
72
72
termsRequest .operationThreading (operationThreading );
73
73
74
74
List <String > fields = request .params ("field" );
75
- if (fields == null ) {
76
- fields = new ArrayList <String >();
77
- }
78
75
String sField = request .param ("fields" );
79
76
if (sField != null ) {
80
77
String [] sFields = fieldsPattern .split (sField );
81
78
if (sFields != null ) {
79
+ if (fields == null ) {
80
+ fields = new ArrayList <String >();
81
+ }
82
82
for (String field : sFields ) {
83
83
fields .add (field );
84
84
}
You can’t perform that action at this time.
0 commit comments