compass设置中文
时间: 2023-08-28 07:07:40 浏览: 216
在compass的配置中设置中文,可以使用paoding分析器。在spring配置文件中,添加以下的配置:
```xml
<property name="compassSettings">
<props>
<prop key="compass.engine.connection">file://c:/compass</prop>
<prop key="compass.transaction.factory">org.compass.spring.transaction.SpringSyncTransactionFactory</prop>
<prop key="compass.engine.analyzer.default.type">net.paoding.analysis.analyzer.PaodingAnalyzer</prop>
</props>
</property>
```
同时,在classpath下创建`paoding-dic-home.properties`文件,文件内容只需要一句话:
```properties
paoding.dic.home=e:/paoding
```
然后,在`e:/paoding`目录下创建自己的词典文件`*.dic`。完成这些配置后,compass就可以正确处理中文了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [compass配置paoding中文分词器](https://blog.csdn.net/xly_971223/article/details/83291889)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [MongoDB可视化工具Compass的使用](https://blog.csdn.net/LTuantuan/article/details/80281079)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文