spellcheck

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

spellcheck

ramzesua
Hello,all!
I have some problem with spellcheck! I download,build and connect dictionary(~500 000 words)!It work fine! But i have suggestions for any word (even correct word)! Is there possible to get suggestion only for wrong word?
Reply | Threaded
Open this post in threaded view
|

Re: spellcheck

Jan Høydahl / Cominvent
Can you show us how you configured spell check?
--
Jan Høydahl  - search architect
Cominvent AS - www.cominvent.com

On 10. feb. 2010, at 11.48, michaelnazaruk wrote:

>
> Hello,all!
> I have some problem with spellcheck! I download,build and connect
> dictionary(~500 000 words)!It work fine! But i have suggestions for any word
> (even correct word)! Is there possible to get suggestion only for wrong
> word?
> --
> View this message in context: http://old.nabble.com/spellcheck-tp27527425p27527425.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Reply | Threaded
Open this post in threaded view
|

Re: spellcheck

Markus Jelsma - Buyways B.V.
In reply to this post by ramzesua
Hi,


Did you add spellcheck.extendedResults=true to your query? This will a.o. tell
you if Solr thinks it has been spelled correctly or not. However, if you have
specified spellcheck.onlyMorePopular=true, you may get suggestions even if it
has been spelled correctly.

Don't let the onlyMorePopular directive fool you, it caught many users of
guard before :)


Cheers,

Markus Jelsma - Technisch Architect - Buyways BV
http://www.linkedin.com/in/markus17
050-8536620 / 06-50258350

Reply | Threaded
Open this post in threaded view
|

Re: spellcheck

ramzesua
In reply to this post by ramzesua

here simple query:
http://estyledesign:8983/request/select?q=popular&spellcheck=true&qt=keyrequest&spellcheck.extendedResults=true
result:
populars! but popular is correct word! Maybe i must change some properties
in solrconfig! Here my configs for keyrequest:
<requestHandler name="keyrequest" class="solr.SearchHandler">
    <lst name="defaults">
        <str name="defType">dismax</str>
      <str name="spellcheck.onlyMorePopular">true</str>
      <str name="spellcheck.extendedResults">false</str>
      <str name="spellcheck.collate">true</str>
      <str name="spellcheck.dictionary">external</str>
    </lst>
    <arr name="last-components">
        <str>query</str>
        <str>spellcheck</str>
        <str>mlt</str>
    </arr>
</requestHandler>
and search component:
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
    <str name="queryAnalyzerFieldType">textSpell</str>  
    <lst name="spellchecker">
      <str
name="classname">org.apache.solr.spelling.FileBasedSpellChecker</str>
      <str name="name">external</str>
      <str name="sourceLocation">spellings.txt</str>
      <str name="characterEncoding">UTF-8</str>
      <str name="spellcheckIndexDir">spellcheckerfile</str>
    </lst>
   </searchComponent>
--
View this message in context: http://old.nabble.com/spellcheck-tp27527425p27547926.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: spellcheck

ramzesua
In reply to this post by Jan Høydahl / Cominvent

here simple query:
http://estyledesign:8983/request/select?q=popular&spellcheck=true&qt=keyrequest&spellcheck.extendedResults=true
result:
populars! but popular is correct word! Maybe i must change some properties
in solrconfig! Here my configs for keyrequest:
<requestHandler name="keyrequest" class="solr.SearchHandler">
    <lst name="defaults">
        <str name="defType">dismax</str>
      <str name="spellcheck.onlyMorePopular">true</str>
      <str name="spellcheck.extendedResults">false</str>
      <str name="spellcheck.collate">true</str>
      <str name="spellcheck.dictionary">external</str>
    </lst>
    <arr name="last-components">
        <str>query</str>
        <str>spellcheck</str>
        <str>mlt</str>
    </arr>
</requestHandler>
and search component:
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
    <str name="queryAnalyzerFieldType">textSpell</str>  
    <lst name="spellchecker">
      <str
name="classname">org.apache.solr.spelling.FileBasedSpellChecker</str>
      <str name="name">external</str>
      <str name="sourceLocation">spellings.txt</str>
      <str name="characterEncoding">UTF-8</str>
      <str name="spellcheckIndexDir">spellcheckerfile</str>
    </lst>
   </searchComponent>

--
View this message in context: http://old.nabble.com/spellcheck-tp27527425p27548036.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: spellcheck

ramzesua
In reply to this post by Jan Høydahl / Cominvent
here simple query:
http://estyledesign:8983/request/select?q=popular&spellcheck=true&qt=keyrequest&spellcheck.extendedResults=true
result:
populars! but popular is correct word! Maybe i must change some properties in solrconfig! Here my configs for keyrequest:
<requestHandler name="keyrequest" class="solr.SearchHandler"> 
    <lst name="defaults"> 
        <str name="defType">dismax</str> 
      <str name="spellcheck.onlyMorePopular">true</str> 
      <str name="spellcheck.extendedResults">false</str> 
      <str name="spellcheck.collate">true</str> 
      <str name="spellcheck.dictionary">external</str> 
    </lst> 
    <arr name="last-components"> 
        <str>query</str> 
        <str>spellcheck</str> 
        <str>mlt</str> 
    </arr> 
