再谈compass:集成站内搜索 - 编程入门网
/compass</prop>
<prop key="compass.transaction.factory">
org.compass.spring.transaction.SpringSyncTransactionFactory
</prop>
<!-- 定义分词器-->
<prop key="compass.engine.analyzer.MMAnalyzer.CustomAnalyzer">
org.mira.lucene.analysis.IK_CAnalyzer
</prop>
</props>
</property>
<property name="resourceDirectoryLocations">
<list>
<value>classpath:net/shopin/bean/product</value>
</list>
</property>
</bean>
<bean id="jpaGpsDevice"
class="org.compass.gps.device.jpa.JpaGpsDevice">
<property name="name">
<value>JpaGpsDevice</value>
</property>
<property name="entityManagerFactory"
ref="entityManagerFactory" />
<property name="mirrorDataChanges">
<value>true</value>
</property>
</bean>
<!-- 数据库中的数据变化后同步更新索引 -->
<bean id="compassGps" class="org.compass.gps.impl.SingleCompassGps"
init-method="start" destroy-method="stop">
<property name="compass" ref="compass" />
<property name="gpsDevices">
<list>
<bean
class="org.compass.spring.device.SpringSyncTransactionGpsDeviceWrapper">
<property name="gpsDevice" ref="jpaGpsDevice" />
</bean>
</list>
</property>
</bean>
<bean id="compassTemplate"
class="org.compass.core.CompassTemplate">
<property name="compass" ref="compass" />
</bean>
<!-- 定时重建索引(利用quartz)或随Spring ApplicationContext启动而重建索引 -->
<bean id="compassIndexBuilder"
class="net.shopin.service.search.impl.CompassIndexBuilder"
lazy-init="false">
<property name="compassGps" ref="compassGps" />
<property name="buildIndex" value="true" />
<property name="lazyTime" value="5" />
</bean>
再谈compass:集成站内搜索(5)时间:2011-01-05 javaeye lqw86683.自动建立索引的java bean Java代码
|
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |