我正在使用 Solarium 从 PHP 访问 Solr。当我使用 Solarium 执行正常的选择查询时,一切正常。
问题:当我尝试执行 MoreLikeThis 查询时,尝试执行查询时出现以下错误。出了什么问题,如何解决?
Solr HTTP error: Not Found (404)
Location:
/home/mysite/public_html/application/libraries/Solarium/Result.php on line 98
PHP 代码
$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
)