@@ -223,74 +223,6 @@ public void testEnumShortcutProperty() {
223
223
assertEquals (SortOrder .Asc , so .field ().order ());
224
224
}
225
225
226
- @ Test
227
- public void testObjectShortcutProperty () {
228
-
229
- // Check that we look ahead to handle the shortcut
230
- ObjectDeserializer <?> deser = (ObjectDeserializer <?>) LazyDeserializer .unwrap (RankEvalQuery ._DESERIALIZER );
231
- assertEquals ("query" , deser .shortcutProperty ());
232
- assertTrue (deser .shortcutIsObject ());
233
-
234
- // Standard form
235
- RankEvalQuery req = fromJson ("{\" query\" :{\" term\" :{\" foo\" :{\" value\" :\" bar\" }}}}" , RankEvalQuery .class );
236
-
237
- assertEquals ("foo" , req .query ().term ().field ());
238
- assertEquals ("bar" , req .query ().term ().value ().stringValue ());
239
-
240
- // Shortcut form
241
- req = fromJson ("{\" term\" :{\" foo\" :{\" value\" :\" bar\" }}}" , RankEvalQuery .class );
242
-
243
- assertEquals ("foo" , req .query ().term ().field ());
244
- assertEquals ("bar" , req .query ().term ().value ().stringValue ());
245
-
246
- // Nested shortcuts
247
- req = fromJson ("{\" term\" :{\" foo\" :\" bar\" }}" , RankEvalQuery .class );
248
-
249
- assertEquals ("foo" , req .query ().term ().field ());
250
- assertEquals ("bar" , req .query ().term ().value ().stringValue ());
251
- }
252
-
253
- @ Test
254
- public void testFunctionScoreQuery () {
255
- String shortcut =
256
- "{" +
257
- " \" gauss\" : {" +
258
- " \" date\" : {" +
259
- " \" origin\" : \" 2013-09-17\" , " +
260
- " \" scale\" : \" 10d\" ," +
261
- " \" offset\" : \" 5d\" , " +
262
- " \" decay\" : 0.5" +
263
- " }," +
264
- " \" multi_value_mode\" : \" avg\" " +
265
- " }" +
266
- "}" ;
267
-
268
- String full =
269
- "{" +
270
- " \" functions\" : [" +
271
- " {" +
272
- " \" gauss\" : {" +
273
- " \" date\" : {" +
274
- " \" origin\" : \" 2013-09-17\" ," +
275
- " \" scale\" : \" 10d\" ," +
276
- " \" offset\" : \" 5d\" ," +
277
- " \" decay\" : 0.5" +
278
- " }," +
279
- " \" multi_value_mode\" : \" avg\" " +
280
- " }" +
281
- " }" +
282
- " ]" +
283
- "}" ;
284
-
285
- FunctionScoreQuery fsq ;
286
-
287
- fsq = fromJson (full , FunctionScoreQuery .class );
288
- assertEquals (MultiValueMode .Avg , fsq .functions ().get (0 ).gauss ().untyped ().multiValueMode ());
289
-
290
- fsq = fromJson (shortcut , FunctionScoreQuery .class );
291
- assertEquals (MultiValueMode .Avg , fsq .functions ().get (0 ).gauss ().untyped ().multiValueMode ());
292
- }
293
-
294
226
@ Test
295
227
public void testWithNull () {
296
228
0 commit comments