安装了Solr5.0并使用bin/solr start -e cloud启动了SOLR实例...正常的东西。web用户界面运行正常,可以看到这两个节点。
已创建一个索引文件,尝试根据Solarium文档对服务器执行ping操作:
require_once ('init.php');
$str="Running Solarium client version: ".Solarium\Client::VERSION;
$client = new Solarium\Client($config);
// create a ping query
$ping = $client->createPing();
var_dump($ping);
// execute the ping query
try {
$result = $client->ping($ping);
$str=$str.'Ping query successful';
var_dump($result->getData());
} catch (Solarium\Exception $e) {
echo 'Ping query failed';
}
return $str;$str可以使用Solarium客户端版本3.2.0来显示。
但在执行$client->ping()时,有一个例外:
Problem accessing /solr/admin/ping. Reason:
Not Found有什么提示吗?
config.php粘贴在这里:
<?php
$config = array(
'endpoint' => array(
'localhost' => array(
'host' => '10.0.0.8',
'port' => 8983,
'path' => '/solr/',
)
)
);这是一个远程连接。
发布于 2016-03-04 19:04:30
我也有同样的问题。将集合名称放在config.php中,如下所示:
'path' => '/solr/collection_name/',https://stackoverflow.com/questions/29190959
复制相似问题