Class Apache_Solr_Response

Description

Represents a Solr response. Parses the raw response into a set of stdClass objects and associative arrays for easy access.

Currently requires json_decode which is bundled with PHP >= 5.2.0, Alternatively can be installed with PECL. Zend Framework also includes a purely PHP solution.

  • todo: When Solr 1.3 is released, possibly convert to use PHP or Serialized PHP output writer

Located in /Response.php (line 47)


	
			
Variable Summary
Method Summary
Apache_Solr_Response __construct (string $rawResponse, [array $httpHeaders = array()], [boolean $createDocuments = true], [boolean $collapseSingleValueArrays = true])
string getEncoding ()
integer getHttpStatus ()
string getRawResponse ()
string getType ()
void _parseData ()
unknown __get (unknown_type $key)
Variables
mixed $_collapseSingleValueArrays = true (line 84)
  • access: protected
boolean $_createDocuments = true (line 83)

Data parsing flags. Determines what extra processing should be done after the data is initially converted to a data structure.

  • access: protected
mixed $_encoding (line 61)
  • access: protected
string $_httpStatus (line 61)

Parsed values from the passed in http headers

  • access: protected
mixed $_httpStatusMessage (line 61)
  • access: protected
boolean $_isParsed = false (line 68)

Whether the raw response has been parsed

  • access: protected
mixed $_parsedData (line 75)

Parsed representation of the data

  • access: protected
string $_rawResponse (line 54)

Holds the raw response used in construction

  • access: protected
mixed $_type (line 61)
  • access: protected
Methods
Constructor __construct (line 94)

Constructor. Takes the raw HTTP response body and the exploded HTTP headers

  • access: public
Apache_Solr_Response __construct (string $rawResponse, [array $httpHeaders = array()], [boolean $createDocuments = true], [boolean $collapseSingleValueArrays = true])
  • string $rawResponse
  • array $httpHeaders
  • boolean $createDocuments: Whether to convert the documents json_decoded as stdClass instances to Apache_Solr_Document instances
  • boolean $collapseSingleValueArrays: Whether to make multivalued fields appear as single values
getEncoding (line 196)

Get character encoding of this response. Should usually be utf-8, but just in case

  • access: public
string getEncoding ()
getHttpStatus (line 166)

Get the HTTP status code

  • access: public
integer getHttpStatus ()
getHttpStatusMessage (line 176)

Get the HTTP status message of the response

  • access: public
string getHttpStatusMessage ()
getRawResponse (line 206)

Get the raw response as it was given to this object

  • access: public
string getRawResponse ()
getType (line 186)

Get content type of this Solr response

  • access: public
string getType ()
_parseData (line 236)

Parse the raw response into the parsed_data array for access

  • access: protected
void _parseData ()
__get (line 217)

Magic get to expose the parsed data and to lazily load it

  • access: public
unknown __get (unknown_type $key)
  • unknown_type $key

Documentation generated on Wed, 11 Mar 2009 17:34:16 -0400 by phpDocumentor 1.4.2