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

finalclassSolrClient {
conststringDEFAULT_THREADS_SERVLET = admin/threads;
conststringDEFAULT_PING_SERVLET = admin/ping;
conststringDEFAULT_SYSTEM_SERVLET = admin/system;
public__construct(array$clientOptions)
publicaddDocument(SolrInputDocument$doc, bool$overwrite = true, int$commitWithin = 0): SolrUpdateResponse
publicaddDocuments(array$docs, bool$overwrite = true, int$commitWithin = 0): void
publiccommit(bool$softCommit = false, bool$waitSearcher = true, bool$expungeDeletes = false): SolrUpdateResponse
publicgetDebug(): string
publicgetOptions(): array
publicoptimize(int$maxSegments = 1, bool$softCommit = true, bool$waitSearcher = true): SolrUpdateResponse
publicrequest(string$raw_request): SolrUpdateResponse
publicsetResponseWriter(string$responseWriter): void
publicsetServlet(int$type, string$value): bool
publicsystem(): void
publicthreads(): void
public__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

To Top