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 Shalin Shekhar Mangar <sh...@gmail.com> on 2010/03/13 07:07:54 UTC

Re: Spellcheck vs SpellShingle is there a conflict?

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.