如何在指南针中索引和搜索数据时添加指南针分析器。我正在对指南针使用基于架构的配置。我希望使用不带stopwords.Because的StandardAnalyzer我希望按原样索引数据,而不忽略and、OR、in等搜索项。默认分析器将忽略我给出的索引数据中的AND、OR、IN。
如何通过代码或xml配置snowball analyzer?如果有人能给我一个例子的话。
发布于 2010-12-01 09:31:10
下面是示例。您还可以找到更多详细信息here
<comp:searchEngine useCompoundFile="false" cacheInvalidationInterval="-1">
<comp:allProperty enable="false" />
<!--
By Default, compass uses StandardAnalyzer for indexing and searching. StandardAnalyzer
will use certain stop words (stop words are not indexed and hence not searcheable) which are
valid search terms in the DataSource World. For e.g. 'in' for Indiana state, 'or' for Oregon etc.
So we need to provide our own Analyzer.
-->
<comp:analyzer name="default" type="CustomAnalyzer"
analyzerClass="com.ICStandardAnalyzer" />
<comp:analyzer name="search" type="CustomAnalyzer"
analyzerClass="com.ICStandardAnalyzer" />
<!--
Disable the optimizer as we will optimize the index as a separate batch job
Also, the merge factor is set to 1000, so that merging doesnt happen during the commit time.
Merging is a time consuming process and will be done by the batched optimizer
-->
<comp:optimizer schedule="false" mergeFactor="1000"/>
</comp:searchEngine>https://stackoverflow.com/questions/3751746
复制相似问题