* @link https://github.com/pjmazenot/phpsolr-phpdoc */ /** * (PECL solr >= 0.9.2)
* Class SolrClient
* This class is used to send requests to a Solr server. Currently, cloning and serialization of SolrClient instances is * not supported. * @link https://php.net/manual/en/class.solrclient.php */ final class SolrClient { /** @var int Used when updating the search servlet. */ public const SEARCH_SERVLET_TYPE = 1; /** @var int Used when updating the update servlet. */ public const UPDATE_SERVLET_TYPE = 2; /** @var int Used when updating the threads servlet. */ public const THREADS_SERVLET_TYPE = 4; /** @var int Used when updating the ping servlet. */ public const PING_SERVLET_TYPE = 8; /** @var int Used when updating the terms servlet. */ public const TERMS_SERVLET_TYPE = 16; /** @var int Used when retrieving system information from the system servlet. */ public const SYSTEM_SERVLET_TYPE = 32; /** @var string This is the initial value for the search servlet. */ public const DEFAULT_SEARCH_SERVLET = 'select'; /** @var string This is the initial value for the update servlet. */ public const DEFAULT_UPDATE_SERVLET = 'update'; /** @var string This is the initial value for the threads servlet. */ public const DEFAULT_THREADS_SERVLET = 'admin/threads'; /** @var string This is the initial value for the ping servlet. */ public const DEFAULT_PING_SERVLET = 'admin/ping'; /** @var string This is the initial value for the terms servlet used for the TermsComponent. */ public const DEFAULT_TERMS_SERVLET = 'terms'; /** @var string This is the initial value for the system servlet used to obtain Solr Server information. */ public const DEFAULT_SYSTEM_SERVLET = 'admin/system'; /** * (PECL solr >= 0.9.2)
* Adds a document to the index * @link https://php.net/manual/en/solrclient.adddocument.php * @param SolrInputDocument $doc

* The SolrInputDocument instance. *

* @param bool $overwrite [optional]

* Whether to overwrite existing document or not. If FALSE there will be duplicates (several documents with * the same ID). *

*
* Warning
* PECL Solr < 2.0 $allowDups was used instead of $overwrite, which does the same functionality with exact opposite * bool flag.
*
* $allowDups = false is the same as $overwrite = true *
* @param int $commitWithin [optional]

* Number of milliseconds within which to auto commit this document. Available since Solr 1.4 . Default (0) means * disabled. *

*

* When this value specified, it leaves the control of when to do the commit to Solr itself, optimizing number of * commits to a minimum while still fulfilling the update latency requirements, and Solr will automatically do a * commit when the oldest add in the buffer is due. *

* @return SolrUpdateResponse

* Returns a SolrUpdateResponse object or throws an Exception on failure. *

* @throws SolrClientException

* Throws SolrClientException if the client had failed, or there was a connection issue. *

* @throws SolrServerException

* Throws SolrServerException if the Solr Server had failed to satisfy the request. *

