0

如何在罗盘中索引和搜索数据时添加罗盘分析器。我正在为罗盘使用基于模式的配置。我想使用没有停用词的 StandardAnalyzer。因为我想按原样索引数据,而不忽略 AND 或 OR 等搜索词, 在 。默认分析器将忽略我为索引提供的数据中的 AND 、 OR 、 IN 。

如何通过代码或通过 xml 配置雪球分析器。如果有人可以给我举个例子。

4

1 回答 1

0

下面是示例。您还可以在此处找到更多详细信息

<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>
于 2010-12-01T01:31:09.980 回答