大网数据广告活动
PHP 语言与运行手册

The SolrClient class

· 52CE 我爱测

Used to send requests to a Solr server. Currently, cloning and serialization of SolrClient instances is not supported.

The SolrClient class

(PECL solr >= 0.9.2)

Introduction

Used to send requests to a Solr server. Currently, cloning and serialization of SolrClient instances is not supported.

Class synopsis

final class SolrClient {
/* Constants */
const string DEFAULT_THREADS_SERVLET = admin/threads;
const string DEFAULT_PING_SERVLET = admin/ping;
const string DEFAULT_SYSTEM_SERVLET = admin/system;
/* Methods */
public function __construct(array $clientOptions)
public function addDocument(SolrInputDocument $doc, bool $overwrite = true, int $commitWithin = 0): SolrUpdateResponse
public function addDocuments(array $docs, bool $overwrite = true, int $commitWithin = 0): void
public function commit(bool $softCommit = false, bool $waitSearcher = true, bool $expungeDeletes = false): SolrUpdateResponse
public function deleteById(string $id): SolrUpdateResponse
public function deleteByIds(array $ids): SolrUpdateResponse
public function deleteByQueries(array $queries): SolrUpdateResponse
public function deleteByQuery(string $query): SolrUpdateResponse
public function getById(string $id): SolrQueryResponse
public function getByIds(array $ids): SolrQueryResponse
public function getDebug(): string
public function getOptions(): array
public function optimize(int $maxSegments = 1, bool $softCommit = true, bool $waitSearcher = true): SolrUpdateResponse
public function ping(): SolrPingResponse
public function query(SolrParams $query): SolrQueryResponse
public function request(string $raw_request): SolrUpdateResponse
public function rollback(): SolrUpdateResponse
public function setResponseWriter(string $responseWriter): void
public function setServlet(int $type, string $value): bool
public function system(): void
public function threads(): void
public function __destruct()
}

Predefined Constants

SolrClient::SEARCH_SERVLET_TYPE

Used when updating the search servlet.

SolrClient::UPDATE_SERVLET_TYPE

Used when updating the update servlet.

SolrClient::THREADS_SERVLET_TYPE

Used when updating the threads servlet.

SolrClient::PING_SERVLET_TYPE

Used when updating the ping servlet.

SolrClient::TERMS_SERVLET_TYPE

Used when updating the terms servlet.

SolrClient::SYSTEM_SERVLET_TYPE

Used when retrieving system information from the system servlet.

SolrClient::DEFAULT_SEARCH_SERVLET

This is the initial value for the search servlet.

SolrClient::DEFAULT_UPDATE_SERVLET

This is the initial value for the update servlet.

SolrClient::DEFAULT_THREADS_SERVLET

This is the initial value for the threads servlet.

SolrClient::DEFAULT_PING_SERVLET

This is the initial value for the ping servlet.

SolrClient::DEFAULT_TERMS_SERVLET

This is the initial value for the terms servlet used for the TermsComponent

SolrClient::DEFAULT_SYSTEM_SERVLET

This is the initial value for the system servlet used to obtain Solr Server information

Table of Contents

来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
PHP Documentation Group
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。