Skip to content

Commit 8262093

Browse files
committed
Query DSL: Range - support lt/lte/gt/gte, closes #114.
1 parent 5f7d0ce commit 8262093

File tree

2 files changed

+396
-0
lines changed

2 files changed

+396
-0
lines changed

modules/elasticsearch/src/main/java/org/elasticsearch/index/query/json/RangeJsonFilterBuilder.java

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,96 @@ public RangeJsonFilterBuilder from(double from) {
8989
return this;
9090
}
9191

92+
/**
93+
* The from part of the filter query. Null indicates unbounded.
94+
*/
95+
public RangeJsonFilterBuilder gt(String from) {
96+
this.from = from;
97+
this.includeLower = false;
98+
return this;
99+
}
100+
101+
/**
102+
* The from part of the filter query. Null indicates unbounded.
103+
*/
104+
public RangeJsonFilterBuilder gt(int from) {
105+
this.from = from;
106+
this.includeLower = false;
107+
return this;
108+
}
109+
110+
/**
111+
* The from part of the filter query. Null indicates unbounded.
112+
*/
113+
public RangeJsonFilterBuilder gt(long from) {
114+
this.from = from;
115+
this.includeLower = false;
116+
return this;
117+
}
118+
119+
/**
120+
* The from part of the filter query. Null indicates unbounded.
121+
*/
122+
public RangeJsonFilterBuilder gt(float from) {
123+
this.from = from;
124+
this.includeLower = false;
125+
return this;
126+
}
127+
128+
/**
129+
* The from part of the filter query. Null indicates unbounded.
130+
*/
131+
public RangeJsonFilterBuilder gt(double from) {
132+
this.from = from;
133+
this.includeLower = false;
134+
return this;
135+
}
136+
137+
/**
138+
* The from part of the filter query. Null indicates unbounded.
139+
*/
140+
public RangeJsonFilterBuilder gte(String from) {
141+
this.from = from;
142+
this.includeLower = true;
143+
return this;
144+
}
145+
146+
/**
147+
* The from part of the filter query. Null indicates unbounded.
148+
*/
149+
public RangeJsonFilterBuilder gte(int from) {
150+
this.from = from;
151+
this.includeLower = true;
152+
return this;
153+
}
154+
155+
/**
156+
* The from part of the filter query. Null indicates unbounded.
157+
*/
158+
public RangeJsonFilterBuilder gte(long from) {
159+
this.from = from;
160+
this.includeLower = true;
161+
return this;
162+
}
163+
164+
/**
165+
* The from part of the filter query. Null indicates unbounded.
166+
*/
167+
public RangeJsonFilterBuilder gte(float from) {
168+
this.from = from;
169+
this.includeLower = true;
170+
return this;
171+
}
172+
173+
/**
174+
* The from part of the filter query. Null indicates unbounded.
175+
*/
176+
public RangeJsonFilterBuilder gte(double from) {
177+
this.from = from;
178+
this.includeLower = true;
179+
return this;
180+
}
181+
92182
/**
93183
* The to part of the filter query. Null indicates unbounded.
94184
*/
@@ -129,6 +219,96 @@ public RangeJsonFilterBuilder to(double to) {
129219
return this;
130220
}
131221

222+
/**
223+
* The to part of the filter query. Null indicates unbounded.
224+
*/
225+
public RangeJsonFilterBuilder lt(String to) {
226+
this.to = to;
227+
this.includeUpper = false;
228+
return this;
229+
}
230+
231+
/**
232+
* The to part of the filter query. Null indicates unbounded.
233+
*/
234+
public RangeJsonFilterBuilder lt(int to) {
235+
this.to = to;
236+
this.includeUpper = false;
237+
return this;
238+
}
239+
240+
/**
241+
* The to part of the filter query. Null indicates unbounded.
242+
*/
243+
public RangeJsonFilterBuilder lt(long to) {
244+
this.to = to;
245+
this.includeUpper = false;
246+
return this;
247+
}
248+
249+
/**
250+
* The to part of the filter query. Null indicates unbounded.
251+
*/
252+
public RangeJsonFilterBuilder lt(float to) {
253+
this.to = to;
254+
this.includeUpper = false;
255+
return this;
256+
}
257+
258+
/**
259+
* The to part of the filter query. Null indicates unbounded.
260+
*/
261+
public RangeJsonFilterBuilder lt(double to) {
262+
this.to = to;
263+
this.includeUpper = false;
264+
return this;
265+
}
266+
267+
/**
268+
* The to part of the filter query. Null indicates unbounded.
269+
*/
270+
public RangeJsonFilterBuilder lte(String to) {
271+
this.to = to;
272+
this.includeUpper = true;
273+
return this;
274+
}
275+
276+
/**
277+
* The to part of the filter query. Null indicates unbounded.
278+
*/
279+
public RangeJsonFilterBuilder lte(int to) {
280+
this.to = to;
281+
this.includeUpper = true;
282+
return this;
283+
}
284+
285+
/**
286+
* The to part of the filter query. Null indicates unbounded.
287+
*/
288+
public RangeJsonFilterBuilder lte(long to) {
289+
this.to = to;
290+
this.includeUpper = true;
291+
return this;
292+
}
293+
294+
/**
295+
* The to part of the filter query. Null indicates unbounded.
296+
*/
297+
public RangeJsonFilterBuilder lte(float to) {
298+
this.to = to;
299+
this.includeUpper = true;
300+
return this;
301+
}
302+
303+
/**
304+
* The to part of the filter query. Null indicates unbounded.
305+
*/
306+
public RangeJsonFilterBuilder lte(double to) {
307+
this.to = to;
308+
this.includeUpper = true;
309+
return this;
310+
}
311+
132312
/**
133313
* Should the lower bound be included or not. Defaults to <tt>true</tt>.
134314
*/

0 commit comments

Comments
 (0)