Spring Boot, Hibernate Search properties

前端 未结 2 1078
悲&欢浪女
悲&欢浪女 2021-01-03 05:29

How to provide Hibernate Search parameters when using Spring Boot?

...
spring.datasource.driverClassName=org.postgresql.Driver

hibernate.search.jmx_enabled=         


        
2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-03 06:01

    You can put them in the application.properties file if you put "spring.jpa.properties." in front of the property names.

    Example:

    spring.jpa.properties.hibernate.search.jmx_enabled=true
    spring.jpa.properties.hibernate.search.default.directory_provider=filesystem
    spring.jpa.properties.hibernate.search.generate_statistics=true
    spring.jpa.properties.hibernate.search.lucene_version=LUCENE_CURRENT
    spring.jpa.properties.hibernate.search.default.indexBase=/mypath-to-index
    

    Spring will take any properties under spring.jpa.properties.* and pass them along (with the prefix stripped) once the EntityManagerFactory is created.

提交回复
热议问题