hello all,

The site i’m working on has to support Vietnamese and Thai languages. The user 
should be able to search in a language and Solr should be able to detect 
misspelling and suggest some corrections. The search works as expected but the 
spellcheck doesnt. Currently I’m looking to implement that for Vietnamese.

I have indexed these:
{ "term_vi":"giáo viên tiếng Anh” }, {"term_vi":"giáo viên" }

I have configured solr as the following but the spellcheck wont work for the 
language. 

<!— schema.xml —>
<fieldType name="text_spell_vi" class="solr.TextField">
     <analyzer>
         <tokenizer class="solr.StandardTokenizerFactory" />
         <filter class="solr.ASCIIFoldingFilterFactory" />
         <filter class="solr.LowerCaseFilterFactory" />
     </analyzer>
</fieldType>
<field name="term_vi" type=“text_spell_vi" />

<!—solrconfig.xml —>
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
    <str name="queryAnalyzerFieldType">text_spell_vi</str>

    <lst name="spellchecker"> 
        <str name="name">default</str>
        <str name="field">term_vi</str>
        <str name="classname">solr.DirectSolrSpellChecker</str>
        <str name="distanceMeasure">internal</str>
        <float name="accuracy">0.5</float>
        <int name="maxEdits">2</int>
        <int name="minPrefix">1</int>
        <int name="maxInspections">5</int>
        <int name="minQueryLength">5</int>
        <float name="maxQueryFrequency">0.01</float>
    </lst>
</searchComponent>

<initParams path="/query,/select">
    <lst name="defaults">
        <str name="spellcheck">on</str>
        <str name="spellcheck.dictionary">default</str>
        <str name="spellcheck.extendedResults">false</str>
        <str name="spellcheck.count">10</str>
        <str name="spellcheck.alternativeTermCount">5</str>
        <str name="spellcheck.maxResultsForSuggest">5</str>
        <str name="spellcheck.collate">false</str>
    </lst>

    <arr name="last-components">
        <str>spellcheck</str>
    </arr>
</initParams>

When I query 
http://localhost:8983/solr/search/query?q=term_vi:gio&spellcheck.q=gio
spellcheck block in the response is empty. I should expect spellcheck to 
correct that to giáo.

What am i missing?

I’ve tried out Suggester component too, using FuzzyLookupFactory and 
DocumentDictionaryFactory, but does not give the expected result. 


regards,
nuhaa

Reply via email to