我有一个Spring Boot应用程序v.2.3.0,它的依赖关系如下。
我的 application.properties
样子
# Enabling Actuator for all
management.endpoints.web.exposure.include=*
# Show Hibernate statistics. This works!
spring.jpa.properties.hibernate.generate_statistics=true
# Show Hibernate Search statistics. This works not!
spring.jpa.properties.hibernate.search.default.directory_provider = filesystem
spring.jpa.properties.hibernate.search.default.indexBase = /path/to/index
spring.jpa.properties.hibernate.search.generate_statistics=true
我可以在下面看到休眠的统计数据。/actuator/metrics
但休眠搜索的统计信息没有出现。你知道,我怎样才能解决这个问题吗?
我只是猜测,但是...... 在Spring中可能有一些组件将Hibernate ORM提供的统计数据转化为你的webapp上显示的东西。据我所知,Spring并没有提供任何Hibernate Search的集成,所以Hibernate Search缺少这个 "翻译 "组件,因此你看不到任何东西。
我建议你看看Hibernate ORM统计数据到底是如何出现在你的控制台上的;你可能需要为Hibernate Search实现类似的东西。