gpt4 book ai didi

solr - Solarium 3.2.0 为 SOLR5.0 创建 ping

转载 作者:行者123 更新时间:2023-12-01 06:39:59 24 4
gpt4 key购买 nike

安装了 SOLR 5.0 并使用 bin/solr start -e cloud 启动了 SOLR 实例......正常的东西。 Web UI 正在运行并且可以看到这两个节点。

创建了一个索引文件,试图根据 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()时,有一个异常(exception):

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/',
)
)
);

这是一个远程连接。

最佳答案

我遇到了同样的问题。像这样将集合名称放在 config.php 中:

'path' => '/solr/collection_name/',

关于solr - Solarium 3.2.0 为 SOLR5.0 创建 ping,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29190959/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com