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 asthman <do...@gmail.com> on 2014/05/30 07:46:20 UTC

solr spellcheck suggest correct word when FileBasedSpellChecker

solrconfig.xml:

<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> 

<requestHandler class="solr.SearchHandler" name="/spell_test">
    <lst name="defaults">
       <str name="spellcheck.dictionary">file</str>
       <str name="spellcheck.count">5</str>
    </lst>
    <arr name="last-components">
       <str>spellcheck</str>
    </arr>
</requestHandler>


spellings.txt:

apple
apples
apple's
applet
applets
appliers


1) http://192.168.1.99:8983/solr/spell_test?spellcheck.build=true  # build
dict
2)
http://192.168.1.99:8983/solr/spell_test?spellcheck.q=apples&spellcheck=true

results:
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">46</int>
</lst>
<result name="response" numFound="0" start="0"/>
<lst name="spellcheck">
<lst name="suggestions">
<lst name="apples">
<int name="numFound">5</int>
<int name="startOffset">0</int>
<int name="endOffset">6</int>
<arr name="suggestion">
<str>apple's</str>
<str>applets</str>
<str>applies</str>
<str>dapples</str>
<str>applet</str>
</arr>
</lst>
</lst>
</lst>
</response>



apple is correct word, i don't want get suggestions.






--
View this message in context: http://lucene.472066.n3.nabble.com/solr-spellcheck-suggest-correct-word-when-FileBasedSpellChecker-tp4138769.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: solr spellcheck suggest correct word when FileBasedSpellChecker

Posted by Alessandro Benedetti <ab...@apache.org>.
Taking a look into the code :
The spellcheck.alternativeTermCount Parameter

Specify the number of suggestions to return for each query term existing in
the index and/or dictionary. Presumably, users will want fewer suggestions
for words with docFrequency>0. Also setting this value turns "on"
context-sensitive spell suggestions.


This parameter , if set to 0, should basically avoid suggestions if you get
a correctly spelled term.

The default value is 0 for that.

So it is weird you get the suggestions, you could debug that bit and see,
unfortunately I don't have time right now !


Cheers


On Sat, Jun 11, 2016 at 1:11 AM, khawar yunus <kh...@gmail.com> wrote:

> I am in the same boat as you.  did you figure out why it does that?
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/solr-spellcheck-suggest-correct-word-when-FileBasedSpellChecker-tp4138769p4281821.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
--------------------------

Benedetti Alessandro
Visiting card : http://about.me/alessandro_benedetti

"Tyger, tyger burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?"

William Blake - Songs of Experience -1794 England

Re: solr spellcheck suggest correct word when FileBasedSpellChecker

Posted by khawar yunus <kh...@gmail.com>.
I am in the same boat as you.  did you figure out why it does that?



--
View this message in context: http://lucene.472066.n3.nabble.com/solr-spellcheck-suggest-correct-word-when-FileBasedSpellChecker-tp4138769p4281821.html
Sent from the Solr - User mailing list archive at Nabble.com.