Solr搜索形容词/名词

时间:2015-07-20 14:41:36

标签: ruby-on-rails-4 sunspot sunspot-solr

我正在使用带有edismax的Apache Solr,我正在尝试搜索以下查询:管理或执行

当我将这些查询用双引号“管理或执行”时,结果是完美的

但是当我搜索+ Administrative +或+ executive时,solr搜索Administrator,在文档中执行单词。

任何帮助都可能会受到赞赏

schema.xml中

<fieldType name="text" class="solr.TextField" omitNorms="false">
  <analyzer type="index">
    <tokenizer class="solr.PatternTokenizerFactory" pattern="[\s,\.;]+"/>
    <filter class="solr.StandardFilterFactory"/>
    <filter class="solr.LowerCaseFilterFactory"/>
    <filter class="solr.CommonGramsFilterFactory" words="stopwords.txt" ignoreCase="true"/>
    <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true" />
    <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true"/>
    <charFilter class="solr.HTMLStripCharFilterFactory"/>
    <filter class="solr.PorterStemFilterFactory"/>
  </analyzer>
  <analyzer type="query">
    <tokenizer class="solr.PatternTokenizerFactory" pattern="[\s,\.;]+"/>
    <filter class="solr.StandardFilterFactory"/>
    <filter class="solr.LowerCaseFilterFactory"/>
    <filter class="solr.CommonGramsFilterFactory" words="stopwords.txt" ignoreCase="true"/>
    <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true"/>
    <charFilter class="solr.HTMLStripCharFilterFactory"/>
    <filter class="solr.PorterStemFilterFactory"/>
  </analyzer>

0 个答案:

没有答案