PHP 8.1.0 Beta 1 available for testing

The SolrClient class

(PECL solr >= 0.9.2)


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

Class synopsis

final SolrClient {
/* Constants */
const int SEARCH_SERVLET_TYPE = 1 ;
const int UPDATE_SERVLET_TYPE = 2 ;
const int THREADS_SERVLET_TYPE = 4 ;
const int PING_SERVLET_TYPE = 8 ;
const int TERMS_SERVLET_TYPE = 16 ;
const int SYSTEM_SERVLET_TYPE = 32 ;
const string DEFAULT_SEARCH_SERVLET = select ;
const string DEFAULT_UPDATE_SERVLET = update ;
const string DEFAULT_THREADS_SERVLET = admin/threads ;
const string DEFAULT_PING_SERVLET = admin/ping ;
const string DEFAULT_TERMS_SERVLET = terms ;
const string DEFAULT_SYSTEM_SERVLET = admin/system ;
/* Methods */
public addDocument(SolrInputDocument $doc, bool $overwrite = true, int $commitWithin = 0): SolrUpdateResponse
public addDocuments(array $docs, bool $overwrite = true, int $commitWithin = 0): void
public commit(bool $softCommit = false, bool $waitSearcher = true, bool $expungeDeletes = false): SolrUpdateResponse
public __construct(array $clientOptions)
public deleteById(string $id): SolrUpdateResponse
public deleteByIds(array $ids): SolrUpdateResponse
public deleteByQueries(array $queries): SolrUpdateResponse
public deleteByQuery(string $query): SolrUpdateResponse
public __destruct(): void
public getById(string $id): SolrQueryResponse
public getByIds(array $ids): SolrQueryResponse
public getDebug(): string
public getOptions(): array
public optimize(int $maxSegments = 1, bool $softCommit = true, bool $waitSearcher = true): SolrUpdateResponse
public request(string $raw_request): SolrUpdateResponse
public setResponseWriter(string $responseWriter): void
public setServlet(int $type, string $value): bool
public system(): void
public threads(): void

Predefined Constants


Used when updating the search servlet.


Used when updating the update servlet.


Used when updating the threads servlet.


Used when updating the ping servlet.


Used when updating the terms servlet.


Used when retrieving system information from the system servlet.


This is the initial value for the search servlet.


This is the initial value for the update servlet.


This is the initial value for the threads servlet.


This is the initial value for the ping servlet.


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


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

Table of Contents

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top