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 roySolr <ro...@gmail.com> on 2011/05/26 12:04:49 UTC
Problem with spellchecking, dont want multiple request to SOLR
Hello,
First i will explain my situation. I have a 2 fields on my website: What and
Where.
When a user search i want spellcheck on both fields. Now i have 2
dictionaries, one for
what and one for where. I want to search with one request and spellcheck
both fields. Is
it possible and how?
--
View this message in context: http://lucene.472066.n3.nabble.com/Problem-with-spellchecking-dont-want-multiple-request-to-SOLR-tp2988167p2988167.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Problem with spellchecking, dont want multiple request to SOLR
Posted by roySolr <ro...@gmail.com>.
What should the query look like??
I can't define 2 spellchecker in one query. I want something like this:
Search: Soccerclub(what) Manchester(where)
select/?q=socerclub
macnchester&spellcheck=true&spellcheck.dictionary=spell_what&spellcheck.dictionary=spell_where&spell_what=socerclub&spell_where=macnchester
Now i have 2 spellcheckers in my requesthandler but i can't set them correct
in my query.
My config looks like this:
<arr name="last-components">
<str>spellcheck1</str>
<str>spellcheck2</str>
</arr>
<searchComponent name="spellcheck1" class="solr.SpellCheckComponent">
<lst name="spellchecker">
<str name="name">spell_what</str>
<str name="field">spell_search1</str>
<str name="buildOnOptimize">true</str>
<str name="spellcheckIndexDir">spellchecker1</str>
</lst>
</searchComponent>
<searchComponent name="spellcheck2" class="solr.SpellCheckComponent">
<lst name="spellchecker">
<str name="name">spell_where</str>
<str name="field">spell_search2</str>
<str name="buildOnOptimize">true</str>
<str name="spellcheckIndexDir">spellchecker2</str>
</lst>
</searchComponent>
--
View this message in context: http://lucene.472066.n3.nabble.com/Problem-with-spellchecking-dont-want-multiple-request-to-SOLR-tp2988167p3147545.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Problem with spellchecking, dont want multiple request to SOLR
Posted by Jan Høydahl <ja...@cominvent.com>.
Hi,
Define two searchComponents with different names. Then refer to both in <last-components> in your Search Request Handler config.
--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com
On 27. mai 2011, at 10.01, roySolr wrote:
> mm ok. I configure 2 spellcheckers:
>
> <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
> <lst name="spellchecker">
> <str name="name">spell_what</str>
> <str name="field">spell_what</str>
> <str name="buildOnOptimize">true</str>
> <str name="spellcheckIndexDir">spellchecker_what</str>
> </lst>
> <lst name="spellchecker">
> <str name="name">spell_where</str>
> <str name="field">spell_where</str>
> <str name="buildOnOptimize">true</str>
> <str name="spellcheckIndexDir">spellchecker_where</str>
> </lst>
> </searchComponent>
>
> How can i enable it in my search request handler and search both in one
> request?
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Problem-with-spellchecking-dont-want-multiple-request-to-SOLR-tp2988167p2992076.html
> Sent from the Solr - User mailing list archive at Nabble.com.
Re: Problem with spellchecking, dont want multiple request to SOLR
Posted by roySolr <ro...@gmail.com>.
mm ok. I configure 2 spellcheckers:
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
<lst name="spellchecker">
<str name="name">spell_what</str>
<str name="field">spell_what</str>
<str name="buildOnOptimize">true</str>
<str name="spellcheckIndexDir">spellchecker_what</str>
</lst>
<lst name="spellchecker">
<str name="name">spell_where</str>
<str name="field">spell_where</str>
<str name="buildOnOptimize">true</str>
<str name="spellcheckIndexDir">spellchecker_where</str>
</lst>
</searchComponent>
How can i enable it in my search request handler and search both in one
request?
--
View this message in context: http://lucene.472066.n3.nabble.com/Problem-with-spellchecking-dont-want-multiple-request-to-SOLR-tp2988167p2992076.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Problem with spellchecking, dont want multiple request to SOLR
Posted by Jan Høydahl <ja...@cominvent.com>.
Yep, it's possible. Setup two spellcheckers, one named "spellwhat" and one named "spellwhere" and enable both on your searchRequestHandler.
--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com
On 26. mai 2011, at 12.04, roySolr wrote:
> Hello,
>
> First i will explain my situation. I have a 2 fields on my website: What and
> Where.
> When a user search i want spellcheck on both fields. Now i have 2
> dictionaries, one for
> what and one for where. I want to search with one request and spellcheck
> both fields. Is
> it possible and how?
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Problem-with-spellchecking-dont-want-multiple-request-to-SOLR-tp2988167p2988167.html
> Sent from the Solr - User mailing list archive at Nabble.com.