</requestHandler> 
and search component:
<searchComponent name="spellcheck" class="solr.SpellCheckComponent"> 
    <str name="queryAnalyzerFieldType">textSpell</str>   
    <lst name="spellchecker"> 
      <str name="classname">org.apache.solr.spelling.FileBasedSpellChecker</str> 
      <str name="name">external</str> 
      <str name="sourceLocation">spellings.txt</str> 
      <str name="characterEncoding">UTF-8</str> 
      <str name="spellcheckIndexDir">spellcheckerfile</str> 
    </lst> 
   </searchComponent>
Reply | Threaded
Open this post in threaded view
|

Re: spellcheck

Markus Jelsma - Buyways B.V.
Hi,


Check my earlier reply. You have explicitely set onlyMorePopular to true thus
you will most likely always get suggestion even if the term was spelled
correctly. You'll only get no suggestions if the term is spelled correctly and
it is the most `popular` term.

You can opt for keeping onlyMorePopular set to true but it is then wise to
enable extendedResults so you can check the correctlySpelled boolean.


cheers,


>here simple query:
>http://estyledesign:8983/request/select?q=popular&amp;spellcheck=true&amp;qt
>=keyrequest&amp;spellcheck.extendedResults=true result:
>populars! but popular is correct word! Maybe i must change some properties
>in solrconfig! Here my configs for keyrequest:
><requestHandler name="keyrequest" class="solr.SearchHandler">
>    <lst name="defaults">
>        <str name="defType">dismax</str>
>      <str name="spellcheck.onlyMorePopular">true</str>
>      <str name="spellcheck.extendedResults">false</str>
>      <str name="spellcheck.collate">true</str>
>      <str name="spellcheck.dictionary">external</str>
>    </lst>
>    <arr name="last-components">
>        <str>query</str>
>        <str>spellcheck</str>
>        <str>mlt</str>
>    </arr>
></requestHandler>
>and search component:
><searchComponent name="spellcheck" class="solr.SpellCheckComponent">
>    <str name="queryAnalyzerFieldType">textSpell</str>
>    <lst name="spellchecker">
>      <str
>name="classname">org.apache.solr.spelling.FileBasedSpellChecker</str>
>      <str name="name">external</str>
>      <str name="sourceLocation">spellings.txt</str>
>      <str name="characterEncoding">UTF-8</str>
>      <str name="spellcheckIndexDir">spellcheckerfile</str>
>    </lst>
>   </searchComponent>
>--
>View this message in context:
> http://old.nabble.com/spellcheck-tp27527425p27548078.html Sent from the
> Solr - User mailing list archive at Nabble.com.

Markus Jelsma - Technisch Architect - Buyways BV
http://www.linkedin.com/in/markus17
050-8536620 / 06-50258350

Reply | Threaded
Open this post in threaded view
|

Re: spellcheck

ramzesua
I change config, but i get the same result!

<requestHandler name="keyrequest" class="solr.SearchHandler">
    <lst name="defaults">
        <str name="defType">dismax</str>
      <str name="spellcheck.onlyMorePopular">false</str> 
      <str name="spellcheck.extendedResults">false</str> 
      <str name="spellcheck.collate">true</str> 
      <str name="spellcheck.dictionary">external</str> 
    </lst>
    <arr name="last-components">
        <str>query</str>
        <str>spellcheck</str>
        <str>mlt</str>
    </arr>
</requestHandler>
Reply | Threaded
Open this post in threaded view
|

Re: spellcheck

Markus Jelsma - Buyways B.V.
Hi,


I see you use an `external` dictionary. I've no idea what that is and how it
works but it looks like the dictionary believe `populars!` is a term which
obviously is not equal to `popular`. If this is an external index under your
manual control; how about adding `popular` to the dictionary? And why is
`populars!` in a spellcheck dictionary; it sounds like some weird term in a
dictionary ;)


I know this is not a schema change but perhaps the following might help:
a) remove the old index
b) restarted your application server
c) reindexed your data
d) rebuilt your spellcheck index






>I change config, but i get the same result!
>
><requestHandler name="keyrequest" class="solr.SearchHandler">
>    <lst name="defaults">
>        <str name="defType">dismax</str>
>      <str name="spellcheck.onlyMorePopular">false</str>
>      <str name="spellcheck.extendedResults">false</str>
>      <str name="spellcheck.collate">true</str>
>      <str name="spellcheck.dictionary">external</str>
>    </lst>
>    <arr name="last-components">
>        <str>query</str>
>        <str>spellcheck</str>
>        <str>mlt</str>
>    </arr>
></requestHandler>

Markus Jelsma - Technisch Architect - Buyways BV
http://www.linkedin.com/in/markus17
050-8536620 / 06-50258350

Reply | Threaded
Open this post in threaded view
|

Re: spellcheck

ramzesua
I try to config spellcheck, but I still have this problem:
Config:
<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 name="/spell" class="solr.SearchHandler" lazy="true">
    <lst name="file">
      <str name="spellcheck.onlyMorePopular">false</str>
      <str name="spellcheck.extendedResults">false</str>
      <str name="spellcheck.count">1</str>
      <str name="spellcheck">true</str>
      <str name="spellcheck.dictionary">file</str>
    </lst>
    <arr name="last-components">
      <str>spellcheck</str>
    </arr>
  </requestHandler>

Maybe I have this result because I work with dictionary? I have the same problem: for 'popular' i get 'populars'
Reply | Threaded
Open this post in threaded view
|

Re: spellcheck

Hasnain
Hi,
   
   Im facing the same problem, did anyone find a solution?
Reply | Threaded
Open this post in threaded view
|

Re: spellcheck

hacene
In reply to this post by ramzesua
try to remove those in the configuration