@@ -331,6 +331,68 @@ public void shouldExecuteCustomMethodForNotIn() {
331
331
assertThat (page .getContent ().get (0 ).getId ()).isEqualTo (documentId2 );
332
332
}
333
333
334
+ @ Test // DATAES-647
335
+ public void shouldHandleManyValuesQueryingIn () {
336
+
337
+ // given
338
+ String documentId1 = randomNumeric (32 );
339
+ SampleEntity sampleEntity1 = new SampleEntity ();
340
+ sampleEntity1 .setId (documentId1 );
341
+ sampleEntity1 .setKeyword ("foo" );
342
+ repository .save (sampleEntity1 );
343
+
344
+ String documentId2 = randomNumeric (32 );
345
+ SampleEntity sampleEntity2 = new SampleEntity ();
346
+ sampleEntity2 .setId (documentId2 );
347
+ sampleEntity2 .setKeyword ("bar" );
348
+ repository .save (sampleEntity2 );
349
+
350
+ List <String > keywords = new ArrayList <>();
351
+ keywords .add ("foo" );
352
+
353
+ for (int i = 0 ; i < 1025 ; i ++) {
354
+ keywords .add (randomNumeric (32 ));
355
+ }
356
+
357
+ // when
358
+ List <SampleEntity > list = repository .findByKeywordIn (keywords );
359
+
360
+ // then
361
+ assertThat (list .size ()).isEqualTo (1L );
362
+ assertThat (list .get (0 ).getId ()).isEqualTo (documentId1 );
363
+ }
364
+
365
+ @ Test // DATAES-647
366
+ public void shouldHandleManyValuesQueryingNotIn () {
367
+
368
+ // given
369
+ String documentId1 = randomNumeric (32 );
370
+ SampleEntity sampleEntity1 = new SampleEntity ();
371
+ sampleEntity1 .setId (documentId1 );
372
+ sampleEntity1 .setKeyword ("foo" );
373
+ repository .save (sampleEntity1 );
374
+
375
+ String documentId2 = randomNumeric (32 );
376
+ SampleEntity sampleEntity2 = new SampleEntity ();
377
+ sampleEntity2 .setId (documentId2 );
378
+ sampleEntity2 .setKeyword ("bar" );
379
+ repository .save (sampleEntity2 );
380
+
381
+ List <String > keywords = new ArrayList <>();
382
+ keywords .add ("foo" );
383
+
384
+ for (int i = 0 ; i < 1025 ; i ++) {
385
+ keywords .add (randomNumeric (32 ));
386
+ }
387
+
388
+ // when
389
+ List <SampleEntity > list = repository .findByKeywordNotIn (keywords );
390
+
391
+ // then
392
+ assertThat (list .size ()).isEqualTo (1L );
393
+ assertThat (list .get (0 ).getId ()).isEqualTo (documentId2 );
394
+ }
395
+
334
396
@ Test
335
397
public void shouldExecuteCustomMethodForTrue () {
336
398
@@ -1296,6 +1358,7 @@ static class SampleEntity {
1296
1358
@ Id private String id ;
1297
1359
@ Field (type = Text , store = true , fielddata = true ) private String type ;
1298
1360
@ Field (type = Text , store = true , fielddata = true ) private String message ;
1361
+ @ Field (type = Keyword ) private String keyword ;
1299
1362
private int rate ;
1300
1363
private boolean available ;
1301
1364
private GeoPoint location ;
@@ -1337,6 +1400,10 @@ public interface SampleCustomMethodRepository extends ElasticsearchRepository<Sa
1337
1400
1338
1401
Page <SampleEntity > findByIdIn (List <String > ids , Pageable pageable );
1339
1402
1403
+ List <SampleEntity > findByKeywordIn (List <String > keywords );
1404
+
1405
+ List <SampleEntity > findByKeywordNotIn (List <String > keywords );
1406
+
1340
1407
Page <SampleEntity > findByIdNotIn (List <String > ids , Pageable pageable );
1341
1408
1342
1409
Page <SampleEntity > findByAvailableTrue (Pageable pageable );
0 commit comments