我正在使用日光从PHP访问Solr。当我使用日光执行正常的select查询时,一切都很好。
问题:当我尝试执行MoreLikeThis查询时,在尝试执行查询时会得到以下错误。哪里出了问题,怎么解决呢?
Solr HTTP error: Not Found (404)
Location:
/home/mysite/public_html/application/libraries/Solarium/Result.php on line 98PHP代码
$client = new Solarium_Client($config);
$query = $client->createMoreLikeThis()
->setQuery('id:' . $product_id)
->setMltFields('title, description')
->setMinimumDocumentFrequency(1)
->setMinimumTermFrequency(1)
->setInterestingTerms('details')
->setMatchInclude(false)
->setRows(10);
$resultset = $client->select($query);我深入研究了Solarium_Client_Response_Object at /solarium/Client.php,发现收到的回复是
Solarium_Client_Response Object
(
[_headers:protected] => Array
(
[0] => HTTP/1.1 404 Not Found
[1] => Server: Apache-Coyote/1.1
[2] => Content-Type: text/html;charset=utf-8
[3] => Content-Length: 979
[4] => Date: Mon, 27 Aug 2012 12:03:42 GMT
[5] => Connection: close
)
[_body:protected] =>
[_statusCode:protected] => 404
[_statusMessage:protected] => Not Found
)发布于 2012-08-28 13:15:39
您需要在Solr中配置morelikethis处理程序。您可能有一个select处理程序,因此标准select可以工作。但是对于morelikethis querytype,您需要配置另一个处理程序。
有关更多信息,请参见:http://wiki.apache.org/solr/MoreLikeThisHandler
https://stackoverflow.com/questions/12141554
复制相似问题