solariun/solarium-cloud

PHP SolrCloud 客户端

dev-master 2022-08-01 08:12 UTC

This package is not auto-updated.

Last update: 2024-09-19 18:03:40 UTC


README

Solarium 扩展,通过 Apache Zookeeper 连接到 SolrCloud。

此扩展已弃用。Solarium 本身现在直接支持 Solr Cloud 和其 API。

要求

该扩展需要 PHP Zookeeper 扩展,可以在以下地址找到:https://pecl.php.net/package/zookeeper

为了编译此扩展,您需要安装 Apache Zookeeper C 库。有关如何构建扩展的说明,请参阅以下地址:https://github.com/php-zookeeper/php-zookeeper

使用示例

您可以使用以下代码创建 CloudClient:

    <?php
    
    $options = array('zkhosts' => 'localhost:2181');
    $client = new \Solarium\Cloud\Client($options);
    
    $client->setCollection('collection1');
    $query = $client->createSelect();
    $result = $client->select($query);