Alex Rivera | Logout

Solr Did you mean (Spell check component)

Asked 2012-02-29T11:12:57.957
8

I use solr for my apps and i integrated the spellcheck component but i have some problems :

First : When i type a term separated by space they give me the correction for each term

Eg : "wat ters" => "what term" but the true is watters

Second : When i type some phrase with some wrong term. although the other terms are correct they apply the spell for all terms.

Eg : "Difreences in lankuage use conventions" => "Differences in language use conversions".

The true is "Differences in language use conventions"

This is my config in solrconfig.xml :

<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
            <str name="queryAnalyzerFieldType">textSpell</str>
            <lst name="spellchecker">
                <str name="name">default</str>
                <str name="field">spell</str>
                <str name="spellcheckIndexDir">spellchecker</str>
            </lst>
</searchComponent>

<requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
            <lst name="defaults">
                <str name="spellcheck.onlyMorePopular">true</str>
                <str name="spellcheck.extendedResults">false</str>
                <str name="spellcheck.count">1</str>
            </lst>
            <arr name="last-components">
                <str>spellcheck</str>
            </arr>
</requestHandler>

Schema.xml :

Field type:

<fieldType name="text" class="solr.TextField" positionIncrementGap="100">
            <analyzer type="index">
                <tokenizer class="solr.StandardTokenizerFactory"/>
                <filter cla
Edit
Report

1 Answer

2

For your first problem you could use WordBreakSpellChecker

As for your second problem you could set <str name="spellcheck.onlyMorePopular">true</str> to <str name="spellcheck.onlyMorePopular">false</str> and see if this has the expected result.

answered 2012-02-29T19:34:40.277

Your Answer