1

構成ファイルに、とsolrconfig.xmlの間の異なる文字の数が多い場合でも複数の提案を行うために、許容範囲を調整するパラメーターはありますか? querysuggestion

私のsolrconfig.xml提案構成では、次のものがあります。

spellcheck search component: _

<lst name="spellchecker">
    <str name="name">default</str>
    <str name="field">title</str>
    <str name="classname">solr.DirectSolrSpellChecker</str>
    <!-- the spellcheck distance measure used, the default is the internal levenshtein -->
    <str name="distanceMeasure">internal</str>
    <!-- minimum accuracy needed to be considered a valid spellcheck suggestion -->
    <float name="accuracy">0.5</float>
    <!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 -->
    <int name="maxEdits">2</int>
    <!-- the minimum shared prefix when enumerating terms -->
    <int name="minPrefix">1</int>
    <!-- maximum number of inspections per result. -->
    <int name="maxInspections">5</int>
    <!-- minimum length of a query term to be considered for correction -->
    <int name="minQueryLength">4</int>
    <!-- maximum threshold of documents a query term can appear to be considered for correction -->
    <float name="maxQueryFrequency">0.01</float>
    <!-- uncomment this to require suggestions to occur in 1% of the documents
    <float name="thresholdTokenFrequency">.01</float>
  -->
</lst>

<!-- a spellchecker that can break or combine words.  See "/spell" handler below for usage -->
<lst name="spellchecker">
    <str name="name">wordbreak</str>
    <str name="classname">solr.WordBreakSolrSpellChecker</str>
    <str name="field">title</str>
    <str name="combineWords">true</str>
    <str name="breakWords">true</str>
    <int name="maxChanges">10</int>
</lst>

そして/spell request handler

<requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
    <lst name="defaults">
        <str name="df">title</str>
        <!-- Solr will use suggestions from both the 'default' spellchecker
        and from the 'wordbreak' spellchecker and combine them.
        collations (re-written queries) can include a combination of
        corrections from both spellcheckers -->
        <str name="spellcheck.dictionary">default</str>
        <str name="spellcheck.dictionary">wordbreak</str>
        <str name="spellcheck">on</str>
        <str name="spellcheck.extendedResults">true</str>
        <str name="spellcheck.count">10</str>
        <str name="spellcheck.alternativeTermCount">1000</str>
        <str name="spellcheck.maxResultsForSuggest">5</str>
        <str name="spellcheck.collate">true</str>
        <str name="spellcheck.collateExtendedResults">true</str>
        <str name="spellcheck.maxCollationTries">10</str>
        <str name="spellcheck.maxCollations">5</str>
        <str name="spellcheck.onlyMorePopular">false</str>
    </lst>
    <arr name="last-components">
        <str>spellcheck</str>
    </arr>
</requestHandler>

私の問題は、クエリごとに常に 1 つの提案しか得られないことです。例えば ​​query の場合、他に近い単語があっても候補としてrenou取得したい。renault

4

1 に答える 1

2

あなたの場合Suggester、 a の代わりに使用することをお勧めします。これは、 が 1 文字と 2 文字の変更の候補のみを生成するSpellcheckerためです。クエリで始まる単語を返します。スペルの変更がある単語を提案するには、 を使用する必要があります。SpellcheckerSuggesterFuzzySuggester

于 2013-09-19T07:40:24.783 に答える