I am trying to use Soalarium suggester with custom handler. This is my php code:
$client = SolrClient::create();
$query = $client->createSuggester();
$query->setHandler("suggest_custom");
$query->setQuery("store");
$rq = $client->createRequest($query);
$debugInfo["requestUri"] = urldecode($rq->getUri());
$resultset = $client->execute($query);
The code executes, but it always returns empty result set. I echoed the request URL and it looks like this:
suggest_custom?omitHeader=true&wt=json&json.nl=flat&suggest=true&suggest.q=store&suggest.build=false&suggest.reload=false
I think the problem is that query is set as suggest.q=store
instead of q=store
. If I manually open suggest_custom?q.op=OR&q=store&rows=200
link, than it work as expected.
Ideally I would only send suggest_custom?q.op=OR&q=store&rows=200
to Solr server.
Any idea how to use suggester with custom handlers? This is my handler for completion:
<requestHandler name="/suggest_custom" class="org.apache.solr.handler.component.SearchHandler">
<lst name="defaults">
<str name="wt">json</str>
<str name="defType">edismax</str>
<str name="rows">5</str>
<str name="fl">categoryAutocompleteExactMatch</str>
<str name="qf">categoryAutocompleteExactMatch^10 categoryAutocomplete</str>
</lst>
</requestHandler>