Spring + Compass + paoding配置
Spring + Compass + paoding配置:
compass.cfg.xml
1.<?xml version=”1.0″ encoding=”UTF-8″?>
2.<compass-core-config
3. xmlns=”http://www.compass-project.org/schema/core-config”
4. xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
5. xsi:schemaLocation=”http://www.compass-project.org/schema/core-config
6. http://www.compass-project.org/schema/compass-core-config-2.2.xsd”>
7.
8. <compass name=”default”>
9. <connection>
10. <file path=”C:/target” />
11. </connection>
12.
13. <searchEngine>
14. <analyzer name=”MyAnalyzer” type=”CustomAnalyzer”
15. analyzerClass=”net.paoding.analysis.analyzer.PaodingAnalyzer”>
16. </analyzer>
17. </searchEngine>
18. </compass>
19.
20.</compass-core-config>
applicationContext.xml
1.<bean id=”compass” class=”org.compass.spring.LocalCompassBean” p:configLocation=”classpath:compass.cfg.xml”
2. p:transactionManager-ref=”transactionManager”>
3. <property name=”resourceLocations”>
4. <list>
5. <value>classpath:xxx/POJO.cmd.xml</value>
6. <value>classpath:xxx/POJO.cpm.xml</value>
7. </list>
8. </property>
9. <property name=”compassSettings”>
10. <props>
11. <!–
12. <prop key=”compass.engine.connection”>C:/target</prop>
13. <prop key=”compass.engine.analyzer.default.type”>net.paoding.analysis.analyzer.PaodingAnalyzer</prop>
14. –>
15. <prop key=”compass.transaction.factory”>org.compass.spring.transaction.SpringSyncTransactionFactory</prop>
16. </props>
17. </property>
18. </bean>
上面的注释部分其实和compass.cfg.xml文件效果是一样的。我们可以去掉p:configLocation属性以及compass.cfg.xml文件,打开上画的注释,运行的结果是一致的。