Apache Solr

Table of Contents

The SolrUtils class

Introduction

Contains utility methods for retrieving the current extension version and preparing query phrases.

Also contains method for escaping query strings and parsing XML responses.

Class synopsis

SolrUtils
abstract class SolrUtils {
/* Methods */
public static SolrObject digestXmlResponse ( string $xmlresponse [, int $parse_mode = 0 ] )
public static string escapeQueryChars ( string $str )
public static string getSolrVersion ( void )
public static string queryPhrase ( string $str )
}

The SolrInputDocument class

Introduction

This class represents a Solr document that is about to be submitted to the Solr index.

Class synopsis

SolrInputDocument
final class SolrInputDocument {
/* Constants */
const integer SolrInputDocument::SORT_DEFAULT = 1 ;
const integer SolrInputDocument::SORT_ASC = 1 ;
const integer SolrInputDocument::SORT_DESC = 2 ;
const integer SolrInputDocument::SORT_FIELD_NAME = 1 ;
const integer SolrInputDocument::SORT_FIELD_VALUE_COUNT = 2 ;
const integer SolrInputDocument::SORT_FIELD_BOOST_VALUE = 4 ;
/* Methods */
public bool addField ( string $fieldName , string $fieldValue [, float $fieldBoostValue = 0.0 ] )
public bool clear ( void )
public void __clone ( void )
public __construct ( void )
public bool deleteField ( string $fieldName )
public void __destruct ( void )
public bool fieldExists ( string $fieldName )
public float getBoost ( void )
public SolrDocumentField getField ( string $fieldName )
public float getFieldBoost ( string $fieldName )
public int getFieldCount ( void )
public array getFieldNames ( void )
public bool merge ( SolrInputDocument $sourceDoc [, bool $overwrite = true ] )
public bool reset ( void )
public bool setBoost ( float $documentBoostValue )
public bool setFieldBoost ( string $fieldName , float $fieldBoostValue )
public bool sort ( int $sortOrderBy [, int $sortDirection = SolrInputDocument::SORT_ASC ] )
public array toArray ( void )
}

Predefined Constants

SolrInputDocument Class Constants

SolrInputDocument::SORT_DEFAULT

Sorts the fields in ascending order.

SolrInputDocument::SORT_ASC

Sorts the fields in ascending order.

SolrInputDocument::SORT_DESC

Sorts the fields in descending order.

SolrInputDocument::SORT_FIELD_NAME

Sorts the fields by name

SolrInputDocument::SORT_FIELD_VALUE_COUNT

Sorts the fields by number of values.

SolrInputDocument::SORT_FIELD_BOOST_VALUE

Sorts the fields by boost value.

The SolrDocument class

Introduction

Represents a Solr document retrieved from a query response.

Class synopsis

SolrDocument
final class SolrDocument implements ArrayAccess , Iterator , Serializable {
/* Constants */
const integer SolrDocument::SORT_DEFAULT = 1 ;
const integer SolrDocument::SORT_ASC = 1 ;
const integer SolrDocument::SORT_DESC = 2 ;
const integer SolrDocument::SORT_FIELD_NAME = 1 ;
const integer SolrDocument::SORT_FIELD_VALUE_COUNT = 2 ;
const integer SolrDocument::SORT_FIELD_BOOST_VALUE = 4 ;
/* Methods */
public bool addField ( string $fieldName , string $fieldValue )
public bool clear ( void )
public void __clone ( void )
public __construct ( void )
public SolrDocumentField current ( void )
public bool deleteField ( string $fieldName )
public void __destruct ( void )
public bool fieldExists ( string $fieldName )
public SolrDocumentField __get ( string $fieldName )
public SolrDocumentField getField ( string $fieldName )
public int getFieldCount ( void )
public array getFieldNames ( void )
public SolrInputDocument getInputDocument ( void )
public bool __isset ( string $fieldName )
public string key ( void )
public bool merge ( SolrDocument $sourceDoc [, bool $overwrite = true ] )
public void next ( void )
public bool offsetExists ( string $fieldName )
public SolrDocumentField offsetGet ( string $fieldName )
public void offsetSet ( string $fieldName , string $fieldValue )
public void offsetUnset ( string $fieldName )
public bool reset ( void )
public void rewind ( void )
public string serialize ( void )
public bool __set ( string $fieldName , string $fieldValue )
public bool sort ( int $sortOrderBy [, int $sortDirection = SolrDocument::SORT_ASC ] )
public array toArray ( void )
public void unserialize ( string $serialized )
public bool __unset ( string $fieldName )
public bool valid ( void )
}

