reflectiveC
Type superClassType = classInfo.superClassType();
while (superClassType != null && !superClassType.name().toString().equals("java.lang.Object")) {
+ reflectiveClassCollector.add(superClassType.name());
if (superClassType instanceof ClassType) {
superClassType = index.getClassByName(superClassType.name()).superClassType();
} else if (superClassType instanceof ParameterizedType) {
diff --git a/extensions/hibernate-search-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/elasticsearch/runtime/HibernateSearchElasticsearchRuntimeConfig.java b/extensions/hibernate-search-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/elasticsearch/runtime/HibernateSearchElasticsearchRuntimeConfig.java
index 89e067def4547..36f625b6d9233 100644
--- a/extensions/hibernate-search-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/elasticsearch/runtime/HibernateSearchElasticsearchRuntimeConfig.java
+++ b/extensions/hibernate-search-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/elasticsearch/runtime/HibernateSearchElasticsearchRuntimeConfig.java
@@ -8,7 +8,7 @@
import org.hibernate.search.backend.elasticsearch.index.IndexLifecycleStrategyName;
import org.hibernate.search.backend.elasticsearch.index.IndexStatus;
-import org.hibernate.search.mapper.orm.automaticindexing.AutomaticIndexingSynchronizationStrategyName;
+import org.hibernate.search.mapper.orm.automaticindexing.session.AutomaticIndexingSynchronizationStrategyNames;
import org.hibernate.search.mapper.orm.search.loading.EntityLoadingCacheLookupStrategy;
import org.hibernate.search.util.common.SearchException;
import org.hibernate.search.util.common.impl.StringHelper;
@@ -210,13 +210,167 @@ public static class AutomaticIndexingSynchronizationConfig {
/**
* The synchronization strategy to use when indexing automatically.
*
- * Defines the status for which you wait before considering the operation completed by Hibernate Search.
+ * Defines how complete indexing should be before resuming the application thread
+ * after a database transaction is committed.
*
- * Use {@code queued} or {@code committed} in production environments.
- * {@code searchable} is useful in integration tests.
+ * Available values:
+ *
+ *
+ *
+ *
+ *
+ * Strategy
+ *
+ * |
+ *
+ *
+ * Guarantees when the application thread resumes
+ *
+ * |
+ *
+ *
+ * Throughput
+ *
+ * |
+ *
+ *
+ *
+ *
+ * Changes applied
+ *
+ * |
+ *
+ *
+ * Changes safe from crash/power loss
+ *
+ * |
+ *
+ *
+ * Changes visible on search
+ *
+ * |
+ *
+ *
+ *
+ *
+ *
+ *
+ * {@value AutomaticIndexingSynchronizationStrategyNames#ASYNC}
+ *
+ * |
+ *
+ *
+ * No guarantee
+ *
+ * |
+ *
+ *
+ * No guarantee
+ *
+ * |
+ *
+ *
+ * No guarantee
+ *
+ * |
+ *
+ *
+ * Best
+ *
+ * |
+ *
+ *
+ *
+ *
+ * {@value AutomaticIndexingSynchronizationStrategyNames#WRITE_SYNC} (default)
+ *
+ * |
+ *
+ *
+ * Guaranteed
+ *
+ * |
+ *
+ *
+ * Guaranteed
+ *
+ * |
+ *
+ *
+ * No guarantee
+ *
+ * |
+ *
+ *
+ * Medium
+ *
+ * |
+ *
+ *
+ *
+ *
+ * {@value AutomaticIndexingSynchronizationStrategyNames#READ_SYNC}
+ *
+ * |
+ *
+ *
+ * Guaranteed
+ *
+ * |
+ *
+ *
+ * No guarantee
+ *
+ * |
+ *
+ *
+ * Guaranteed
+ *
+ * |
+ *
+ *
+ * Medium to worst
+ *
+ * |
+ *
+ *
+ *
+ *
+ * {@value AutomaticIndexingSynchronizationStrategyNames#SYNC}
+ *
+ * |
+ *
+ *
+ * Guaranteed
+ *
+ * |
+ *
+ *
+ * Guaranteed
+ *
+ * |
+ *
+ *
+ * Guaranteed
+ *
+ * |
+ *
+ *
+ * Worst
+ *
+ * |
+ *
+ *
+ *
+ *
+ * See
+ * this
+ * section of the reference documentation
+ * for more information.
*/
- @ConfigItem(defaultValue = "committed")
- AutomaticIndexingSynchronizationStrategyName strategy;
+ @ConfigItem(defaultValue = AutomaticIndexingSynchronizationStrategyNames.WRITE_SYNC)
+ String strategy;
}
@ConfigGroup
diff --git a/integration-tests/hibernate-search-elasticsearch/src/main/java/io/quarkus/it/hibernate/search/elasticsearch/search/HibernateSearchTestResource.java b/integration-tests/hibernate-search-elasticsearch/src/main/java/io/quarkus/it/hibernate/search/elasticsearch/search/HibernateSearchTestResource.java
index 084b7bf4bae77..5be594a5ce1a9 100644
--- a/integration-tests/hibernate-search-elasticsearch/src/main/java/io/quarkus/it/hibernate/search/elasticsearch/search/HibernateSearchTestResource.java
+++ b/integration-tests/hibernate-search-elasticsearch/src/main/java/io/quarkus/it/hibernate/search/elasticsearch/search/HibernateSearchTestResource.java
@@ -39,7 +39,7 @@ public String testSearch() {
SearchSession searchSession = Search.session(entityManager);
List person = searchSession.search(Person.class)
- .predicate(f -> f.match().field("name").matching("john"))
+ .where(f -> f.match().field("name").matching("john"))
.sort(f -> f.field("name_sort"))
.fetchHits(20);
@@ -48,7 +48,7 @@ public String testSearch() {
assertEquals("John Irving", person.get(1).getName());
person = searchSession.search(Person.class)
- .predicate(f -> f.nested().objectField("address").nest(
+ .where(f -> f.nested().objectField("address").nest(
f.match().field("address.city").matching("london")))
.sort(f -> f.field("name_sort"))
.fetchHits(20);
@@ -71,12 +71,12 @@ public String testPurge() {
}
@PUT
- @Path("/flush")
+ @Path("/refresh")
@Produces(MediaType.TEXT_PLAIN)
- public String testFlush() {
+ public String testRefresh() {
SearchSession searchSession = Search.session(entityManager);
- searchSession.workspace().flush();
+ searchSession.workspace().refresh();
return "OK";
}
@@ -88,7 +88,7 @@ public String testSearchEmpty() {
SearchSession searchSession = Search.session(entityManager);
List person = searchSession.search(Person.class)
- .predicate(f -> f.matchAll())
+ .where(f -> f.matchAll())
.fetchHits(20);
assertEquals(0, person.size());
diff --git a/integration-tests/hibernate-search-elasticsearch/src/main/resources/application.properties b/integration-tests/hibernate-search-elasticsearch/src/main/resources/application.properties
index 485b87928daf2..dc7d8d90a4413 100644
--- a/integration-tests/hibernate-search-elasticsearch/src/main/resources/application.properties
+++ b/integration-tests/hibernate-search-elasticsearch/src/main/resources/application.properties
@@ -11,4 +11,5 @@ quarkus.hibernate-orm.database.generation=drop-and-create
quarkus.hibernate-search.elasticsearch.version=7
quarkus.hibernate-search.elasticsearch.analysis.configurer=io.quarkus.it.hibernate.search.elasticsearch.search.DefaultITAnalysisConfigurer
quarkus.hibernate-search.elasticsearch.index-defaults.lifecycle.strategy=drop-and-create-and-drop
-quarkus.hibernate-search.automatic-indexing.synchronization.strategy=searchable
+quarkus.hibernate-search.elasticsearch.index-defaults.lifecycle.required-status=yellow
+quarkus.hibernate-search.automatic-indexing.synchronization.strategy=sync
diff --git a/integration-tests/hibernate-search-elasticsearch/src/test/java/io/quarkus/it/hibernate/search/elasticsearch/HibernateSearchTest.java b/integration-tests/hibernate-search-elasticsearch/src/test/java/io/quarkus/it/hibernate/search/elasticsearch/HibernateSearchTest.java
index 503ca7805ddb6..7ac08d451a80e 100644
--- a/integration-tests/hibernate-search-elasticsearch/src/test/java/io/quarkus/it/hibernate/search/elasticsearch/HibernateSearchTest.java
+++ b/integration-tests/hibernate-search-elasticsearch/src/test/java/io/quarkus/it/hibernate/search/elasticsearch/HibernateSearchTest.java
@@ -23,7 +23,7 @@ public void testSearch() throws Exception {
.statusCode(200)
.body(is("OK"));
- RestAssured.when().put("/test/hibernate-search/flush").then()
+ RestAssured.when().put("/test/hibernate-search/refresh").then()
.statusCode(200)
.body(is("OK"));