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/10 11:48:23 UTC
spellcheck
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.
Re: spellcheck
Posted by michaelnazaruk <mi...@gmail.com>.
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.
Re: spellcheck
Posted by michaelnazaruk <mi...@gmail.com>.
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? For request
'popular' I still get 'populars', but in dictionary I have popular and
populars!
--
View this message in context: http://old.nabble.com/spellcheck-tp27527425p27562959.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: spellcheck
Posted by Hasnain <ha...@hotmail.com>.
Hi,
Im facing the same problem, did anyone find a solution?
--
View this message in context: http://lucene.472066.n3.nabble.com/spellcheck-tp506116p2140923.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: spellcheck
Posted by Markus Jelsma <ma...@buyways.nl>.
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
Re: spellcheck
Posted by michaelnazaruk <mi...@gmail.com>.
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>
--
View this message in context: http://old.nabble.com/spellcheck-tp27527425p27550755.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: spellcheck
Posted by Markus Jelsma <ma...@buyways.nl>.
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&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-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
Re: spellcheck
Posted by michaelnazaruk <mi...@gmail.com>.
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-tp27527425p27548078.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: spellcheck
Posted by michaelnazaruk <mi...@gmail.com>.
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.
Re: spellcheck
Posted by Jan Høydahl / Cominvent <ja...@cominvent.com>.
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.
>
Re: spellcheck
Posted by Markus Jelsma <ma...@buyways.nl>.
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