Predefined Constants

SolrDocument::SORT_DEFAULT

Default mode for sorting fields within the document.

SolrDocument::SORT_ASC

Sorts the fields in ascending order

SolrDocument::SORT_DESC

Sorts the fields in descending order

SolrDocument::SORT_FIELD_NAME

Sorts the fields by field name.

SolrDocument::SORT_FIELD_VALUE_COUNT

Sorts the fields by number of values in each field.

SolrDocument::SORT_FIELD_BOOST_VALUE

Sorts the fields by thier boost values.

The SolrDocumentField class

Introduction

This represents a field in a Solr document. All its properties are read-only.

Class synopsis

SolrDocumentField
final class SolrDocumentField {
/* Properties */
readonly public string $name ;
readonly public float $boost ;
readonly public array $values ;
/* Methods */
public __construct ( void )
public void __destruct ( void )
}

Properties

name

The name of the field.

boost

The boost value for the field

values

An array of values for this field

The SolrObject class

Introduction

This is an object whose properties can also by accessed using the array syntax. All its properties are read-only.

Class synopsis

SolrObject
final class SolrObject implements ArrayAccess {
/* Methods */
public __construct ( void )
public void __destruct ( void )
public array getPropertyNames ( void )
public bool offsetExists ( string $property_name )
public mixed offsetGet ( string $property_name )
public void offsetSet ( string $property_name , string $property_value )
public void offsetUnset ( string $property_name )
}

The SolrClient class

Introduction

Used to send requests to a Solr server. Currently, cloning and serialization of SolrClient instances is not supported.

Class synopsis

