prope
elasticsearchBackendConfig.threadPool().size());
addBackendConfig(propertyCollector, backendName, ElasticsearchBackendSettings.VERSION_CHECK_ENABLED,
elasticsearchBackendConfig.versionCheck());
+ addBackendConfig(propertyCollector, backendName, ElasticsearchBackendSettings.QUERY_SHARD_FAILURE_IGNORE,
+ elasticsearchBackendConfig.query().shardFailure().ignore());
addBackendConfig(propertyCollector, backendName, ElasticsearchBackendSettings.DISCOVERY_ENABLED,
elasticsearchBackendConfig.discovery().enabled());
diff --git a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRuntimeConfigPersistenceUnit.java b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRuntimeConfigPersistenceUnit.java
index 8a9fa181fb631..7eef01aa32e97 100644
--- a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRuntimeConfigPersistenceUnit.java
+++ b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRuntimeConfigPersistenceUnit.java
@@ -148,6 +148,11 @@ interface ElasticsearchBackendRuntimeConfig {
*/
ThreadPoolConfig threadPool();
+ /**
+ * Configuration for search queries to this backend.
+ */
+ ElasticsearchQueryConfig query();
+
/**
* Whether Hibernate Search should check the version of the Elasticsearch cluster on startup.
*
@@ -505,6 +510,26 @@ interface ThreadPoolConfig {
OptionalInt size();
}
+ @ConfigGroup
+ interface ElasticsearchQueryConfig {
+ /**
+ * Configuration for the behavior on shard failure.
+ */
+ ElasticsearchQueryShardFailureConfig shardFailure();
+ }
+
+ @ConfigGroup
+ interface ElasticsearchQueryShardFailureConfig {
+ /**
+ * Whether partial shard failures are ignored (`true`)
+ * or lead to Hibernate Search throwing an exception (`false`).
+ *
+ * Will default to `false` in Hibernate Search 7.
+ */
+ @WithDefault("true")
+ boolean ignore();
+ }
+
// We can't set actual default values in this section,
// otherwise "quarkus.hibernate-search-orm.elasticsearch.index-defaults" will be ignored.
@ConfigGroup