Solr HTTP错误:未找到(404)使用日光浴场

时间:2012-08-27 11:58:41

标签: php solr lucene solarium

我正在使用Solarium从PHP访问Solr。当我使用日光浴室执行正常的选择查询时,一切正常。

问题:当我尝试执行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探测/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
)

1 个答案:

答案 0 :(得分:0)

您需要在Solr中配置morelikethis处理程序。您可能有一个选择处理程序,因此标准选择有效。但是对于morelikethis querytype,您需要配置另一个处理程序。

有关详细信息,请参阅:http://wiki.apache.org/solr/MoreLikeThisHandler