SolrClient
final class SolrClient {
/* Constants */
const integer SolrClient::SEARCH_SERVLET_TYPE = 1 ;
const integer SolrClient::UPDATE_SERVLET_TYPE = 2 ;
const integer SolrClient::THREADS_SERVLET_TYPE = 4 ;
const integer SolrClient::PING_SERVLET_TYPE = 8 ;
const integer SolrClient::TERMS_SERVLET_TYPE = 16 ;
const string SolrClient::DEFAULT_SEARCH_SERVLET = select ;
const string SolrClient::DEFAULT_UPDATE_SERVLET = update ;
const string SolrClient::DEFAULT_THREADS_SERVLET = admin/threads ;
const string SolrClient::DEFAULT_PING_SERVLET = admin/ping ;
const string SolrClient::DEFAULT_TERMS_SERVLET = terms ;
/* Methods */
public SolrUpdateResponse addDocument ( SolrInputDocument $doc [, bool $allowDups = false [, int $commitWithin = 0 ]] )
public void addDocuments ( array $docs [, bool $allowDups = false [, int $commitWithin = 0 ]] )
public SolrUpdateResponse commit ([ int $maxSegments = "1" [, bool $waitFlush = true [, bool $waitSearcher = true ]]] )
public __construct ( array $clientOptions )
public SolrUpdateResponse deleteById ( string $id )
public SolrUpdateResponse deleteByIds ( array $ids )
public SolrUpdateResponse deleteByQueries ( array $queries )
public SolrUpdateResponse deleteByQuery ( string $query )
public void __destruct ( void )
public string getDebug ( void )
public array getOptions ( void )
public SolrUpdateResponse optimize ([ int $maxSegments = "1" [, bool $waitFlush = true [, bool $waitSearcher = true ]]] )
public SolrPingResponse ping ( void )
public SolrQueryResponse query ( SolrParams $query )
public void request ( string $raw_request )
public SolrUpdateResponse rollback ( void )
public void setResponseWriter ( string $responseWriter )
public bool setServlet ( int $type , string $value )
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::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

The SolrResponse class

Introduction

Represents a response from the Solr server.

Class synopsis

SolrResponse
abstract class SolrResponse {
/* Constants */
const integer SolrResponse::PARSE_SOLR_OBJ = 0 ;
const integer SolrResponse::PARSE_SOLR_DOC = 1 ;
/* Properties */
protected integer $http_status ;
protected integer $parser_mode ;
protected bool $success ;
protected string $http_status_message ;
protected string $http_request_url ;
protected string $http_raw_request_headers ;
protected string $http_raw_request ;
protected string $http_raw_response_headers ;
protected string $http_raw_response ;
protected string $http_digested_response ;
/* Methods */
public string getDigestedResponse ( void )
public int getHttpStatus ( void )
public string getHttpStatusMessage ( void )
public string getRawRequest ( void )
public string getRawRequestHeaders ( void )
public string getRawResponse ( void )
public string getRawResponseHeaders ( void )
public string getRequestUrl ( void )
public SolrObject getResponse ( void )
public bool setParseMode ([ int $parser_mode = 0 ] )
public bool success ( void )
}

Properties

http_status

The http status of the response.

parser_mode

Whether to parse the solr documents as SolrObject or SolrDocument instances.

success

Was there an error during the request

http_status_message

Detailed message on http status

http_request_url

The request URL

http_raw_request_headers

A string of raw headers sent during the request.

http_raw_request

The raw request sent to the server

http_raw_response_headers

Response headers from the Solr server.

http_raw_response

The response message from the server.

http_digested_response

The response in PHP serialized format.

Predefined Constants

SolrResponse Class Constants

SolrResponse::PARSE_SOLR_OBJ

Documents should be parsed as SolrObject instances

SolrResponse::PARSE_SOLR_DOC

Documents should be parsed as SolrDocument instances.

The SolrQueryResponse class

Introduction

Represents a response to a query request.

Class synopsis

SolrQueryResponse
final class SolrQueryResponse extends SolrResponse {
/* Constants */
const integer SolrQueryResponse::PARSE_SOLR_OBJ = 0 ;
const integer SolrQueryResponse::PARSE_SOLR_DOC = 1 ;
/* Inherited properties */
const integer SolrResponse::PARSE_SOLR_OBJ = 0 ;
const integer SolrResponse::PARSE_SOLR_DOC = 1 ;
protected integer $http_status ;
protected integer $parser_mode ;
protected bool $success ;
protected string $http_status_message ;
protected string $http_request_url ;
protected string $http_raw_request_headers ;
protected string $http_raw_request ;
protected string $http_raw_response_headers ;
protected string $http_raw_response ;
protected string $http_digested_response ;
/* Methods */
public __construct ( void )
public void __destruct ( void )
/* Inherited methods */
public string SolrResponse::getDigestedResponse ( void )
public int SolrResponse::getHttpStatus ( void )
public string SolrResponse::getHttpStatusMessage ( void )
public string SolrResponse::getRawRequest ( void )
public string SolrResponse::getRawRequestHeaders ( void )
public string SolrResponse::getRawResponse ( void )
public string SolrResponse::getRawResponseHeaders ( void )
public string SolrResponse::getRequestUrl ( void )
public SolrObject SolrResponse::getResponse ( void )
public bool SolrResponse::setParseMode ([ int $parser_mode = 0 ] )
public bool SolrResponse::success ( void )
}

Predefined Constants

SolrQueryResponse Class constants

SolrQueryResponse::PARSE_SOLR_OBJ

Documents should be parsed as SolrObject instances

SolrQueryResponse::PARSE_SOLR_DOC

Documents should be parsed as SolrDocument instances.

The SolrUpdateResponse class

Introduction

Represents a response to an update request.

Class synopsis

SolrUpdateResponse
final class SolrUpdateResponse extends SolrResponse {
/* Constants */
const integer SolrUpdateResponse::PARSE_SOLR_OBJ = 0 ;
const integer SolrUpdateResponse::PARSE_SOLR_DOC = 1 ;
/* Inherited properties */
const integer SolrResponse::PARSE_SOLR_OBJ = 0 ;
const integer SolrResponse::PARSE_SOLR_DOC = 1 ;
protected integer $http_status ;
protected integer $parser_mode ;
protected bool $success ;
protected string $http_status_message ;
protected string $http_request_url ;
protected string $http_raw_request_headers ;
protected string $http_raw_request ;
protected string $http_raw_response_headers ;
protected string $http_raw_response ;
protected string $http_digested_response ;
/* Methods */
public __construct ( void )
public void __destruct ( void )
/* Inherited methods */
public string SolrResponse::getDigestedResponse ( void )
public int SolrResponse::getHttpStatus ( void )
public string SolrResponse::getHttpStatusMessage ( void )
public string SolrResponse::getRawRequest ( void )
public string SolrResponse::getRawRequestHeaders ( void )
public string SolrResponse::getRawResponse ( void )
public string SolrResponse::getRawResponseHeaders ( void )
public string SolrResponse::getRequestUrl ( void )
public SolrObject SolrResponse::getResponse ( void )
public bool SolrResponse::setParseMode ([ int $parser_mode = 0 ] )
public bool SolrResponse::success ( void )
}

Predefined Constants

SolrUpdateResponse Class Constants

SolrUpdateResponse::PARSE_SOLR_OBJ

Documents should be parsed as SolrObject instances

SolrUpdateResponse::PARSE_SOLR_DOC

Documents should be parsed as SolrDocument instances.

The SolrPingResponse class

Introduction

Represents a response to a ping request to the server

Class synopsis

SolrPingResponse
final class SolrPingResponse extends SolrResponse {
/* Constants */
const integer SolrPingResponse::PARSE_SOLR_OBJ = 0 ;
const integer SolrPingResponse::PARSE_SOLR_DOC = 1 ;
/* Properties */
/* Methods */
public __construct ( void )
public void __destruct ( void )
public string getResponse ( void )
/* Inherited methods */
public string SolrResponse::getDigestedResponse ( void )
public int SolrResponse::getHttpStatus ( void )
public string SolrResponse::getHttpStatusMessage ( void )
public string SolrResponse::getRawRequest ( void )
public string SolrResponse::getRawRequestHeaders ( void )
public string SolrResponse::getRawResponse ( void )
public string SolrResponse::getRawResponseHeaders ( void )
public string SolrResponse::getRequestUrl ( void )
public SolrObject SolrResponse::getResponse ( void )
public bool SolrResponse::setParseMode ([ int $parser_mode = 0 ] )
public bool SolrResponse::success ( void )
}

Properties

http_status

The http status of the response.

parser_mode

Whether to parse the solr documents as SolrObject or SolrDocument instances.

success

Was there an error during the request

http_status_message

Detailed message on http status

http_request_url

The request URL

http_raw_request_headers

A string of raw headers sent during the request

http_raw_request

The raw request sent to the server

http_raw_response_headers

Response headers from the Solr server

http_raw_response

The response message from the server

http_digested_response

The response in PHP serialized format.

Predefined Constants

SolrPingResponse Class Constants

SolrPingResponse::PARSE_SOLR_OBJ

Documents should be parsed as SolrObject instances

SolrPingResponse::PARSE_SOLR_DOC

Documents should be parsed as SolrDocument instances.

The SolrGenericResponse class

Introduction

Represents a response from the solr server.

Class synopsis

SolrGenericResponse
final class SolrGenericResponse extends SolrResponse {
/* Constants */
const integer SolrGenericResponse::PARSE_SOLR_OBJ = 0 ;
const integer SolrGenericResponse::PARSE_SOLR_DOC = 1 ;
/* Inherited properties */
const integer SolrResponse::PARSE_SOLR_OBJ = 0 ;
const integer SolrResponse::PARSE_SOLR_DOC = 1 ;
protected integer $http_status ;
protected integer $parser_mode ;
protected bool $success ;
protected string $http_status_message ;
protected string $http_request_url ;
protected string $http_raw_request_headers ;
protected string $http_raw_request ;
protected string $http_raw_response_headers ;
protected string $http_raw_response ;
protected string $http_digested_response ;
/* Methods */
public __construct ( void )
public void __destruct ( void )
/* Inherited methods */
public string SolrResponse::getDigestedResponse ( void )
public int SolrResponse::getHttpStatus ( void )
public string SolrResponse::getHttpStatusMessage ( void )
public string SolrResponse::getRawRequest ( void )
public string SolrResponse::getRawRequestHeaders ( void )
public string SolrResponse::getRawResponse ( void )
public string SolrResponse::getRawResponseHeaders ( void )
public string SolrResponse::getRequestUrl ( void )
public SolrObject SolrResponse::getResponse ( void )
public bool SolrResponse::setParseMode ([ int $parser_mode = 0 ] )
public bool SolrResponse::success ( void )
}

Predefined Constants

SolrGenericResponse Class constants

SolrGenericResponse::PARSE_SOLR_OBJ

Documents should be parsed as SolrObject instances

SolrGenericResponse::PARSE_SOLR_DOC

Documents should be parsed as SolrDocument instances.

The SolrParams class

Introduction

Represents a collection of name-value pairs sent to the Solr server during a request.

Class synopsis

SolrParams
abstract class SolrParams implements Serializable {
/* Methods */
final public SolrParams add ( string $name , string $value )
public SolrParams addParam ( string $name , string $value )
final public mixed get ( string $param_name )
final public mixed getParam ([ string $param_name ] )
final public array getParams ( void )
final public array getPreparedParams ( void )
final public string serialize ( void )
final public void set ( string $name , string $value )
public SolrParams setParam ( string $name , string $value )
final public string toString ([ bool $url_encode = false ] )
final public void unserialize ( string $serialized )
}

The SolrModifiableParams class

Introduction

Represents a collection of name-value pairs sent to the Solr server during a request.

Class synopsis

SolrModifiableParams
class SolrModifiableParams extends SolrParams implements Serializable {
/* Methods */
public __construct ( void )
public void __destruct ( void )
/* Inherited methods */
final public SolrParams SolrParams::add ( string $name , string $value )
public SolrParams SolrParams::addParam ( string $name , string $value )
final public mixed SolrParams::get ( string $param_name )
final public mixed SolrParams::getParam ([ string $param_name ] )
final public array SolrParams::getParams ( void )
final public array SolrParams::getPreparedParams ( void )
final public string SolrParams::serialize ( void )
final public void SolrParams::set ( string $name , string $value )
public SolrParams SolrParams::setParam ( string $name , string $value )
final public string SolrParams::toString ([ bool $url_encode = false ] )
final public void SolrParams::unserialize ( string $serialized )
}

The SolrQuery class

Introduction

Represents a collection of name-value pairs sent to the Solr server during a request.

Class synopsis

SolrQuery
class SolrQuery extends SolrModifiableParams implements Serializable {
/* Constants */
const integer SolrQuery::ORDER_ASC = 0 ;
const integer SolrQuery::ORDER_DESC = 1 ;
const integer SolrQuery::FACET_SORT_INDEX = 0 ;
const integer SolrQuery::FACET_SORT_COUNT = 1 ;
const integer SolrQuery::TERMS_SORT_INDEX = 0 ;
const integer SolrQuery::TERMS_SORT_COUNT = 1 ;
/* Properties */
/* Methods */
public SolrQuery addFacetDateField ( string $dateField )
public SolrQuery addFacetDateOther ( string $value [, string $field_override ] )
public SolrQuery addFacetField ( string $field )
public SolrQuery addFacetQuery ( string $facetQuery )
public SolrQuery addField ( string $field )
public SolrQuery addFilterQuery ( string $fq )
public SolrQuery addHighlightField ( string $field )
public SolrQuery addMltField ( string $field )
public SolrQuery addMltQueryField ( string $field , float $boost )
public SolrQuery addSortField ( string $field [, int $order = SolrQuery::ORDER_DESC ] )
public SolrQuery addStatsFacet ( string $field )
public SolrQuery addStatsField ( string $field )
public __construct ([ string $q ] )
public void __destruct ( void )
public bool getFacet ( void )
public string getFacetDateEnd ([ string $field_override ] )
public array getFacetDateFields ( void )
public string getFacetDateGap ([ string $field_override ] )
public string getFacetDateHardEnd ([ string $field_override ] )
public array getFacetDateOther ([ string $field_override ] )
public string getFacetDateStart ([ string $field_override ] )
public array getFacetFields ( void )
public int getFacetLimit ([ string $field_override ] )
public string getFacetMethod ([ string $field_override ] )
public int getFacetMinCount ([ string $field_override ] )
public bool getFacetMissing ([ string $field_override ] )
public int getFacetOffset ([ string $field_override ] )
public string getFacetPrefix ([ string $field_override ] )
public array getFacetQueries ( void )
public int getFacetSort ([ string $field_override ] )
public array getFields ( void )
public array getFilterQueries ( void )
public bool getHighlight ( void )
public string getHighlightAlternateField ([ string $field_override ] )
public array getHighlightFields ( void )
public string getHighlightFormatter ([ string $field_override ] )
public string getHighlightFragmenter ([ string $field_override ] )
public int getHighlightFragsize ([ string $field_override ] )
public bool getHighlightHighlightMultiTerm ( void )
public int getHighlightMaxAlternateFieldLength ([ string $field_override ] )
public int getHighlightMaxAnalyzedChars ( void )
public bool getHighlightMergeContiguous ([ string $field_override ] )
public int getHighlightRegexMaxAnalyzedChars ( void )
public string getHighlightRegexPattern ( void )
public float getHighlightRegexSlop ( void )
public bool getHighlightRequireFieldMatch ( void )
public string getHighlightSimplePost ([ string $field_override ] )
public string getHighlightSimplePre ([ string $field_override ] )
public int getHighlightSnippets ([ string $field_override ] )
public bool getHighlightUsePhraseHighlighter ( void )
public bool getMlt ( void )
public bool getMltBoost ( void )
public int getMltCount ( void )
public array getMltFields ( void )
public int getMltMaxNumQueryTerms ( void )
public int getMltMaxNumTokens ( void )
public int getMltMaxWordLength ( void )
public int getMltMinDocFrequency ( void )
public int getMltMinTermFrequency ( void )
public int getMltMinWordLength ( void )
public array getMltQueryFields ( void )
public string getQuery ( void )
public int getRows ( void )
public array getSortFields ( void )
public int getStart ( void )
public bool getStats ( void )
public array getStatsFacets ( void )
public array getStatsFields ( void )
public bool getTerms ( void )
public string getTermsField ( void )
public bool getTermsIncludeLowerBound ( void )
public bool getTermsIncludeUpperBound ( void )
public int getTermsLimit ( void )
public string getTermsLowerBound ( void )
public int getTermsMaxCount ( void )
public int getTermsMinCount ( void )
public string getTermsPrefix ( void )
public bool getTermsReturnRaw ( void )
public int getTermsSort ( void )
public string getTermsUpperBound ( void )
public int getTimeAllowed ( void )
public SolrQuery removeFacetDateField ( string $field )
public SolrQuery removeFacetDateOther ( string $value [, string $field_override ] )
public SolrQuery removeFacetField ( string $field )
public SolrQuery removeFacetQuery ( string $value )
public SolrQuery removeField ( string $field )
public SolrQuery removeFilterQuery ( string $fq )
public SolrQuery removeHighlightField ( string $field )
public SolrQuery removeMltField ( string $field )
public SolrQuery removeMltQueryField ( string $queryField )
public SolrQuery removeSortField ( string $field )
public SolrQuery removeStatsFacet ( string $value )
public SolrQuery removeStatsField ( string $field )
public SolrQuery setEchoHandler ( bool $flag )
public SolrQuery setEchoParams ( string $type )
public SolrQuery setExplainOther ( string $query )
public SolrQuery setFacet ( bool $flag )
public SolrQuery setFacetDateEnd ( string $value [, string $field_override ] )
public SolrQuery setFacetDateGap ( string $value [, string $field_override ] )
public SolrQuery setFacetDateHardEnd ( bool $value [, string $field_override ] )
public SolrQuery setFacetDateStart ( string $value [, string $field_override ] )
public SolrQuery setFacetEnumCacheMinDefaultFrequency ( int $frequency [, string $field_override ] )
public SolrQuery setFacetLimit ( int $limit [, string $field_override ] )
public SolrQuery setFacetMethod ( string $method [, string $field_override ] )
public SolrQuery setFacetMinCount ( int $mincount [, string $field_override ] )
public SolrQuery setFacetMissing ( bool $flag [, string $field_override ] )
public SolrQuery setFacetOffset ( int $offset [, string $field_override ] )
public SolrQuery setFacetPrefix ( string $prefix [, string $field_override ] )
public SolrQuery setFacetSort ( int $facetSort [, string $field_override ] )
public SolrQuery setHighlight ( bool $flag )
public SolrQuery setHighlightAlternateField ( string $field [, string $field_override ] )
public SolrQuery setHighlightFormatter ( string $formatter [, string $field_override ] )
public SolrQuery setHighlightFragmenter ( string $fragmenter [, string $field_override ] )
public SolrQuery setHighlightFragsize ( int $size [, string $field_override ] )
public SolrQuery setHighlightHighlightMultiTerm ( bool $flag )
public SolrQuery setHighlightMaxAlternateFieldLength ( int $fieldLength [, string $field_override ] )
public SolrQuery setHighlightMaxAnalyzedChars ( int $value )
public SolrQuery setHighlightMergeContiguous ( bool $flag [, string $field_override ] )
public SolrQuery setHighlightRegexMaxAnalyzedChars ( int $maxAnalyzedChars )
public SolrQuery setHighlightRegexPattern ( string $value )
public SolrQuery setHighlightRegexSlop ( float $factor )
public SolrQuery setHighlightRequireFieldMatch ( bool $flag )
public SolrQuery setHighlightSimplePost ( string $simplePost [, string $field_override ] )
public SolrQuery setHighlightSimplePre ( string $simplePre [, string $field_override ] )
public SolrQuery setHighlightSnippets ( int $value [, string $field_override ] )
public SolrQuery setHighlightUsePhraseHighlighter ( bool $flag )
public SolrQuery setMlt ( bool $flag )
public SolrQuery setMltBoost ( bool $flag )
public SolrQuery setMltCount ( int $count )
public SolrQuery setMltMaxNumQueryTerms ( int $value )
public SolrQuery setMltMaxNumTokens ( int $value )
public SolrQuery setMltMaxWordLength ( int $maxWordLength )
public SolrQuery setMltMinDocFrequency ( int $minDocFrequency )
public SolrQuery setMltMinTermFrequency ( int $minTermFrequency )
public SolrQuery setMltMinWordLength ( int $minWordLength )
public SolrQuery setOmitHeader ( bool $flag )
public SolrQuery setQuery ( string $query )
public SolrQuery setRows ( int $rows )
public SolrQuery setShowDebugInfo ( bool $flag )
public SolrQuery setStart ( int $start )
public SolrQuery setStats ( bool $flag )
public SolrQuery setTerms ( bool $flag )
public SolrQuery setTermsField ( string $fieldname )
public SolrQuery setTermsIncludeLowerBound ( bool $flag )
public SolrQuery setTermsIncludeUpperBound ( bool $flag )
public SolrQuery setTermsLimit ( int $limit )
public SolrQuery setTermsLowerBound ( string $lowerBound )
public SolrQuery setTermsMaxCount ( int $frequency )
public SolrQuery setTermsMinCount ( int $frequency )
public SolrQuery setTermsPrefix ( string $prefix )
public SolrQuery setTermsReturnRaw ( bool $flag )
public SolrQuery setTermsSort ( int $sortType )
public SolrQuery setTermsUpperBound ( string $upperBound )
public SolrQuery setTimeAllowed ( int $timeAllowed )
/* Inherited methods */
public SolrModifiableParams::__construct ( void )
public void SolrModifiableParams::__destruct ( void )
}

Predefined Constants

SolrQuery::ORDER_ASC

Used to specify that the sorting should be in acending order

SolrQuery::ORDER_DESC

Used to specify that the sorting should be in descending order

SolrQuery::FACET_SORT_INDEX

Used to specify that the facet should sort by index

SolrQuery::FACET_SORT_COUNT

Used to specify that the facet should sort by count

SolrQuery::TERMS_SORT_INDEX

Used in the TermsComponent

SolrQuery::TERMS_SORT_COUNT

Used in the TermsComponent

The SolrException class

Introduction

This is the base class for all exception thrown by the Solr extension classes.

Class synopsis

SolrException
class SolrException extends Exception {
/* Properties */
protected integer $sourceline ;
protected string $sourcefile ;
protected string $zif_name ;
/* Inherited properties */
protected string $message ;
protected int $code ;
protected string $file ;
protected int $line ;
/* Methods */
public array getInternalInfo ( void )
/* Inherited methods */
final public string Exception::getMessage ( void )
final public Exception Exception::getPrevious ( void )
final public mixed Exception::getCode ( void )
final public string Exception::getFile ( void )
final public int Exception::getLine ( void )
final public array Exception::getTrace ( void )
final public string Exception::getTraceAsString ( void )
public string Exception::__toString ( void )
final private void Exception::__clone ( void )
}

Properties

sourceline

The line in c-space source file where exception was generated

sourcefile

The c-space source file where exception was generated

zif_name

The c-space function where exception was generated

The SolrClientException class

Introduction

An exception thrown when there is an error while making a request to the server from the client.

Class synopsis

SolrClientException
class SolrClientException extends SolrException {
/* Inherited properties */
protected string $message ;
protected int $code ;
protected string $file ;
protected int $line ;
protected integer $sourceline ;
protected string $sourcefile ;
protected string $zif_name ;
/* Methods */
public array getInternalInfo ( void )
/* Inherited methods */
final public string Exception::getMessage ( void )
final public Exception Exception::getPrevious ( void )
final public mixed Exception::getCode ( void )
final public string Exception::getFile ( void )
final public int Exception::getLine ( void )
final public array Exception::getTrace ( void )
final public string Exception::getTraceAsString ( void )
public string Exception::__toString ( void )
final private void Exception::__clone ( void )
public array SolrException::getInternalInfo ( void )
}

The SolrIllegalArgumentException class

Introduction

This object is thrown when an illeglal or invalid argument is passed to a method.

Class synopsis

SolrIllegalArgumentException
class SolrIllegalArgumentException extends SolrException {
/* Inherited properties */
protected string $message ;
protected int $code ;
protected string $file ;
protected int $line ;
protected integer $sourceline ;
protected string $sourcefile ;
protected string $zif_name ;
/* Methods */
public array getInternalInfo ( void )
/* Inherited methods */
final public string Exception::getMessage ( void )
final public Exception Exception::getPrevious ( void )
final public mixed Exception::getCode ( void )
final public string Exception::getFile ( void )
final public int Exception::getLine ( void )
final public array Exception::getTrace ( void )
final public string Exception::getTraceAsString ( void )
public string Exception::__toString ( void )
final private void Exception::__clone ( void )
public array SolrException::getInternalInfo ( void )
}

The SolrIllegalOperationException class

Introduction

This object is thrown when an illegal or unsupported operation is performed on an object.

Class synopsis

SolrIllegalOperationException
class SolrIllegalOperationException extends SolrException {
/* Inherited properties */
protected string $message ;
protected int $code ;
protected string $file ;
protected int $line ;
protected integer $sourceline ;
protected string $sourcefile ;
protected string $zif_name ;
/* Methods */
public array getInternalInfo ( void )
/* Inherited methods */
final public string Exception::getMessage ( void )
final public Exception Exception::getPrevious ( void )
final public mixed Exception::getCode ( void )
final public string Exception::getFile ( void )
final public int Exception::getLine ( void )
final public array Exception::getTrace ( void )
final public string Exception::getTraceAsString ( void )
public string Exception::__toString ( void )
final private void Exception::__clone ( void )
public array SolrException::getInternalInfo ( void )
}