From 3a24cbc1a01000a9e19e5b1631e7a67e99c88287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoann=20Rodi=C3=A8re?= Date: Mon, 29 Jan 2024 09:06:17 +0100 Subject: [PATCH] Fix quarkus.hibernate-search-orm.elasticsearch.version-check.enabled not appearing in docs Looks like Smallrye config still has trouble with passing a name containing dots to `@WithName`. (cherry picked from commit fe22dee5ea3534c11d837cdbb0fb23456e79cb25) --- .../HibernateSearchElasticsearchRecorder.java | 2 +- ...ticsearchRuntimeConfigPersistenceUnit.java | 23 ++++++++++++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRecorder.java b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRecorder.java index b1801a4bdb991..0222c4049a3e9 100644 --- a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRecorder.java +++ b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/HibernateSearchElasticsearchRecorder.java @@ -462,7 +462,7 @@ private void contributeBackendRuntimeProperties(BiConsumer prope addBackendConfig(propertyCollector, backendName, ElasticsearchBackendSettings.THREAD_POOL_SIZE, elasticsearchBackendConfig.threadPool().size()); addBackendConfig(propertyCollector, backendName, ElasticsearchBackendSettings.VERSION_CHECK_ENABLED, - elasticsearchBackendConfig.versionCheck()); + elasticsearchBackendConfig.versionCheck().enabled()); addBackendConfig(propertyCollector, backendName, ElasticsearchBackendSettings.QUERY_SHARD_FAILURE_IGNORE, elasticsearchBackendConfig.query().shardFailure().ignore()); 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 c9b5b62c1f9d1..32c697e7df9ba 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 @@ -154,15 +154,9 @@ interface ElasticsearchBackendRuntimeConfig { ElasticsearchQueryConfig query(); /** - * Whether Hibernate Search should check the version of the Elasticsearch cluster on startup. - * - * Set to `false` if the Elasticsearch cluster may not be available on startup. - * - * @asciidoclet + * Configuration for version checks on this backend. */ - @WithName("version-check.enabled") - @WithDefault("true") - boolean versionCheck(); + ElasticsearchVersionCheckConfig versionCheck(); /** * The default configuration for the Elasticsearch indexes. @@ -212,6 +206,19 @@ public String getHibernateSearchString() { } } + @ConfigGroup + interface ElasticsearchVersionCheckConfig { + /** + * Whether Hibernate Search should check the version of the Elasticsearch cluster on startup. + * + * Set to `false` if the Elasticsearch cluster may not be available on startup. + * + * @asciidoclet + */ + @WithDefault("true") + boolean enabled(); + } + @ConfigGroup interface ElasticsearchIndexRuntimeConfig { /**