You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by michaelnazaruk <mi...@gmail.com> on 2010/02/15 09:32:44 UTC

spellcheck all time

I have a little problem with spellcheck! I get suggestions all time even the
word is correct! I use dictionary from file! Here my configuration:
 <requestHandler name="standard" class="solr.SearchHandler" default="true">
    <!-- default values for query parameters -->
     <lst name="defaults">
       <str name="echoParams">explicit</str>
       <str name="spellcheck">true</str>
       <str name="spellcheck.dictionary">file</str>
       <str name="spellcheck.onlyMorePopular">false</str>
       <str name="spellcheck.extendedResults">false</str>      
       <str name="spellcheck.count">1</str>
       <str name="spellcheck.collate">false</str>
     </lst>     
     <arr name="last-components">
      <str>query</str>
      <str>spellcheck</str>
    </arr>
  </requestHandler>

<searchComponent name="spellcheck" class="solr.SpellCheckComponent">    
    <lst name="spellchecker">
      <str name="classname">solr.FileBasedSpellChecker</str>
      <str name="name">file</str>
      <str name="sourceLocation">spellings.txt</str>
      <str name="characterEncoding">UTF-8</str>      
      <str name="spellcheckIndexDir">./spellcheckerFile</str>      
    </lst>    
  </searchComponent>
Can anyone help me?
-- 
View this message in context: http://old.nabble.com/spellcheck-all-time-tp27590746p27590746.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: spellcheck all time

Posted by Markus Jelsma <ma...@buyways.nl>.
Although the wiki states it correctly (will also return suggestions even
if properly spelled), perhaps we should add that it's a better practice to
only present end users with suggestions if the correctlySpelled flag is
false.

This issue keeps coming back.

Chris Hostetter said:
> : I have a little problem with spellcheck! I get suggestions all time
> even the : word is correct! I use dictionary from file! Here my
> configuration:
>
> :        <str name="spellcheck.onlyMorePopular">false</str>
>
> http://wiki.apache.org/solr/SpellCheckComponent#spellcheck.onlyMorePopular
>
> -Hoss




Re: Spellcheck vs SpellShingle is there a conflict?

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Sat, Mar 13, 2010 at 3:03 AM, Barnett, Jeffrey
<je...@yale.edu>wrote:

> Can I use both for a single index?
>
> Here is my Solrconfig.xml:
> <searchComponent name="spellcheck"
> class="org.apache.solr.handler.component.SpellCheckComponent">
>    <lst name="spellchecker">
>      <str name="name">default</str>
>      <str name="field">spellingShingle</str>
>      <str name="accuracy">0.75</str>
>      <str name="spellcheckIndexDir">./spellShingle</str>
>      <str name="queryAnalyzerFieldType">textSpellShingle</str>
>      <str name="buildOnOptimize">true</str>
>    </lst>
>    <lst name="spellchecker">
>      <str name="name">basicSpell</str>
>      <str name="field">spelling</str>
>      <str name="accuracy">0.75</str>
>      <str name="spellcheckIndexDir">./spellchecker</str>
>      <str name="queryAnalyzerFieldType">textSpell</str>
>      <str name="buildOnOptimize">true</str>
>    </lst>
>  </searchComponent>
>
> What happens is the SpellShingle suggestions are offered (only if the query
> contains two or more words), but single word misspellings don't get any
> suggestions.  I'm suspicious of the two <lst name="spellchecker"> tags.  I
> can see that both indexes are built, but don't know how to verify that both
> spellcheckers are being called.
>
>
That configuration is specific to your application. The Solr's example
solrconfig does not have these two. Now, whether both of them are being used
or not depends on your application. Solr does not automatically switch
between spellcheckers. The value of the spellcheck.dictionary parameter
determines which of the two will be used. If no such parameter is sent, the
spellchecker named "default" will be used.


-- 
Regards,
Shalin Shekhar Mangar.

Spellcheck vs SpellShingle is there a conflict?

Posted by "Barnett, Jeffrey" <je...@yale.edu>.
Can I use both for a single index?

Here is my Solrconfig.xml:
<searchComponent name="spellcheck" class="org.apache.solr.handler.component.SpellCheckComponent">
    <lst name="spellchecker">
      <str name="name">default</str>
      <str name="field">spellingShingle</str>
      <str name="accuracy">0.75</str>
      <str name="spellcheckIndexDir">./spellShingle</str>
      <str name="queryAnalyzerFieldType">textSpellShingle</str>
      <str name="buildOnOptimize">true</str>
    </lst>
    <lst name="spellchecker">
      <str name="name">basicSpell</str>
      <str name="field">spelling</str>
      <str name="accuracy">0.75</str>
      <str name="spellcheckIndexDir">./spellchecker</str>
      <str name="queryAnalyzerFieldType">textSpell</str>
      <str name="buildOnOptimize">true</str>
    </lst>
  </searchComponent>

What happens is the SpellShingle suggestions are offered (only if the query contains two or more words), but single word misspellings don't get any suggestions.  I'm suspicious of the two <lst name="spellchecker"> tags.  I can see that both indexes are built, but don't know how to verify that both spellcheckers are being called.


Re: spellcheck all time

Posted by Chris Hostetter <ho...@fucit.org>.
: I have a little problem with spellcheck! I get suggestions all time even the
: word is correct! I use dictionary from file! Here my configuration:

:        <str name="spellcheck.onlyMorePopular">false</str>

http://wiki.apache.org/solr/SpellCheckComponent#spellcheck.onlyMorePopular

-Hoss