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 Peter Gabriel <za...@gmx.net> on 2010/05/05 10:56:18 UTC
PECL and Spellchecking
Hi there,
i´m working with the solr-pecl extension and asking me how I to permanently activate spellchecking.
I couldn´t find a command from the pecl library to activate it by the client - like $solrQuery->enableFacet(true) for factes.
Or is it possible to keep spellchecking permanently activate by solrconfig? Without using the "&spellcheck=true" parameters?
Would be nice if someone could help me.
Thx and greetings,
Peter
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
Re: PECL and Spellchecking
Posted by Israel Ekpo <is...@gmail.com>.
Hi Peter
A full list of spell check parameters are available here
http://wiki.apache.org/solr/SpellCheckComponent
With the PECL extension, there is currently no special method that handles
the spell check component so you would have to use the SolrParams::set() or
SolrParams::setParam() method available from the SolrQuery class (a child of
the SolrParams class)
Below is the code snippet :
$options = array of options for solr client (name => value pairs); see
SolrClient::__construct()
$client = new SolrClient($options);
$spellcheck_component_name = 'spell';
$client->setServlet(SolrClient::SEARCH_SERVLET_TYPE,
$spellcheck_component_name);
$q = new SolrQuery();
$q->set($param_name, $param_value);
$q->setParam($param_name, $param_value);
$q->set('spellcheck', 'true');
$q->set('spellcheck.q', 'pecl');
$q->set('spellcheck.build', 'true');
$response = $client->query($q);
That should do it.
I hope this helps.
On Wed, May 5, 2010 at 4:56 AM, Peter Gabriel <za...@gmx.net> wrote:
> Hi there,
>
> i´m working with the solr-pecl extension and asking me how I to permanently
> activate spellchecking.
> I couldn´t find a command from the pecl library to activate it by the
> client - like $solrQuery->enableFacet(true) for factes.
>
> Or is it possible to keep spellchecking permanently activate by solrconfig?
> Without using the "&spellcheck=true" parameters?
>
> Would be nice if someone could help me.
>
> Thx and greetings,
> Peter
> --
> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>
--
"Good Enough" is not good enough.
To give anything less than your best is to sacrifice the gift.
Quality First. Measure Twice. Cut Once.
http://www.israelekpo.com/