\Solr3Service

Synopsis

class Solr3Service extends SolrService {
  • // members
  • private static string $core_class = 'Solr3Service_Core';
}

Hierarchy

Extends

Tasks

Line Task
1005+ Should be using multipart/form-data to post parameter values, but I could not get my implementation to work. Needs revisisted.

Constants

Name Value
SVN_REVISION '$Revision: 59 $'
SVN_ID '$Id: Service.php 59 2011-02-08 20:38:59Z donovan.jimenez $'
SOLR_WRITER 'json'
NAMED_LIST_FLAT 'flat'
NAMED_LIST_MAP 'map'
METHOD_GET 'GET'
METHOD_POST 'POST'
PING_SERVLET 'admin/ping'
UPDATE_SERVLET 'update'
SEARCH_SERVLET 'select'
THREADS_SERVLET 'admin/threads'
EXTRACT_SERVLET 'update/extract'

Members

private

  • $core_class

protected

  • $_collapseSingleValueArrays — boolean
    Whether {@link Apache_Solr_Response} objects should have multivalue fields with only a single value collapsed to appear as a single value would.
  • $_createDocuments — boolean
    Whether {@link Apache_Solr_Response} objects should create {@link Apache_Solr_Document}s in the returned parsed data
  • $_host — string
    Server identification strings
  • $_httpTransportApache_Solr_HttpTransport_Interface
    HTTP Transport implementation (pluggable)
  • $_namedListTreatment — string
    How NamedLists should be formatted in the output. This specifically effects facet counts. Valid values are {@link Apache_Solr_Service::NAMED_LIST_MAP} (default) or {@link Apache_Solr_Service::NAMED_LIST_FLAT}.
  • $_pingUrl — string
    Constructed servlet full path URLs
  • $_queryDelimiter — string
    Query delimiters. Someone might want to be able to change these (to use & instead of & for example), so I've provided them.
  • $_urlsInited — boolean
    Keep track of whether our URLs have been constructed

Methods

Inherited from SolrService

protected

  • coreCommand() — Handle encoding the GET parameters and making the HTTP call to execute a core command

public

Inherited from Apache_Solr_Service

protected

  • _constructUrl() — Return a valid http URL given this server's host, port and path and a provided servlet name
  • _documentToXmlFragment() — Create an XML fragment from a {@link Apache_Solr_Document} instance appropriate for use inside a Solr add call
  • _generateQueryString()
  • _initUrls() — Construct the Full URLs for the three servlets we reference
  • _sendRawGet() — Central method for making a get operation against this Solr Server
  • _sendRawPost() — Central method for making a post operation against this Solr Server
  • _stripCtrlChars() — Replace control (non-printable) characters from string that are invalid to Solr's XML parser with a space.

public

  • add() — 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.
  • addDocument() — Add a Solr Document to the index
  • addDocuments() — Add an array of Solr Documents to the index all at once
  • commit() — Send a commit command. Will be synchronous unless both wait parameters are set to false.
  • delete() — 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
  • deleteById() — Create a delete document based on document ID
  • deleteByMultipleIds() — Create and post a delete document based on multiple document IDs.
  • deleteByQuery() — Create a delete document based on a query and submit it
  • escape() — Escape a value for special query characters such as ':', '(', ')', '*', '?', etc.
  • escapePhrase() — Escape a value meant to be contained in a phrase for special query characters
  • extract() — Use Solr Cell to extract document contents. See {@link http://wiki.apache.org/solr/ExtractingRequestHandler} for information on how to use Solr Cell and what parameters are available.
  • extractFromString() — Use Solr Cell to extract document contents. See {@link http://wiki.apache.org/solr/ExtractingRequestHandler} for information on how to use Solr Cell and what parameters are available.
  • extractFromUrl() — Use Solr Cell to extract document contents. See {@link http://wiki.apache.org/solr/ExtractingRequestHandler} for information on how to use Solr Cell and what parameters are available.
  • getCollapseSingleValueArrays() — Get the current state of the collapse single value arrays flag.
  • getCreateDocuments() — Get the current state of teh create documents flag.
  • getDefaultTimeout() — Get the current default timeout setting (initially the default_socket_timeout ini setting) in seconds
  • getHost() — Returns the set host
  • getHttpTransport() — Get the current configured HTTP Transport
  • getNamedListTreatment() — Get the current setting for named list treatment.
  • getPath() — Get the set path.
  • getPort() — Get the set port
  • optimize() — Send an optimize command. Will be synchronous unless both wait parameters are set to false.
  • phrase() — Convenience function for creating phrase syntax from a value
  • ping() — Call the /admin/ping servlet, can be used to quickly tell if a connection to the server is able to be made.
  • setCollapseSingleValueArrays() — Set the collapse single value arrays flag.
  • setCreateDocuments() — Set the create documents flag. This determines whether {@link Apache_Solr_Response} objects will parse the response and create {@link Apache_Solr_Document} instances in place.
  • setDefaultTimeout() — Set the default timeout for all calls that aren't passed a specific timeout
  • setHost() — Set the host used. If empty will fallback to constants
  • setHttpTransport() — Set the HTTP Transport implemenation that will be used for all HTTP requests
  • setNamedListTreatment() — Set how NamedLists should be formatted in the response data. This mainly effects the facet counts format.
  • setPath() — Set the path used. If empty will fallback to constants
  • setPort() — Set the port used. If empty will fallback to constants
  • setQueryDelimiter() — Set the string used to separate the path form the query string.
  • setQueryStringDelimiter() — Set the string used to separate the parameters in thequery string Defaulted to '&'
  • threads() — Call the /admin/threads servlet and retrieve information about all threads in the Solr servlet's thread group. Useful for diagnostics.