Class Apache_Solr_Service_Balancer

Description

Reference Implementation for using multiple Solr services in a distribution. Functionality

includes: routing of read / write operations failover (on selection) for multiple read servers

Located in /Service/Balancer.php (line 31)


	
			
Variable Summary
Method Summary
Apache_Solr_Service_Balancer __construct ([array $readableServices = array()], [array $writeableServices = array()])
Apache_Solr_Response add (string $rawPost)
Apache_Solr_Response addDocument (Apache_Solr_Document $document, [boolean $allowDups = false], [boolean $overwritePending = true], [boolean $overwriteCommitted = true])
Apache_Solr_Response addDocuments (array $documents, [boolean $allowDups = false], [boolean $overwritePending = true], [boolean $overwriteCommitted = true])
void addReadService (mixed $service)
void addWriteService (mixed $service)
Apache_Solr_Response commit ([boolean $waitFlush = true], [boolean $waitSearcher = true])
Apache_Solr_Response delete (string $rawPost)
Apache_Solr_Response deleteById (string $id, [boolean $fromPending = true], [boolean $fromCommitted = true])
Apache_Solr_Response deleteByQuery (string $rawQuery, [boolean $fromPending = true], [boolean $fromCommitted = true])
Apache_Solr_Response optimize ([boolean $waitFlush = true], [boolean $waitSearcher = true])
void removeReadService (mixed $service)
void removeWriteService (mixed $service)
Apache_Solr_Response search (string $query, [int $offset = 0], [int $limit = 10], [array $params = array()])
void setReadPingTimeout ( $timeout)
void setWritePingTimetou ( $timeout)
Variables
mixed $_currentReadService = null (line 36)
  • access: protected
mixed $_currentWriteService = null (line 37)
  • access: protected
mixed $_readableServices = array() (line 33)
  • access: protected
mixed $_readPingTimeout = 0.01 (line 39)
  • access: protected
mixed $_writeableServices = array() (line 34)
  • access: protected
mixed $_writePingTimeout = 1 (line 40)
  • access: protected
Methods
Constructor __construct (line 48)

Constructor. Takes arrays of read and write service instances or descriptions

  • access: public
Apache_Solr_Service_Balancer __construct ([array $readableServices = array()], [array $writeableServices = array()])
  • array $readableServices
  • array $writeableServices
add (line 293)

Raw Add Method. Takes a raw post body and sends it to the update service. Post body should be a complete and well formed "add" xml document.

  • throws: Exception If an error occurs during the service call
  • access: public
Apache_Solr_Response add (string $rawPost)
  • string $rawPost
addDocument (line 311)

Add a Solr Document to the index

  • throws: Exception If an error occurs during the service call
  • access: public
Apache_Solr_Response addDocument (Apache_Solr_Document $document, [boolean $allowDups = false], [boolean $overwritePending = true], [boolean $overwriteCommitted = true])
  • Apache_Solr_Document $document
  • boolean $allowDups
  • boolean $overwritePending
  • boolean $overwriteCommitted
addDocuments (line 329)

Add an array of Solr Documents to the index all at once

  • throws: Exception If an error occurs during the service call
  • access: public
Apache_Solr_Response addDocuments (array $documents, [boolean $allowDups = false], [boolean $overwritePending = true], [boolean $overwriteCommitted = true])
  • array $documents: Should be an array of Apache_Solr_Document instances
  • boolean $allowDups
  • boolean $overwritePending
  • boolean $overwriteCommitted
addReadService (line 94)

Adds a service instance or service descriptor (if it is already not added)

  • throws: Exception If service descriptor is not valid
  • access: public
void addReadService (mixed $service)
  • mixed $service
addWriteService (line 158)

Adds a service instance or service descriptor (if it is already not added)

  • throws: Exception If service descriptor is not valid
  • access: public
void addWriteService (mixed $service)
  • mixed $service
commit (line 346)

Send a commit command. Will be synchronous unless both wait parameters are set to false.

  • throws: Exception If an error occurs during the service call
  • access: public
Apache_Solr_Response commit ([boolean $waitFlush = true], [boolean $waitSearcher = true])
  • boolean $waitFlush
  • boolean $waitSearcher
delete (line 362)

Raw Delete Method. Takes a raw post body and sends it to the update service. Body should be a complete and well formed "delete" xml document

  • throws: Exception If an error occurs during the service call
  • access: public
Apache_Solr_Response delete (string $rawPost)
  • string $rawPost
deleteById (line 379)

Create a delete document based on document ID

  • throws: Exception If an error occurs during the service call
  • access: public
Apache_Solr_Response deleteById (string $id, [boolean $fromPending = true], [boolean $fromCommitted = true])
  • string $id
  • boolean $fromPending
  • boolean $fromCommitted
deleteByQuery (line 396)

Create a delete document based on a query and submit it

  • throws: Exception If an error occurs during the service call
  • access: public
Apache_Solr_Response deleteByQuery (string $rawQuery, [boolean $fromPending = true], [boolean $fromCommitted = true])
  • string $rawQuery
  • boolean $fromPending
  • boolean $fromCommitted
optimize (line 413)

Send an optimize command. Will be synchronous unless both wait parameters are set to false.

  • throws: Exception If an error occurs during the service call
  • access: public
Apache_Solr_Response optimize ([boolean $waitFlush = true], [boolean $waitSearcher = true])
  • boolean $waitFlush
  • boolean $waitSearcher
removeReadService (line 124)

Removes a service instance or descriptor from the available services

  • throws: Exception If service descriptor is not valid
  • access: public
void removeReadService (mixed $service)
  • mixed $service
removeWriteService (line 188)

Removes a service instance or descriptor from the available services

  • throws: Exception If service descriptor is not valid
  • access: public
void removeWriteService (mixed $service)
  • mixed $service
search (line 431)

Simple Search interface

  • throws: Exception If an error occurs during the service call
  • access: public
Apache_Solr_Response search (string $query, [int $offset = 0], [int $limit = 10], [array $params = array()])
  • string $query: The raw query string
  • int $offset: The starting offset for result documents
  • int $limit: The maximum number of result documents to return
  • array $params: key / value pairs for query parameters, use arrays for multivalued parameters
setReadPingTimeout (line 63)
  • access: public
void setReadPingTimeout ( $timeout)
  • $timeout
setWritePingTimetou (line 68)
  • access: public
void setWritePingTimetou ( $timeout)
  • $timeout

Documentation generated on Tue, 02 Oct 2007 12:55:37 -0400 by phpDocumentor 1.4.0