Unresolvable wrong enum field replaced with correct drop_and_create
Wrong drop-and-create field of SchemaManagementStrategyName used in the application.properties file, it can not be resolved
Hi @gsmet,
The quarkus.hibernate-search.schema-management.strategy key takes one of the values of the org.hibernate.search.mapper.orm.schema.management.SchemaManagementStrategyName which is enum.
The enum constants are
- CREATE
- CREATE_OR_UPDATE
- DROP_AND_CREATE
- DROP_AND_CREATE_AND_DROP
- NONE
- VALIDATE
Because it should work and the tests are passing.
Yes, synchronization works as expected and tests are passing but the key value is wrong.
I have tried in various scenarios re-indexing with correct and incorrect values at my local. I observed that while the key not being defined caused an exception(for example org.hibernate.search.util.common.SearchException, Missing property mapping), its value had no effect on the expected correct behavior.
In addition, although the value of the quarkus.hibernate-search.schema-management.strategy key is drop-and-create, the log output shows the value of the hibernate.search.schema_management.strategy is DROP_AND_CREATE.
DEBUG [org.hib.int.SessionFactoryImpl] (Quarkus Main Thread) Instantiating session factory with properties: {hibernate.search.automatic_indexing.enable_dirty_check=true, hibernate.dialect=io.quarkus.hibernate.orm.runtime.dialect.QuarkusPostgreSQL10Dialect, hibernate.search.query.loading.cache_lookup.strategy=SKIP, hibernate.search.backend.max_connections=20, hibernate.cache.use_query_cache=true, hibernate.hbm2ddl.charset_name=UTF-8, hibernate.xml_mapping_enabled=false, hibernate.search.backend.type=elasticsearch, hibernate.search.query.loading.fetch_size=100, hibernate.search.backend.discovery.enabled=false, hibernate.ejb.persistenceUnitName=
, hibernate.search.backend.read_timeout=30000, hibernate.search.backend.version=7, hibernate.search.integration_partial_build_state=org.hibernate.search.mapper.orm.bootstrap.impl.HibernateOrmIntegrationBooterImpl$HibernateOrmIntegrationPartialBuildState@1a8a057f, hibernate.order_updates=true, hibernate.search.backend.analysis.configurer=org.acme.hibernate.search.elasticsearch.config.AnalysisConfigurer, javax.persistence.sharedCache.mode=ENABLE_SELECTIVE, hibernate.search.backend.schema_management.minimal_required_status=YELLOW, hibernate.allow_update_outside_transaction=false, hibernate.search.backend.protocol=http, hibernate.bytecode.allow_enhancement_as_proxy=true, hibernate.search.automatic_indexing.synchronization.strategy=sync, javax.persistence.schema-generation.database.action=drop-and-create, javax.persistence.create-database-schemas=false, hibernate.search.schema_management.strategy=DROP_AND_CREATE, hibernate.search.backend.connection_timeout=1000, hibernate.cache.use_reference_entries=true, hibernate.cache.use_second_level_cache=true, hibernate.search.reflection.strategy=JAVA_LANG_REFLECT, hibernate.jdbc.wrap_result_sets=false, hibernate.temp.use_jdbc_metadata_defaults=false, hibernate.transaction.coordinator_class=class org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorBuilderImpl, hibernate.search.backend.max_connections_per_route=10, hibernate.connection.provider_disables_autocommit=true, hibernate.connection.datasource=io.agroal.pool.DataSource@5eb18c93, hibernate.hbm2ddl.import_files=import.sql, hibernate.cache.region.factory_class=org.infinispan.quarkus.hibernate.cache.QuarkusInfinispanRegionFactory, hibernate.search.backend.hosts=[localhost:9200]}
Yes, we automatically convert the value.