2

複数の単語のフレーズに対する solr スペルチェックの提案に問題があります。「赤唐辛子」のクエリで

q=red+chillies&wt=xml&indent=true&spellcheck=true&spellcheck.extendedResults=true&spellcheck.collate=true

私は得る

<lst name="suggestions">
  <lst name="chillies">
    <int name="numFound">2</int>
    <int name="startOffset">4</int>
    <int name="endOffset">12</int>
    <int name="origFreq">0</int>
    <arr name="suggestion">
      <lst><str name="word">chiller</str><int name="freq">4</int></lst>
      <lst><str name="word">challis</str><int name="freq">2</int></lst>
    </arr>
  </lst>
  <bool name="correctlySpelled">false</bool>
  <str name="collation">red chiller</str>
</lst>

問題は、'chiller' にはインデックスに 4 つの結果があるにもかかわらず、'red chiller' には何もないことです。そのため、結果が 0 のフレーズを提案することになります。

スペルチェックをフレーズ全体でのみ機能させるにはどうすればよいですか? クエリで KeywordTokenizerFactory を使用してみました:

<fieldType name="text_spell" class="solr.TextField" positionIncrementGap="100">
  <analyzer type="index">
    <tokenizer class="solr.StandardTokenizerFactory" />
    <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
    <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/> 
    <filter class="solr.LowerCaseFilterFactory" />
  </analyzer>
  <analyzer type="query">
    <tokenizer class="solr.KeywordTokenizerFactory" />
    <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
    <filter class="solr.LowerCaseFilterFactory" />
  </analyzer>
</fieldType>

そして、私も追加しようとしました

<str name="sp.query.extendedResults">false</str>

内部

<lst name="spellchecker">

solrconfig.xml で。

しかし、どちらも違いはないようです。

スペルチェックでフレーズ全体の結果が得られる照合のみを行う最良の方法は何でしょうか? ありがとう!

4

1 に答える 1