From 5b2a5d21d4e52794f26cde4967b7bfa6703a71b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoann=20Rodi=C3=A8re?= Date: Tue, 13 Apr 2021 12:01:03 +0200 Subject: [PATCH] Test mass indexing with a non-trivial amount of entities --- .../search/HibernateSearchTestResource.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/integration-tests/hibernate-search-orm-elasticsearch/src/main/java/io/quarkus/it/hibernate/search/elasticsearch/search/HibernateSearchTestResource.java b/integration-tests/hibernate-search-orm-elasticsearch/src/main/java/io/quarkus/it/hibernate/search/elasticsearch/search/HibernateSearchTestResource.java index 5be594a5ce1a9..af0e5eb78e808 100644 --- a/integration-tests/hibernate-search-orm-elasticsearch/src/main/java/io/quarkus/it/hibernate/search/elasticsearch/search/HibernateSearchTestResource.java +++ b/integration-tests/hibernate-search-orm-elasticsearch/src/main/java/io/quarkus/it/hibernate/search/elasticsearch/search/HibernateSearchTestResource.java @@ -30,6 +30,12 @@ public void initData() { createPerson("David Lodge", "London"); createPerson("Paul Auster", "New York"); createPerson("John Grisham", "Oxford"); + + // Add many other entities, so that mass indexing has something to do. + // DO NOT REMOVE, it's important to have many entities to fully test mass indexing. + for (int i = 0; i < 2000; i++) { + createPerson("Other Person #" + i, "Other City #" + i); + } } @GET @@ -56,6 +62,10 @@ public String testSearch() { assertEquals(1, person.size()); assertEquals("David Lodge", person.get(0).getName()); + assertEquals(4 + 2000, searchSession.search(Person.class) + .where(f -> f.matchAll()) + .fetchTotalHitCount()); + return "OK"; }