首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

SolrClient (class)

Introduction

(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 integer SEARCH_SERVLET_TYPE = 1 ;

const integer UPDATE_SERVLET_TYPE = 2 ;

const integer THREADS_SERVLET_TYPE = 4 ;

const integer PING_SERVLET_TYPE = 8 ;

const integer TERMS_SERVLET_TYPE = 16 ;

const integer 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 */

代码语言:javascript
复制
public SolrUpdateResponse addDocument ( SolrInputDocument $doc [, bool $overwrite = true [, int $commitWithin = 0 ]] )
代码语言:javascript
复制
public void addDocuments ( array $docs [, bool $overwrite = true [, int $commitWithin = 0 ]] )
代码语言:javascript
复制
public SolrUpdateResponse commit ([ bool $softCommit = false [, bool $waitSearcher = true [, bool $expungeDeletes = false ]]] )
代码语言:javascript
复制
public __construct ( array $clientOptions )
代码语言:javascript
复制
public SolrUpdateResponse deleteById ( string $id )
代码语言:javascript
复制
public SolrUpdateResponse deleteByIds ( array $ids )
代码语言:javascript
复制
public SolrUpdateResponse deleteByQueries ( array $queries )
代码语言:javascript
复制
public SolrUpdateResponse deleteByQuery ( string $query )
代码语言:javascript
复制
public void __destruct ( void )
代码语言:javascript
复制
public SolrQueryResponse getById ( string $id )
代码语言:javascript
复制
public SolrQueryResponse getByIds ( array $ids )
代码语言:javascript
复制
public string getDebug ( void )
代码语言:javascript
复制
public array getOptions ( void )
代码语言:javascript
复制
public SolrUpdateResponse optimize ([ int $maxSegments = 1 [, bool $softCommit = true [, bool $waitSearcher = true ]]] )
代码语言:javascript
复制
public SolrPingResponse ping ( void )
代码语言:javascript
复制
public SolrQueryResponse query ( SolrParams $query )
代码语言:javascript
复制
public SolrUpdateResponse request ( string $raw_request )
代码语言:javascript
复制
public SolrUpdateResponse rollback ( void )
代码语言:javascript
复制
public void setResponseWriter ( string $responseWriter )
代码语言:javascript
复制
public bool setServlet ( int $type , string $value )
代码语言:javascript
复制
public void system ( void )
代码语言:javascript
复制
public void threads ( void )

}

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 intial value for the search servlet.

SolrClient::DEFAULT_UPDATE_SERVLET

This is the intial value for the update servlet.

SolrClient::DEFAULT_THREADS_SERVLET

This is the intial value for the threads servlet.

SolrClient::DEFAULT_PING_SERVLET

This is the intial value for the ping servlet.

SolrClient::DEFAULT_TERMS_SERVLET

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

SolrClient::DEFAULT_SYSTEM_SERVLET

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

Table of Contents

  • SolrClient::addDocument — Adds a document to the index
  • SolrClient::addDocuments — Adds a collection of SolrInputDocument instances to the index
  • SolrClient::commit — Finalizes all add/deletes made to the index
  • SolrClient::__construct — Constructor for the SolrClient object
  • SolrClient::deleteById — Delete by Id
  • SolrClient::deleteByIds — Deletes by Ids
  • SolrClient::deleteByQueries — Removes all documents matching any of the queries
  • SolrClient::deleteByQuery — Deletes all documents matching the given query
  • SolrClient::__destruct — Destructor for SolrClient
  • SolrClient::getById — Get Document By Id. Utilizes Solr Realtime Get (RTG).
  • SolrClient::getByIds — Get Documents by their Ids. Utilizes Solr Realtime Get (RTG).
  • SolrClient::getDebug — Returns the debug data for the last connection attempt
  • SolrClient::getOptions — Returns the client options set internally
  • SolrClient::optimize — Defragments the index
  • SolrClient::query — Sends a query to the server
  • SolrClient::request — Sends a raw update request
  • SolrClient::rollback — Rollbacks all add/deletes made to the index since the last commit
  • SolrClient::setResponseWriter — Sets the response writer used to prepare the response from Solr
  • SolrClient::setServlet — Changes the specified servlet type to a new value
  • SolrClient::system — Retrieve Solr Server information
  • SolrClient::threads — Checks the threads status

← SolrObject::offsetUnset

SolrClient::addDocument →

代码语言:txt
复制
 ? 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com