大家好,我正在使用休眠搜索,我现在想指定索引文件的位置,我正在通过以下方式在项目内部进行索引:
@Indexed(index="indexes/myDomainClass")
但我想知道如何将索引指定到我尝试过的应用程序之外的位置
@Indexed(index="/home/indexes/myDomainClass")
但它没有用,有什么想法吗?
大家好,我正在使用休眠搜索,我现在想指定索引文件的位置,我正在通过以下方式在项目内部进行索引:
@Indexed(index="indexes/myDomainClass")
但我想知道如何将索引指定到我尝试过的应用程序之外的位置
@Indexed(index="/home/indexes/myDomainClass")
但它没有用,有什么想法吗?
我正在使用该hibernate.search.default.indexBase
属性(在 persistence.xml 或 hibernate.cfg.xml 中)来指定索引的基本目录。
使用AnnotationSessionFactoryBean
(或任何会话工厂 bean)时,您可以通过以下方式设置各种属性:
<property name="hibernateProperties">
<util:properties>
<prop key="hibernate.search.default.indexBase">value</prop>
</util:properties>
</property>
(你需要 util: 命名空间)
xmlns:util="http://www.springframework.org/schema/util"
并在架构位置:
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd