私は、synonyms.txtファイルにスペルの間違いや訂正された単語のリストを持っています。どのように私はそれをスペルの提案のためにsolrで使うことができますか?solrのsynonyms.txtからスペル候補を取得するには?
synonyms.txtは、次のエントリが含まれています。私はSolrのサーバに「laptap」を照会すると「もしかして?:ラップトップを」と
laptap => laptop
delll => dell
、私は提案を取得する必要があります。
私はschema.xmlを、このようになります知っている:
<fieldType name="textSpell" class="solr.TextField" positionIncrementGap="100" omitNorms="true">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.StandardFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.StandardFilterFactory"/>
</analyzer>
</fieldType>
何solrconfig.xmlについて?私は既にリストを持っているのでインデックスを使用したくない。何か案が?
FileBasedSpellCheckerを作成し、インデックスの作成と同じであるフラットファイルをオフに基づいてスペリング辞書を使用します。私は訂正された単語へのスペルミスの単語のマッピングを持っており、私はこれらのマッピングを使用してインデックスで検索しません。 FileBasedSpellCheckerを使用してファイルを提案する方法がわかりません。 – qwerty
FileBasedSpellCheckerがフラットファイルからスペルチェック辞書を作成していることに気付かなかった。 –