*/ public function addDocument(SolrInputDocument $doc, $overwrite = true, $commitWithin = 0) {} /** * (PECL solr >= 0.9.2)
* Adds a collection of SolrInputDocument instances to the index * @link https://php.net/manual/en/solrclient.adddocuments.php * @param array $docs

* An array containing the collection of SolrInputDocument instances. This array must be an actual variable. *

* @param bool $overwrite [optional]

* Whether to overwrite existing document or not. If FALSE there will be duplicates (several documents with * the same ID). *

*
* Warning
* PECL Solr < 2.0 $allowDups was used instead of $overwrite, which does the same functionality with exact opposite * bool flag.
*
* $allowDups = false is the same as $overwrite = true *
* @param int $commitWithin [optional]

* Number of milliseconds within which to auto commit this document. Available since Solr 1.4 . Default (0) means * disabled. *

*

* When this value specified, it leaves the control of when to do the commit to Solr itself, optimizing number of * commits to a minimum while still fulfilling the update latency requirements, and Solr will automatically do a * commit when the oldest add in the buffer is due. *

* @return SolrUpdateResponse

* Returns a SolrUpdateResponse object or throws an Exception on failure. *

* @throws SolrClientException

* Throws SolrClientException if the client had failed, or there was a connection issue. *

* @throws SolrServerException

* Throws SolrServerException if the Solr Server had failed to satisfy the request. *

*/ public function addDocuments(array $docs, $overwrite = true, $commitWithin = 0) {} /** * (PECL solr >= 0.9.2)
* Finalizes all add/deletes made to the index * @link https://php.net/manual/en/solrclient.commit.php * @param bool $softCommit [optional]

* This will refresh the 'view' of the index in a more performant manner, but without "on-disk" guarantees. * (Solr4.0+) *

*

* A soft commit is much faster since it only makes index changes visible and does not fsync index files or write a * new index descriptor. If the JVM crashes or there is a loss of power, changes that occurred after the last hard * commit will be lost. Search collections that have near-real-time requirements (that want index changes to be * quickly visible to searches) will want to soft commit often but hard commit less frequently. *

* @param bool $waitSearcher [optional]

* block until a new searcher is opened and registered as the main query searcher, making the changes visible. *

* @param bool $expungeDeletes [optional]

* Merge segments with deletes away. (Solr1.4+) *

* @return SolrUpdateResponse

* Returns a SolrUpdateResponse object or throws an Exception on failure. *

* @throws SolrClientException

* Throws SolrClientException if the client had failed, or there was a connection issue. *

* @throws SolrServerException

* Throws SolrServerException if the Solr Server had failed to satisfy the request. *

*/ public function commit($softCommit = false, $waitSearcher = true, $expungeDeletes = false) {} /** * (PECL solr >= 0.9.2)
* SolrClient constructor. * @link https://php.net/manual/en/solrclient.construct.php * @param array $clientOptions

* This is an array containing one of the following keys : *

* *

* Please note the if the ssl_cert file only contains the private certificate, you have to specify a separate * ssl_key file. *

*

* The ssl_keypassword option is required if the ssl_cert or ssl_key options are set. *

* @throws SolrIllegalArgumentException */ public function __construct(array $clientOptions) {} /** * (PECL solr >= 0.9.2)
* Delete by Id * @link https://php.net/manual/en/solrclient.deletebyid.php * @param string $id

* The value of the uniqueKey field declared in the schema *

* @return SolrUpdateResponse

* Returns a SolrUpdateResponse on success and throws an exception on failure. *

* @throws SolrClientException

* Throws SolrClientException if the client had failed, or there was a connection issue. *

* @throws SolrServerException

* Throws SolrServerException if the Solr Server had failed to satisfy the request. *

*/ public function deleteById($id) {} /** * (PECL solr >= 0.9.2)
* Deletes by Ids * @link https://php.net/manual/en/solrclient.deletebyids.php * @param array $ids

* An array of IDs representing the uniqueKey field declared in the schema for each document to be deleted. This * must be an actual php variable. *

* @return SolrUpdateResponse

* Returns a SolrUpdateResponse on success and throws an exception on failure. *

* @throws SolrClientException

* Throws SolrClientException if the client had failed, or there was a connection issue. *

* @throws SolrServerException

* Throws SolrServerException if the Solr Server had failed to satisfy the request. *

*/ public function deleteByIds(array $ids) {} /** * (PECL solr >= 0.9.2)
* Removes all documents matching any of the queries * @link https://php.net/manual/en/solrclient.deletebyqueries.php * @param array $queries

* The array of queries. This must be an actual php variable. *

* @return SolrUpdateResponse

* Returns a SolrUpdateResponse on success and throws an exception on failure. *

* @throws SolrClientException

* Throws SolrClientException if the client had failed, or there was a connection issue. *

* @throws SolrServerException

* Throws SolrServerException if the Solr Server had failed to satisfy the request. *

*/ public function deleteByQueries(array $queries) {} /** * (PECL solr >= 0.9.2)
* Deletes all documents matching the given query * @link https://php.net/manual/en/solrclient.deletebyquery.php * @param string $query

* The query *

* @return SolrUpdateResponse

* Returns a SolrUpdateResponse on success and throws an exception on failure. *

* @throws SolrClientException

* Throws SolrClientException if the client had failed, or there was a connection issue. *

* @throws SolrServerException

* Throws SolrServerException if the Solr Server had failed to satisfy the request. *

*/ public function deleteByQuery($query) {} /** * (PECL solr >= 0.9.2)
* Destructor for SolrClient * @link https://php.net/manual/en/solrclient.destruct.php */ public function __destruct() {} /** * (PECL solr >= 2.2.0)
* Get Document By Id. Utilizes Solr Realtime Get (RTG). * @link https://php.net/manual/en/solrclient.getbyid.php * @param string $id

* Document ID *

* @return SolrQueryResponse */ public function getById($id) {} /** * (PECL solr >= 2.2.0)
* Get Documents by their Ids. Utilizes Solr Realtime Get (RTG). * @link https://php.net/manual/en/solrclient.getbyids.php * @param array $ids

* Document ids *

* @return SolrQueryResponse */ public function getByIds(array $ids) {} /** * (PECL solr >= 0.9.7)
* Returns the debug data for the last connection attempt * @link https://php.net/manual/en/solrclient.getdebug.php * @return string

* Returns a string on success and null if there is nothing to return. *

*/ public function getDebug() {} /** * (PECL solr >= 0.9.6)
* Returns the client options set internally * @link https://php.net/manual/en/solrclient.getoptions.php * @return array

* Returns an array containing all the options for the SolrClient object set internally. *

*/ public function getOptions() {} /** * (PECL solr >= 0.9.2)
* Defragments the index * @link https://php.net/manual/en/solrclient.optimize.php * @param int $maxSegments

* Optimizes down to at most this number of segments. Since Solr 1.3 *

* @param bool $softCommit

* This will refresh the 'view' of the index in a more performant manner, but without "on-disk" guarantees. * (Solr4.0+) *

* @param bool $waitSearcher

* Block until a new searcher is opened and registered as the main query searcher, making the changes visible. *

* @return SolrUpdateResponse

* Returns a SolrUpdateResponse on success and throws an exception on failure. *

* @throws SolrClientException

* Throws SolrClientException if the client had failed, or there was a connection issue. *

* @throws SolrServerException

* Throws SolrServerException if the Solr Server had failed to satisfy the request. *

*/ public function optimize($maxSegments = 1, $softCommit = true, $waitSearcher = true) {} /** * (PECL solr >= 0.9.2)
* Checks if Solr server is still up * @link https://php.net/manual/en/solrclient.ping.php * @return SolrPingResponse

* Returns a SolrPingResponse object on success and throws an exception on failure. *

* @throws SolrClientException

* Throws SolrClientException if the client had failed, or there was a connection issue. *

* @throws SolrServerException

* Throws SolrServerException if the Solr Server had failed to satisfy the request. *

*/ public function ping() {} /** * (PECL solr >= 0.9.2)
* Sends a query to the server * @link https://php.net/manual/en/solrclient.query.php * @param SolrParams $query

* A SolrParams object. It is recommended to use SolrQuery for advanced queries. *

* @return SolrQueryResponse

* Returns a SolrUpdateResponse on success and throws an exception on failure. *

* @throws SolrClientException

* Throws SolrClientException if the client had failed, or there was a connection issue. *

* @throws SolrServerException

* Throws SolrServerException if the Solr Server had failed to satisfy the request. *

*/ public function query(SolrParams $query) {} /** * (PECL solr >= 0.9.2)
* Sends a raw update request * @link https://php.net/manual/en/solrclient.request.php * @param string $raw_request

* An XML string with the raw request to the server. *

* @return SolrUpdateResponse

* Returns a SolrUpdateResponse on success and throws an exception on failure. *

* @throws SolrIllegalArgumentException

* Throws SolrIllegalArgumentException if raw_request was an empty string. *

* @throws SolrClientException

* Throws SolrClientException if the client had failed, or there was a connection issue. *

* @throws SolrServerException

* Throws SolrServerException if the Solr Server had failed to satisfy the request. *

*/ public function request($raw_request) {} /** * (PECL solr >= 0.9.2)
* Rollbacks all add/deletes made to the index since the last commit * @link https://php.net/manual/en/solrclient.rollback.php * @return SolrUpdateResponse

* Returns a SolrUpdateResponse on success and throws an exception on failure. *

* @throws SolrClientException

* Throws SolrClientException if the client had failed, or there was a connection issue. *

* @throws SolrServerException

* Throws SolrServerException if the Solr Server had failed to satisfy the request. *

*/ public function rollback() {} /** * (PECL solr >= 0.9.11)
* Sets the response writer used to prepare the response from Solr * @link https://php.net/manual/en/solrclient.setresponsewriter.php * @param string $responseWriter

* One of the following: *

* */ public function setResponseWriter($responseWriter) {} /** * (PECL solr >= 0.9.2)
* Changes the specified servlet type to a new value * @link https://php.net/manual/en/solrclient.setservlet.php * @param int $type

* One of the following : *

* * @param string $value

* The new value for the servlet *

* @return bool

* Returns TRUE on success or FALSE on failure. *

*/ public function setServlet($type, $value) {} /** * (PECL solr >= 2.0.0)
* Retrieve Solr Server information * @link https://php.net/manual/en/solrclient.system.php * @return SolrGenericResponse

* Returns a SolrGenericResponse object on success. *

* @throws SolrClientException

* Throws SolrClientException if the client had failed, or there was a connection issue. *

* @throws SolrServerException

* Throws SolrServerException if the Solr Server had failed to satisfy the request. *

*/ public function system() {} /** * (PECL solr >= 0.9.2)
* Checks the threads status * @link https://php.net/manual/en/solrclient.threads.php * @return SolrGenericResponse

* Returns a SolrGenericResponse object on success. *

* @throws SolrClientException

* Throws SolrClientException if the client had failed, or there was a connection issue. *

* @throws SolrServerException

* Throws SolrServerException if the Solr Server had failed to satisfy the request. *

*/ public function threads() {} }