首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在compass-lucene搜索中使用分析器

如何在compass-lucene搜索中使用分析器
EN

Stack Overflow用户
提问于 2010-09-20 21:07:42
回答 1查看 612关注 0票数 0

如何在指南针中索引和搜索数据时添加指南针分析器。我正在对指南针使用基于架构的配置。我希望使用不带stopwords.Because的StandardAnalyzer我希望按原样索引数据,而不忽略and、OR、in等搜索项。默认分析器将忽略我给出的索引数据中的AND、OR、IN。

如何通过代码或xml配置snowball analyzer?如果有人能给我一个例子的话。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-12-01 09:31:10

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

代码语言:javascript
复制
<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>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3751746

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档