hacioguz / solr-php-client

Automatically exported from code.google.com/p/solr-php-client
Other
0 stars 0 forks source link

Search handler resolution #92

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
According to Solr Wiki 
(http://wiki.apache.org/solr/SolrRequestHandler#Handler_Resolution) the 
preferred way to select a search handler is not using the qt parameter anymore

http://localhost:8983/solr/select?qt=foo&...

but use a specific url 

http://localhost:8983/solr/foo?...

How to do this ?

My dirty workaround is to still use the qt parameter but  rebuild the url in 
the search method.

        if (!empty($params['qt'])) {
            $url = $this->_constructUrl($params['qt']);
            unset($params['qt']);               
        } else {
            $url = $this->_searchUrl;
        }

        if ($method == self::METHOD_GET)
        {
            return $this->_sendRawGet($url . $this->_queryDelimiter . $queryString);
        }
        else if ($method == self::METHOD_POST)
        {
            return $this->_sendRawPost($url, $queryString, FALSE, 'application/x-www-form-urlencoded; charset=UTF-8');
        }

Original issue reported on code.google.com by dbej...@gmail.com on 22 Feb 2013 at 11:12

GoogleCodeExporter commented 9 years ago
May be I should have use the mailling list first. Sorry.

Original comment by dbej...@gmail.com on 22 Feb 2013 at 11:29