Book/solr-Phpdoc专题

Apache Solr

目录

简介

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

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

类摘要

SolrUtils

abstract class SolrUtils {

/* 方法 */

public <span class="modifier">static SolrObject digestXmlResponse ( <span class="methodparam">string $xmlresponse [, <span class="type">int $parse_mode = 0 ] )

public <span class="modifier">static <span class="type">stringfalse <span class="methodname">escapeQueryChars ( <span class="methodparam">string $str )

public <span class="modifier">static string <span class="methodname">getSolrVersion ( <span class="methodparam">void )

public <span class="modifier">static string <span class="methodname">queryPhrase ( <span class="type">string $str )

}

SolrUtils::digestXmlResponse

Parses an response XML string into a SolrObject

说明

public <span class="modifier">static SolrObject SolrUtils::digestXmlResponse ( <span class="methodparam">string $xmlresponse [, <span class="type">int $parse_mode = 0 ] )

This method parses an response XML string from the Apache Solr server into a SolrObject. It throws a SolrException if there was an error.

参数

xmlresponse
The XML response string from the Solr server.

parse_mode
Use SolrResponse::PARSE_SOLR_OBJ or SolrResponse::PARSE_SOLR_DOC

返回值

Returns the SolrObject representing the XML response.

If the parse_mode parameter is set to SolrResponse::PARSE_SOLR_OBJ Solr documents will be parses as SolrObject instances.

If it is set to SolrResponse::PARSE_SOLR_DOC, they will be parsed as SolrDocument instances.

SolrUtils::escapeQueryChars

Escapes a lucene query string

说明

public <span class="modifier">static <span class="type">stringfalse <span class="methodname">SolrUtils::escapeQueryChars ( <span class="methodparam">string $str )

Lucene supports escaping special characters that are part of the query syntax.

The current list special characters are:

+ - && || ! ( ) { } [ ] ^ " ~ * ? : \ /

These characters are part of the query syntax and must be escaped

参数

str
This is the query string to be escaped.

返回值

Returns the escaped string 或者在失败时返回 false.

SolrUtils::getSolrVersion

Returns the current version of the Solr extension

说明

public <span class="modifier">static string <span class="methodname">SolrUtils::getSolrVersion ( <span class="methodparam">void )

Returns the current Solr version.

参数

此函数没有参数。

返回值

The current version of the Apache Solr extension.

SolrUtils::queryPhrase

Prepares a phrase from an unescaped lucene string

说明

public <span class="modifier">static string <span class="methodname">SolrUtils::queryPhrase ( <span class="methodparam">string $str )

Prepares a phrase from an unescaped lucene string.

参数

str
The lucene phrase.

返回值

Returns the phrase contained in double quotes.

简介

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

类摘要

SolrInputDocument

final class SolrInputDocument {

/* 常量 */

const int SolrInputDocument::SORT_DEFAULT = 1 ;

const int SolrInputDocument::SORT_ASC = 1 ;

const int SolrInputDocument::SORT_DESC = 2 ;

const int SolrInputDocument::SORT_FIELD_NAME = 1 ;

const int SolrInputDocument::SORT_FIELD_VALUE_COUNT = 2 ;

const int SolrInputDocument::SORT_FIELD_BOOST_VALUE = 4 ;

/* 方法 */

public void addChildDocument ( <span class="methodparam">SolrInputDocument $child )

public void addChildDocuments ( <span class="methodparam">array &$docs )

public bool addField ( <span class="methodparam">string $fieldName , string $fieldValue [, <span class="type">float $fieldBoostValue = 0.0 ] )

public bool clear ( <span class="methodparam">void )

public void __clone ( <span class="methodparam">void )

public <span class="methodname">__construct ( <span class="methodparam">void )

public bool deleteField ( <span class="methodparam">string $fieldName )

public void __destruct ( <span class="methodparam">void )

public bool fieldExists ( <span class="methodparam">string $fieldName )

public float getBoost ( <span class="methodparam">void )

public array getChildDocuments ( <span class="methodparam">void )

public int <span class="methodname">getChildDocumentsCount ( <span class="methodparam">void )

public <span class="type">SolrDocumentField <span class="methodname">getField ( <span class="type">string $fieldName )

public float getFieldBoost ( <span class="methodparam">string $fieldName )

public <span class="type">intfalse <span class="methodname">getFieldCount ( <span class="methodparam">void )

public array getFieldNames ( <span class="methodparam">void )

public bool hasChildDocuments ( <span class="methodparam">void )

public bool merge ( <span class="type">SolrInputDocument $sourceDoc [, <span class="methodparam">bool $overwrite<span class="initializer"> = true ] )

public bool reset ( <span class="methodparam">void )

public bool setBoost ( <span class="methodparam">float $documentBoostValue )

public bool setFieldBoost ( <span class="methodparam">string $fieldName , float $fieldBoostValue )

public bool sort ( <span class="type">int $sortOrderBy [, <span class="methodparam">int $sortDirection<span class="initializer"> = SolrInputDocument::SORT_ASC ] )

public array toArray ( <span class="methodparam">void )

}

预定义常量

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.

SolrInputDocument::addChildDocument

Adds a child document for block indexing

说明

public void SolrInputDocument::addChildDocument ( SolrInputDocument $child )

Adds a child document to construct a document block with nested documents.

参数

child
A SolrInputDocument object.

错误/异常

Throws SolrIllegalArgumentException on failure.

Throws SolrException on internal failure.

返回值

范例

示例 #1 <span class="function">SolrInputDocument::addChildDocument example

<?php

include "bootstrap.php";

$options = array
(
    'hostname' => SOLR_SERVER_HOSTNAME,
    'login'    => SOLR_SERVER_USERNAME,
    'password' => SOLR_SERVER_PASSWORD,
    'port'     => SOLR_SERVER_PORT,
    'path'     => SOLR_SERVER_STORE_PATH,
);

$client = new SolrClient($options);

$product = new SolrInputDocument();

$product->addField('id', 'P-BLACK');
$product->addField('cat', 'tshirt');
$product->addField('cat', 'polo');
$product->addField('content_type', 'product');

$small = new SolrInputDocument();
$small->addField('id', 'TS-BLK-S');
$small->addField('content_type', 'sku');
$small->addField('size', 'S');
$small->addField('inventory', 100);

$medium = new SolrInputDocument();
$medium->addField('id', 'TS-BLK-M');
$medium->addField('content_type', 'sku');
$medium->addField('size', 'M');
$medium->addField('inventory', 200);

$large = new SolrInputDocument();
$large->addField('id', 'TS-BLK-L');
$large->addField('content_type', 'sku');
$large->addField('size', 'L');
$large->addField('inventory', 300);

// add child documents 
$product->addChildDocument($small);
$product->addChildDocument($medium);
$product->addChildDocument($large);

// add product document block to the index
$updateResponse = $client->addDocument(
        $product,
        true, // overwrite if the document exists
        10000 // commit within 10 seconds
);

print_r($updateResponse->getResponse());

以上例程的输出类似于:

SolrObject Object
(
    [responseHeader] => SolrObject Object
        (
            [status] => 0
            [QTime] => 5
        )
)

参见

  • SolrInputDocument::addChildDocuments
  • SolrInputDocument::hasChildDocuments
  • SolrInputDocument::getChildDocuments
  • <span class="methodname">SolrInputDocument::getChildDocumentsCount

SolrInputDocument::addChildDocuments

Adds an array of child documents

说明

public void SolrInputDocument::addChildDocuments ( array &$docs )

Adds an array of child documents to the current input document.

参数

docs
An array of <span class="type">SolrInputDocument objects.

错误/异常

Throws SolrIllegalArgumentException on failure.

Throws SolrException on internal failure.

返回值

范例

示例 #1 <span class="function">SolrInputDocument::addChildDocuments example

<?php

include "bootstrap.php";

$options = array
(
    'hostname' => SOLR_SERVER_HOSTNAME,
    'login'    => SOLR_SERVER_USERNAME,
    'password' => SOLR_SERVER_PASSWORD,
    'port'     => SOLR_SERVER_PORT,
    'path'     => SOLR_SERVER_STORE_PATH,
);

$client = new SolrClient($options);

$product = new SolrInputDocument();

$product->addField('id', 'P-BLACK');
$product->addField('cat', 'tshirt');
$product->addField('cat', 'polo');
$product->addField('content_type', 'product');

$small = new SolrInputDocument();
$small->addField('id', 'TS-BLK-S');
$small->addField('content_type', 'sku');
$small->addField('size', 'S');
$small->addField('inventory', 100);

$medium = new SolrInputDocument();
$medium->addField('id', 'TS-BLK-M');
$medium->addField('content_type', 'sku');
$medium->addField('size', 'M');
$medium->addField('inventory', 200);

$large = new SolrInputDocument();
$large->addField('id', 'TS-BLK-L');
$large->addField('content_type', 'sku');
$large->addField('size', 'L');
$large->addField('inventory', 300);

// add child documents 
$skus = [$small, $medium, $large];
$product->addChildDocuments($skus);

// add the product document block to the index
$updateResponse = $client->addDocument(
        $product,
        true, // overwrite if the document exists
        10000 // commit within 10 seconds
);

print_r($updateResponse->getResponse());

以上例程的输出类似于:

SolrObject Object
(
    [responseHeader] => SolrObject Object
        (
            [status] => 0
            [QTime] => 5
        )
)

参见

  • SolrInputDocument::addChildDocument
  • SolrInputDocument::hasChildDocuments
  • SolrInputDocument::getChildDocuments
  • <span class="methodname">SolrInputDocument::getChildDocumentsCount

SolrInputDocument::addField

Adds a field to the document

说明

public bool SolrInputDocument::addField ( <span class="methodparam">string $fieldName , string $fieldValue [, <span class="type">float $fieldBoostValue = 0.0 ] )

For multi-value fields, if a valid boost value is specified, the specified value will be multiplied by the current boost value for this field.

参数

fieldName
The name of the field

fieldValue
The value for the field.

fieldBoostValue
The index time boost for the field. Though this cannot be negative, you can still pass values less than 1.0 but they must be greater than zero.

返回值

成功时返回 true, 或者在失败时返回 false

SolrInputDocument::clear

Resets the input document

说明

public bool SolrInputDocument::clear ( <span class="methodparam">void )

Resets the document by dropping all the fields and resets the document boost to zero.

参数

此函数没有参数。

返回值

成功时返回 true, 或者在失败时返回 false

SolrInputDocument::__clone

Creates a copy of a SolrDocument

说明

public void SolrInputDocument::__clone ( <span class="methodparam">void )

Should not be called directly. It is used to create a deep copy of a SolrInputDocument.

参数

此函数没有参数。

返回值

Creates a new SolrInputDocument instance.

SolrInputDocument::__construct

Constructor

说明

public <span class="methodname">SolrInputDocument::__construct ( <span class="methodparam">void )

Constructor.

参数

此函数没有参数。

返回值

None.

SolrInputDocument::deleteField

Removes a field from the document

说明

public bool SolrInputDocument::deleteField ( <span class="methodparam">string $fieldName )

Removes a field from the document.

参数

fieldName
The name of the field.

返回值

成功时返回 true, 或者在失败时返回 false

SolrInputDocument::__destruct

Destructor

说明

public void SolrInputDocument::__destruct ( <span class="methodparam">void )

Destructor

参数

此函数没有参数。

返回值

None.

SolrInputDocument::fieldExists

Checks if a field exists

说明

public bool SolrInputDocument::fieldExists ( <span class="methodparam">string $fieldName )

Checks if a field exists

参数

fieldName
Name of the field.

返回值

Returns true if the field was found and false if it was not found.

SolrInputDocument::getBoost

Retrieves the current boost value for the document

说明

public float SolrInputDocument::getBoost ( <span class="methodparam">void )

Retrieves the current boost value for the document.

参数

此函数没有参数。

返回值

Returns the boost value on success and false on failure.

SolrInputDocument::getChildDocuments

Returns an array of child documents (SolrInputDocument)

说明

public array SolrInputDocument::getChildDocuments ( void )

Returns an array of child documents (SolrInputDocument)

参数

此函数没有参数。

返回值

参见

  • SolrInputDocument::addChildDocument
  • SolrInputDocument::addChildDocuments
  • SolrInputDocument::hasChildDocuments
  • <span class="methodname">SolrInputDocument::getChildDocumentsCount

SolrInputDocument::getChildDocumentsCount

Returns the number of child documents

说明

public int <span class="methodname">SolrInputDocument::getChildDocumentsCount ( void )

Returns the number of child documents

参数

此函数没有参数。

返回值

参见

  • SolrInputDocument::addChildDocument
  • SolrInputDocument::addChildDocuments
  • SolrInputDocument::hasChildDocuments
  • SolrInputDocument::getChildDocuments

SolrInputDocument::getField

Retrieves a field by name

说明

public <span class="type">SolrDocumentField <span class="methodname">SolrInputDocument::getField ( <span class="methodparam">string $fieldName )

Retrieves a field in the document.

参数

fieldName
The name of the field.

返回值

Returns a SolrDocumentField object on success and false on failure.

SolrInputDocument::getFieldBoost

Retrieves the boost value for a particular field

说明

public float SolrInputDocument::getFieldBoost ( <span class="methodparam">string $fieldName )

Retrieves the boost value for a particular field.

参数

fieldName
The name of the field.

返回值

Returns the boost value for the field or false if there was an error.

SolrInputDocument::getFieldCount

Returns the number of fields in the document

说明

public <span class="type">intfalse <span class="methodname">SolrInputDocument::getFieldCount ( <span class="methodparam">void )

Returns the number of fields in the document.

参数

此函数没有参数。

返回值

Returns an integer on success 或者在失败时返回 false.

SolrInputDocument::getFieldNames

Returns an array containing all the fields in the document

说明

public array SolrInputDocument::getFieldNames ( <span class="methodparam">void )

Returns an array containing all the fields in the document.

参数

此函数没有参数。

返回值

Returns an array on success and false on failure.

SolrInputDocument::hasChildDocuments

Returns true if the document has any child documents

说明

public bool SolrInputDocument::hasChildDocuments ( void )

Checks whether the document has any child documents

参数

此函数没有参数。

返回值

参见

  • SolrInputDocument::addChildDocument
  • SolrInputDocument::addChildDocuments
  • SolrInputDocument::getChildDocuments
  • <span class="methodname">SolrInputDocument::getChildDocumentsCount

SolrInputDocument::merge

Merges one input document into another

说明

public bool SolrInputDocument::merge ( <span class="methodparam">SolrInputDocument $sourceDoc [, <span class="type">bool $overwrite = true ] )

Merges one input document into another.

参数

sourceDoc
The source document.

overwrite
If this is true it will replace matching fields in the destination document.

返回值

成功时返回 true, 或者在失败时返回 false。 In the future, this will be modified to return the number of fields in the new document.

SolrInputDocument::reset

This is an alias of SolrInputDocument::clear

说明

public bool SolrInputDocument::reset ( <span class="methodparam">void )

This is an alias of SolrInputDocument::clear

参数

此函数没有参数。

返回值

成功时返回 true, 或者在失败时返回 false

SolrInputDocument::setBoost

Sets the boost value for this document

说明

public bool SolrInputDocument::setBoost ( <span class="methodparam">float $documentBoostValue )

Sets the boost value for this document.

参数

documentBoostValue
The index-time boost value for this document.

返回值

成功时返回 true, 或者在失败时返回 false

SolrInputDocument::setFieldBoost

Sets the index-time boost value for a field

说明

public bool SolrInputDocument::setFieldBoost ( <span class="methodparam">string $fieldName , float $fieldBoostValue )

Sets the index-time boost value for a field. This replaces the current boost value for this field.

参数

fieldName
The name of the field.

fieldBoostValue
The index time boost value.

SolrInputDocument::sort

Sorts the fields within the document

说明

public bool SolrInputDocument::sort ( <span class="methodparam">int $sortOrderBy [, int $sortDirection = SolrInputDocument::SORT_ASC ] )

The fields are rearranged according to the specified criteria and sort direction

   Fields can be sorted by boost values, field names and number of values.

   The $order_by parameter must be one of :

   * SolrInputDocument::SORT_FIELD_NAME
   * SolrInputDocument::SORT_FIELD_BOOST_VALUE
   * SolrInputDocument::SORT_FIELD_VALUE_COUNT

   The sort direction can be one of :

   * SolrInputDocument::SORT_DEFAULT
   * SolrInputDocument::SORT_ASC
   * SolrInputDocument::SORT_DESC

参数

sortOrderBy
The sort criteria

sortDirection
The sort direction

返回值

成功时返回 true, 或者在失败时返回 false

SolrInputDocument::toArray

Returns an array representation of the input document

说明

public array SolrInputDocument::toArray ( <span class="methodparam">void )

Returns an array representation of the input document.

参数

此函数没有参数。

返回值

Returns an array containing the fields. It returns false on failure.

简介

Represents a Solr document retrieved from a query response.

类摘要

SolrDocument

final class SolrDocument implements <span class="interfacename">ArrayAccess <span class="oointerface">, Iterator , <span class="interfacename">Serializable {

/* 常量 */

const int SolrDocument::SORT_DEFAULT = 1 ;

const int SolrDocument::SORT_ASC = 1 ;

const int SolrDocument::SORT_DESC = 2 ;

const int SolrDocument::SORT_FIELD_NAME = 1 ;

const int SolrDocument::SORT_FIELD_VALUE_COUNT = 2 ;

const int SolrDocument::SORT_FIELD_BOOST_VALUE = 4 ;

/* 方法 */

public bool addField ( <span class="methodparam">string $fieldName , string $fieldValue )

public bool clear ( <span class="methodparam">void )

public void __clone ( <span class="methodparam">void )

public <span class="methodname">__construct ( <span class="methodparam">void )

public <span class="type">SolrDocumentField <span class="methodname">current ( <span class="methodparam">void )

public bool deleteField ( <span class="methodparam">string $fieldName )

public void __destruct ( <span class="methodparam">void )

public bool fieldExists ( <span class="methodparam">string $fieldName )

public <span class="type">SolrDocumentField <span class="methodname">__get ( <span class="type">string $fieldName )

public array getChildDocuments ( <span class="methodparam">void )

public int <span class="methodname">getChildDocumentsCount ( <span class="methodparam">void )

public <span class="type">SolrDocumentField <span class="methodname">getField ( <span class="type">string $fieldName )

public int <span class="methodname">getFieldCount ( <span class="methodparam">void )

public array getFieldNames ( <span class="methodparam">void )

public <span class="type">SolrInputDocument <span class="methodname">getInputDocument ( <span class="methodparam">void )

public bool hasChildDocuments ( <span class="methodparam">void )

public bool __isset ( <span class="methodparam">string $fieldName )

public string key ( <span class="methodparam">void )

public bool merge ( <span class="type">SolrDocument $sourceDoc [, <span class="methodparam">bool $overwrite<span class="initializer"> = true ] )

public void next ( <span class="methodparam">void )

public bool offsetExists ( <span class="methodparam">string $fieldName )

public <span class="type">SolrDocumentField <span class="methodname">offsetGet ( <span class="type">string $fieldName )

public void offsetSet ( <span class="methodparam">string $fieldName , string $fieldValue )

public void offsetUnset ( <span class="methodparam">string $fieldName )

public bool reset ( <span class="methodparam">void )

public void rewind ( <span class="methodparam">void )

public string serialize ( <span class="methodparam">void )

public bool __set ( <span class="methodparam">string $fieldName , string $fieldValue )

public bool sort ( <span class="type">int $sortOrderBy [, <span class="methodparam">int $sortDirection<span class="initializer"> = SolrDocument::SORT_ASC ] )

public array toArray ( <span class="methodparam">void )

public void unserialize ( <span class="methodparam">string $serialized )

public bool __unset ( <span class="methodparam">string $fieldName )

public bool valid ( <span class="methodparam">void )

}

预定义常量

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.

SolrDocument::addField

Adds a field to the document

说明

public bool SolrDocument::addField ( <span class="methodparam">string $fieldName , string $fieldValue )

This method adds a field to the SolrDocument instance.

参数

fieldName
The name of the field

fieldValue
The value of the field.

返回值

成功时返回 true, 或者在失败时返回 false

SolrDocument::clear

Drops all the fields in the document

说明

public bool SolrDocument::clear ( <span class="methodparam">void )

Resets the current object. Discards all the fields and resets the document boost to zero.

参数

此函数没有参数。

返回值

成功时返回 true, 或者在失败时返回 false

SolrDocument::__clone

Creates a copy of a SolrDocument object

说明

public void SolrDocument::__clone ( <span class="methodparam">void )

Creates a copy of a SolrDocument object. Not to be called directly.

参数

此函数没有参数。

返回值

None.

SolrDocument::__construct

Constructor

说明

public <span class="methodname">SolrDocument::__construct ( <span class="methodparam">void )

Constructor for SolrDocument

参数

此函数没有参数。

返回值

SolrDocument::current

Retrieves the current field

说明

public <span class="type">SolrDocumentField <span class="methodname">SolrDocument::current ( <span class="methodparam">void )

Retrieves the current field

参数

此函数没有参数。

返回值

Returns the field

SolrDocument::deleteField

Removes a field from the document

说明

public bool SolrDocument::deleteField ( <span class="methodparam">string $fieldName )

Removes a field from the document.

参数

fieldName
Name of the field

返回值

成功时返回 true, 或者在失败时返回 false

SolrDocument::__destruct

Destructor

说明

public void SolrDocument::__destruct ( <span class="methodparam">void )

Destructor for SolrDocument.

参数

此函数没有参数。

返回值

SolrDocument::fieldExists

Checks if a field exists in the document

说明

public bool SolrDocument::fieldExists ( <span class="methodparam">string $fieldName )

Checks if the requested field as a valid fieldname in the document.

参数

fieldName
The name of the field.

返回值

Returns true if the field is present and false if it does not.

SolrDocument::__get

Access the field as a property

说明

public <span class="type">SolrDocumentField <span class="methodname">SolrDocument::__get ( <span class="methodparam">string $fieldName )

Magic method for accessing the field as a property.

参数

fieldName
The name of the field.

返回值

Returns a SolrDocumentField instance.

SolrDocument::getChildDocuments

Returns an array of child documents (SolrDocument)

说明

public array SolrDocument::getChildDocuments ( <span class="methodparam">void )

Returns an array of child documents (SolrDocument)

参数

此函数没有参数。

返回值

参见

  • SolrDocument::hasChildDocuments
  • SolrDocument::getChildDocumentsCount

SolrDocument::getChildDocumentsCount

Returns the number of child documents

说明

public int <span class="methodname">SolrDocument::getChildDocumentsCount ( <span class="methodparam">void )

Returns the number of child documents

参数

此函数没有参数。

返回值

参见

  • SolrDocument::hasChildDocuments
  • SolrDocument::getChildDocuments

SolrDocument::getField

Retrieves a field by name

说明

public <span class="type">SolrDocumentField <span class="methodname">SolrDocument::getField ( <span class="methodparam">string $fieldName )

Retrieves a field by name.

参数

fieldName
Name of the field.

返回值

Returns a SolrDocumentField on success and false on failure.

SolrDocument::getFieldCount

Returns the number of fields in this document

说明

public int <span class="methodname">SolrDocument::getFieldCount ( <span class="methodparam">void )

Returns the number of fields in this document. Multi-value fields are only counted once.

参数

此函数没有参数。

返回值

Returns an integer on success and false on failure.

SolrDocument::getFieldNames

Returns an array of fields names in the document

说明

public array SolrDocument::getFieldNames ( <span class="methodparam">void )

Returns an array of fields names in the document.

参数

此函数没有参数。

返回值

Returns an array containing the names of the fields in this document.

SolrDocument::getInputDocument

Returns a SolrInputDocument equivalent of the object

说明

public <span class="type">SolrInputDocument <span class="methodname">SolrDocument::getInputDocument ( <span class="methodparam">void )

Returns a SolrInputDocument equivalent of the object. This is useful if one wishes to resubmit/update a document retrieved from a query.

参数

此函数没有参数。

返回值

Returns a SolrInputDocument on success and null on failure.

SolrDocument::hasChildDocuments

Checks whether the document has any child documents

说明

public bool SolrDocument::hasChildDocuments ( <span class="methodparam">void )

Checks whether the document has any child documents

参数

此函数没有参数。

返回值

参见

  • SolrDocument::getChildDocuments
  • SolrDocument::getChildDocumentsCount

SolrDocument::__isset

Checks if a field exists

说明

public bool SolrDocument::__isset ( <span class="methodparam">string $fieldName )

Checks if a field exists

参数

fieldName
Name of the field.

返回值

成功时返回 true, 或者在失败时返回 false

SolrDocument::key

Retrieves the current key

说明

public string SolrDocument::key ( <span class="methodparam">void )

Retrieves the current key.

参数

此函数没有参数。

返回值

Returns the current key.

SolrDocument::merge

Merges source to the current SolrDocument

说明

public bool SolrDocument::merge ( <span class="methodparam">SolrDocument $sourceDoc [, <span class="type">bool $overwrite = true ] )

Merges source to the current SolrDocument.

参数

sourceDoc
The source document.

overwrite
If this is true then fields with the same name in the destination document will be overwritten.

返回值

成功时返回 true, 或者在失败时返回 false

SolrDocument::next

Moves the internal pointer to the next field

说明

public void SolrDocument::next ( <span class="methodparam">void )

Moves the internal pointer to the next field.

参数

此函数没有参数。

返回值

This method has no return value.

SolrDocument::offsetExists

Checks if a particular field exists

说明

public bool SolrDocument::offsetExists ( <span class="methodparam">string $fieldName )

Checks if a particular field exists. This is used when the object is treated as an array.

参数

fieldName
The name of the field.

返回值

成功时返回 true, 或者在失败时返回 false

SolrDocument::offsetGet

Retrieves a field

说明

public <span class="type">SolrDocumentField <span class="methodname">SolrDocument::offsetGet ( <span class="methodparam">string $fieldName )

This is used to retrieve the field when the object is treated as an array.

参数

fieldName
The name of the field.

返回值

Returns a SolrDocumentField object.

SolrDocument::offsetSet

Adds a field to the document

说明

public void SolrDocument::offsetSet ( <span class="methodparam">string $fieldName , string $fieldValue )

Used when the object is treated as an array to add a field to the document.

参数

fieldName
The name of the field.

fieldValue
The value for this field.

返回值

成功时返回 true, 或者在失败时返回 false

SolrDocument::offsetUnset

Removes a field

说明

public void SolrDocument::offsetUnset ( <span class="methodparam">string $fieldName )

Removes a field from the document.

参数

fieldName
The name of the field.

返回值

No return value.

SolrDocument::reset

This is an alias to SolrDocument::clear()

说明

public bool SolrDocument::reset ( <span class="methodparam">void )

This is an alias to SolrDocument::clear()

参数

此函数没有参数。

返回值

成功时返回 true, 或者在失败时返回 false

SolrDocument::rewind

Resets the internal pointer to the beginning

说明

public void SolrDocument::rewind ( <span class="methodparam">void )

Resets the internal pointer to the beginning.

参数

此函数没有参数。

返回值

This method has no return value.

SolrDocument::serialize

Used for custom serialization

说明

public string SolrDocument::serialize ( <span class="methodparam">void )

Used for custom serialization.

参数

此函数没有参数。

返回值

Returns a string representing the serialized Solr document.

SolrDocument::__set

Adds another field to the document

说明

public bool SolrDocument::__set ( <span class="methodparam">string $fieldName , string $fieldValue )

Adds another field to the document. Used to set the fields as new properties.

参数

fieldName
Name of the field.

fieldValue
Field value.

返回值

成功时返回 true, 或者在失败时返回 false

SolrDocument::sort

Sorts the fields in the document

说明

public bool SolrDocument::sort ( <span class="methodparam">int $sortOrderBy [, int $sortDirection = SolrDocument::SORT_ASC ] )

The fields are rearranged according to the specified criteria and sort direction

   Fields can be sorted by boost values, field names and number of values.

   The sortOrderBy parameter must be one of :

   * SolrDocument::SORT_FIELD_NAME
   * SolrDocument::SORT_FIELD_BOOST_VALUE
   * SolrDocument::SORT_FIELD_VALUE_COUNT

   The sortDirection can be one of :

   * SolrDocument::SORT_DEFAULT
   * SolrDocument::SORT_ASC
   * SolrDocument::SORT_DESC

   The default way is to sort in ascending order.

参数

sortOrderBy
The sort criteria.

sortDirection
The sort direction.

返回值

成功时返回 true, 或者在失败时返回 false

SolrDocument::toArray

Returns an array representation of the document

说明

public array SolrDocument::toArray ( <span class="methodparam">void )

Returns an array representation of the document.

参数

此函数没有参数。

返回值

Returns an array representation of the document.

范例

示例 #1 SolrDocument::toArray example

<?php

$doc = new SolrDocument();

$doc->addField('id', 1123);

$doc->features = "PHP Client Side";
$doc->features = "Fast development cycles";

$doc['cat'] = 'Software';
$doc['cat'] = 'Custom Search';
$doc->cat   = 'Information Technology';

print_r($doc->toArray());

?>

以上例程的输出类似于:

Array
(
    [document_boost] => 0
    [field_count] => 3
    [fields] => Array
        (
            [0] => SolrDocumentField Object
                (
                    [name] => id
                    [boost] => 0
                    [values] => Array
                        (
                            [0] => 1123
                        )

                )

            [1] => SolrDocumentField Object
                (
                    [name] => features
                    [boost] => 0
                    [values] => Array
                        (
                            [0] => PHP Client Side
                            [1] => Fast development cycles
                        )

                )

            [2] => SolrDocumentField Object
                (
                    [name] => cat
                    [boost] => 0
                    [values] => Array
                        (
                            [0] => Software
                            [1] => Custom Search
                            [2] => Information Technology
                        )

                )

        )

)

SolrDocument::unserialize

Custom serialization of SolrDocument objects

说明

public void SolrDocument::unserialize ( <span class="methodparam">string $serialized )

Custom serialization of SolrDocument objects

参数

serialized
An XML representation of the document.

返回值

None.

SolrDocument::__unset

Removes a field from the document

说明

public bool SolrDocument::__unset ( <span class="methodparam">string $fieldName )

Removes a field from the document when the field is access as an object property.

参数

fieldName
The name of the field.

返回值

成功时返回 true, 或者在失败时返回 false

SolrDocument::valid

Checks if the current position internally is still valid

说明

public bool SolrDocument::valid ( <span class="methodparam">void )

Checks if the current position internally is still valid. It is used during foreach operations.

参数

此函数没有参数。

返回值

Returns true on success and false if the current position is no longer valid.

简介

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

类摘要

SolrDocumentField

final class SolrDocumentField {

/* 属性 */

public <span class="modifier">readonly string $name ;

public <span class="modifier">readonly float $boost ;

public <span class="modifier">readonly array $values ;

/* 方法 */

public <span class="methodname">__construct ( <span class="methodparam">void )

public void __destruct ( <span class="methodparam">void )

}

属性

name
The name of the field.

boost
The boost value for the field

values
An array of values for this field

SolrDocumentField::__construct

Constructor

说明

public <span class="methodname">SolrDocumentField::__construct ( <span class="methodparam">void )

Constructor.

参数

此函数没有参数。

返回值

None.

SolrDocumentField::__destruct

Destructor

说明

public void SolrDocumentField::__destruct ( <span class="methodparam">void )

Destructor.

参数

此函数没有参数。

返回值

None.

简介

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

类摘要

SolrObject

final class SolrObject implements <span class="interfacename">ArrayAccess {

/* 方法 */

public <span class="methodname">__construct ( <span class="methodparam">void )

public void __destruct ( <span class="methodparam">void )

public array getPropertyNames ( <span class="methodparam">void )

public bool offsetExists ( <span class="methodparam">string $property_name )

public mixed offsetGet ( <span class="methodparam">string $property_name )

public void offsetSet ( <span class="methodparam">string $property_name , <span class="type">string $property_value )

public void offsetUnset ( <span class="methodparam">string $property_name )

}

SolrObject::__construct

Creates Solr object

说明

public <span class="methodname">SolrObject::__construct ( <span class="methodparam">void )

Creates Solr object.

参数

此函数没有参数。

返回值

None

范例

示例 #1 SolrObject::__construct example

<?php
/* ... */
?>

以上例程的输出类似于:

...

参见

  • Classname::Method

SolrObject::__destruct

Destructor

说明

public void SolrObject::__destruct ( <span class="methodparam">void )

The destructor

参数

此函数没有参数。

返回值

None.

SolrObject::getPropertyNames

Returns an array of all the names of the properties

说明

public array SolrObject::getPropertyNames ( <span class="methodparam">void )

Returns an array of all the names of the properties

参数

此函数没有参数。

返回值

Returns an array.

SolrObject::offsetExists

Checks if the property exists

说明

public bool SolrObject::offsetExists ( <span class="methodparam">string $property_name )

Checks if the property exists. This is used when the object is treated as an array.

参数

property_name
The name of the property.

返回值

成功时返回 true, 或者在失败时返回 false

SolrObject::offsetGet

Used to retrieve a property

说明

public mixed SolrObject::offsetGet ( <span class="methodparam">string $property_name )

Used to get the value of a property. This is used when the object is treated as an array.

参数

property_name
Name of the property.

返回值

Returns the property value.

SolrObject::offsetSet

Sets the value for a property

说明

public void SolrObject::offsetSet ( <span class="methodparam">string $property_name , <span class="type">string $property_value )

Sets the value for a property. This is used when the object is treated as an array. This object is read-only. This should never be attempted.

参数

property_name
The name of the property.

property_value
The new value.

返回值

None.

SolrObject::offsetUnset

Unsets the value for the property

说明

public void SolrObject::offsetUnset ( <span class="methodparam">string $property_name )

Unsets the value for the property. This is used when the object is treated as an array. This object is read-only. This should never be attempted.

参数

property_name
The name of the property.

返回值

成功时返回 true, 或者在失败时返回 false

范例

示例 #1 SolrObject::offsetUnset example

<?php
/* ... */
?>

以上例程的输出类似于:

...

参见

  • Classname::Method

简介

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

类摘要

SolrClient

final class SolrClient {

/* 常量 */

const int SolrClient::SEARCH_SERVLET_TYPE = 1 ;

const int SolrClient::UPDATE_SERVLET_TYPE = 2 ;

const int SolrClient::THREADS_SERVLET_TYPE = 4 ;

const int SolrClient::PING_SERVLET_TYPE = 8 ;

const int SolrClient::TERMS_SERVLET_TYPE = 16 ;

const int SolrClient::SYSTEM_SERVLET_TYPE = 32 ;

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 ;

const string SolrClient::DEFAULT_SYSTEM_SERVLET = admin/system ;

/* 方法 */

public <span class="type">SolrUpdateResponse <span class="methodname">addDocument ( <span class="type">SolrInputDocument $doc [, <span class="methodparam">bool $overwrite<span class="initializer"> = true [, <span class="methodparam">int $commitWithin<span class="initializer"> = 0 ]] )

public void addDocuments ( <span class="methodparam">array $docs [, bool $overwrite = true [, int $commitWithin = 0 ]] )

public <span class="type">SolrUpdateResponse <span class="methodname">commit ([ <span class="type">bool $softCommit = false [, <span class="type">bool $waitSearcher = true [, <span class="type">bool $expungeDeletes = false ]]] )

public <span class="methodname">__construct ( <span class="methodparam">array $clientOptions )

public <span class="type">SolrUpdateResponse <span class="methodname">deleteById ( <span class="type">string $id )

public <span class="type">SolrUpdateResponse <span class="methodname">deleteByIds ( <span class="type">array $ids )

public <span class="type">SolrUpdateResponse <span class="methodname">deleteByQueries ( <span class="methodparam">array $queries )

public <span class="type">SolrUpdateResponse <span class="methodname">deleteByQuery ( <span class="methodparam">string $query )

public void __destruct ( <span class="methodparam">void )

public <span class="type">SolrQueryResponse <span class="methodname">getById ( <span class="type">string $id )

public <span class="type">SolrQueryResponse <span class="methodname">getByIds ( <span class="type">array $ids )

public string getDebug ( <span class="methodparam">void )

public array getOptions ( <span class="methodparam">void )

public <span class="type">SolrUpdateResponse <span class="methodname">optimize ([ <span class="type">int $maxSegments = 1 [, <span class="type">bool $softCommit = true [, <span class="type">bool $waitSearcher = true ]]] )

public <span class="type">SolrPingResponse <span class="methodname">ping ( void )

public <span class="type">SolrQueryResponse <span class="methodname">query ( <span class="type">SolrParams $query )

public <span class="type">SolrUpdateResponse <span class="methodname">request ( <span class="type">string $raw_request )

public <span class="type">SolrUpdateResponse <span class="methodname">rollback ( <span class="methodparam">void )

public void setResponseWriter ( <span class="methodparam">string $responseWriter )

public bool setServlet ( <span class="methodparam">int $type , <span class="methodparam">string $value )

public void system ( <span class="methodparam">void )

public void threads ( <span class="methodparam">void )

}

预定义常量

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

SolrClient::DEFAULT_UPDATE_SERVLET
This is the initial value for the update servlet.

SolrClient::DEFAULT_THREADS_SERVLET
This is the initial value for the threads servlet.

SolrClient::DEFAULT_PING_SERVLET
This is the initial value for the ping servlet.

SolrClient::DEFAULT_TERMS_SERVLET
This is the initial value for the terms servlet used for the TermsComponent

SolrClient::DEFAULT_SYSTEM_SERVLET
This is the initial value for the system servlet used to obtain Solr Server information

SolrClient::addDocument

Adds a document to the index

说明

public <span class="type">SolrUpdateResponse <span class="methodname">SolrClient::addDocument ( <span class="methodparam">SolrInputDocument $doc [, <span class="type">bool $overwrite = true [, <span class="type">int $commitWithin = 0 ]] )

This method adds a document to the index.

参数

doc
The SolrInputDocument instance.

overwrite
Whether to overwrite existing document or not. If false there will be duplicates (several documents with the same ID).

Warning PECL Solr \< 2.0 $allowDups was used instead of $overwrite, which does the same functionality with exact opposite bool flag.

$allowDups = false is the same as $overwrite = true

commitWithin
Number of milliseconds within which to auto commit this document. Available since Solr 1.4 . Default (0) means disabled.

When this value specified, it leaves the control of when to do the commit to Solr itself, optimizing number of commits to a minimum while still fulfilling the update latency requirements, and Solr will automatically do a commit when the oldest add in the buffer is due.

返回值

Returns a SolrUpdateResponse object or throws an Exception on failure.

错误/异常

Throws SolrClientException if the client had failed, or there was a connection issue.

Throws SolrServerException if the Solr Server had failed to process the request.

范例

示例 #1 SolrClient::addDocument example

<?php

$options = array
(
    'hostname' => SOLR_SERVER_HOSTNAME,
    'login'    => SOLR_SERVER_USERNAME,
    'password' => SOLR_SERVER_PASSWORD,
    'port'     => SOLR_SERVER_PORT,
);

$client = new SolrClient($options);

$doc = new SolrInputDocument();

$doc->addField('id', 334455);
$doc->addField('cat', 'Software');
$doc->addField('cat', 'Lucene');

$updateResponse = $client->addDocument($doc);

// you will have to commit changes to be written if you didn't use $commitWithin
$client->commit();

print_r($updateResponse->getResponse());

?>

以上例程的输出类似于:

SolrObject Object
(
    [responseHeader] => SolrObject Object
        (
            [status] => 0
            [QTime] => 1
        )

)

示例 #2 SolrClient::addDocument example 2

<?php

$options = array
(
    'hostname' => SOLR_SERVER_HOSTNAME,
    'login'    => SOLR_SERVER_USERNAME,
    'password' => SOLR_SERVER_PASSWORD,
    'port'     => SOLR_SERVER_PORT,
);

$client = new SolrClient($options);

$doc = new SolrInputDocument();

$doc->addField('id', 334455);
$doc->addField('cat', 'Software');
$doc->addField('cat', 'Lucene');

// No need to call commit() because $commitWithin is passed, so Solr Server will auto commit within 10 seconds
$updateResponse = $client->addDocument($doc, false, 10000);

print_r($updateResponse->getResponse());

?>

以上例程的输出类似于:

SolrObject Object
(
    [responseHeader] => SolrObject Object
        (
            [status] => 0
            [QTime] => 1
        )

)

参见

  • SolrClient::addDocuments
  • SolrClient::commit

SolrClient::addDocuments

Adds a collection of SolrInputDocument instances to the index

说明

public void SolrClient::addDocuments ( <span class="methodparam">array $docs [, bool $overwrite = true [, int $commitWithin = 0 ]] )

Adds a collection of documents to the index.

参数

docs
An array containing the collection of SolrInputDocument instances. This array must be an actual variable.

overwrite
Whether to overwrite existing documents or not. If false there will be duplicates (several documents with the same ID).

Warning PECL Solr \< 2.0 $allowDups was used instead of $overwrite, which does the same functionality with exact opposite bool flag.

$allowDups = false is the same as $overwrite = true

commitWithin
Number of milliseconds within which to auto commit this document. Available since Solr 1.4 . Default (0) means disabled.

When this value specified, it leaves the control of when to do the commit to Solr itself, optimizing number of commits to a minimum while still fulfilling the update latency requirements, and Solr will automatically do a commit when the oldest add in the buffer is due.

返回值

Returns a SolrUpdateResponse object or throws an exception on failure.

错误/异常

Throws SolrClientException if the client had failed, or there was a connection issue.

Throws SolrServerException if the Solr Server had failed to process the request.

范例

示例 #1 SolrClient::addDocuments example

<?php

$options = array
(
    'hostname' => SOLR_SERVER_HOSTNAME,
    'login'    => SOLR_SERVER_USERNAME,
    'password' => SOLR_SERVER_PASSWORD,
    'port'     => SOLR_SERVER_PORT,
);

$client = new SolrClient($options);

$doc = new SolrInputDocument();

$doc->addField('id', 334455);
$doc->addField('cat', 'Software');
$doc->addField('cat', 'Lucene');

$doc2 = clone $doc;

$doc2->deleteField('id');
$doc2->addField('id', 334456);

$docs = array($doc, $doc2);

$updateResponse = $client->addDocuments($docs);

// no changes will be written to disk unless $commitWithin is passed or SolrClient::commit is called

print_r($updateResponse->getResponse());

?>

以上例程的输出类似于:

SolrObject Object
(
    [responseHeader] => SolrObject Object
        (
            [status] => 0
            [QTime] => 2
        )

)

参见

  • SolrClient::addDocument
  • SolrClient::commit

SolrClient::commit

Finalizes all add/deletes made to the index

说明

public <span class="type">SolrUpdateResponse <span class="methodname">SolrClient::commit ([ <span class="methodparam">bool $softCommit<span class="initializer"> = false [, <span class="methodparam">bool $waitSearcher<span class="initializer"> = true [, <span class="methodparam">bool $expungeDeletes = false ]]] )

This method finalizes all add/deletes made to the index.

参数

softCommit
This will refresh the 'view' of the index in a more performant manner, but without "on-disk" guarantees. (Solr4.0+)

A soft commit is much faster since it only makes index changes visible and does not fsync index files or write a new index descriptor. If the JVM crashes or there is a loss of power, changes that occurred after the last hard commit will be lost. Search collections that have near-real-time requirements (that want index changes to be quickly visible to searches) will want to soft commit often but hard commit less frequently.

waitSearcher
block until a new searcher is opened and registered as the main query searcher, making the changes visible.

expungeDeletes
Merge segments with deletes away. (Solr1.4+)

返回值

Returns a SolrUpdateResponse object on success or throws an exception on failure.

错误/异常

Throws SolrClientException if the client had failed, or there was a connection issue.

Throws SolrServerException if the Solr Server had failed to process the request.

更新日志

版本 说明
PECL solr 1.1.0, 2.0.0 $maxSegments removed
PECL solr 2.0.0b API Changed: SolrClient::commit ([ int $maxSegments = 0 [, bool $softCommit = false [, bool $waitSearcher = true[, bool $expungeDeletes = false ]]] )
PECL solr 0.9.2 Signature: SolrClient::commit ([ int $maxSegments = 1 [, bool $waitFlush = true [, bool $waitSearcher = true ]]] ). $waitFlush: Block until index changes are flushed to disk.

注释

Warning

PECL Solr >= 2.0 only supports Solr Server >= 4.0

参见

  • SolrClient::optimize
  • SolrClient::rollback

SolrClient::__construct

Constructor for the SolrClient object

说明

public <span class="methodname">SolrClient::__construct ( <span class="methodparam">array $clientOptions )

Constructor for the SolrClient object

参数

clientOptions
This is an array containing one of the following keys :

- secure          (Boolean value indicating whether or not to connect in secure mode)
 - hostname        (The hostname for the Solr server)
 - port            (The port number)
 - path            (The path to solr)
 - wt              (The name of the response writer e.g. xml, json)
 - login           (The username used for HTTP Authentication, if any)
 - password        (The HTTP Authentication password)
 - proxy_host      (The hostname for the proxy server, if any)
 - proxy_port      (The proxy port)
 - proxy_login     (The proxy username)
 - proxy_password  (The proxy password)
 - timeout         (This is maximum time in seconds allowed for the http data transfer operation. Default is 30 seconds)
 - ssl_cert        (File name to a PEM-formatted file containing the private key + private certificate (concatenated in that order) )
 - ssl_key         (File name to a PEM-formatted private key file only)
 - ssl_keypassword (Password for private key)
 - ssl_cainfo      (Name of file holding one or more CA certificates to verify peer with)
 - ssl_capath      (Name of directory holding multiple CA certificates to verify peer with )

 Please note the if the ssl_cert file only contains the private certificate, you have to specify a separate ssl_key file

 The ssl_keypassword option is required if the ssl_cert or ssl_key options are set.

错误/异常

Throws SolrIllegalArgumentException on failure.

范例

示例 #1 SolrClient::__construct example

<?php

$options = array
(
    'hostname' => SOLR_SERVER_HOSTNAME,
    'login'    => SOLR_SERVER_USERNAME,
    'password' => SOLR_SERVER_PASSWORD,
    'port'     => SOLR_SERVER_PORT,
    'path'     => SOLR_PATH_TO_SOLR,
    'wt'       => 'xml',
);

$client = new SolrClient($options);

$doc = new SolrInputDocument();

$doc->addField('id', 334455);
$doc->addField('cat', 'Software');
$doc->addField('cat', 'Lucene');

$updateResponse = $client->addDocument($doc);

?>

以上例程的输出类似于:

参见

  • SolrClient::getOptions

SolrClient::deleteById

Delete by Id

说明

public <span class="type">SolrUpdateResponse <span class="methodname">SolrClient::deleteById ( <span class="methodparam">string $id )

Deletes the document with the specified ID. Where ID is the value of the uniqueKey field declared in the schema

参数

id
The value of the uniqueKey field declared in the schema

返回值

Returns a SolrUpdateResponse on success and throws an exception on failure.

错误/异常

Throws SolrClientException if the client had failed, or there was a connection issue.

Throws SolrServerException if the Solr Server had failed to process the request.

参见

  • SolrClient::deleteByIds
  • SolrClient::deleteByQuery
  • SolrClient::deleteByQueries

SolrClient::deleteByIds

Deletes by Ids

说明

public <span class="type">SolrUpdateResponse <span class="methodname">SolrClient::deleteByIds ( <span class="methodparam">array $ids )

Deletes a collection of documents with the specified set of ids.

参数

ids
An array of IDs representing the uniqueKey field declared in the schema for each document to be deleted. This must be an actual php variable.

返回值

Returns a SolrUpdateResponse on success and throws an exception on failure.

错误/异常

Throws SolrClientException if the client had failed, or there was a connection issue.

Throws SolrServerException if the Solr Server had failed to process the request.

参见

  • SolrClient::deleteById
  • SolrClient::deleteByQuery
  • SolrClient::deleteByQueries

SolrClient::deleteByQueries

Removes all documents matching any of the queries

说明

public <span class="type">SolrUpdateResponse <span class="methodname">SolrClient::deleteByQueries ( <span class="methodparam">array $queries )

Removes all documents matching any of the queries

参数

queries
The array of queries. This must be an actual php variable.

返回值

Returns a SolrUpdateResponse on success and throws a SolrClientException on failure.

错误/异常

Throws SolrClientException if the client had failed, or there was a connection issue.

Throws SolrServerException if the Solr Server had failed to process the request.

参见

  • SolrClient::deleteById
  • SolrClient::deleteByIds
  • SolrClient::deleteByQuery

SolrClient::deleteByQuery

Deletes all documents matching the given query

说明

public <span class="type">SolrUpdateResponse <span class="methodname">SolrClient::deleteByQuery ( <span class="methodparam">string $query )

Deletes all documents matching the given query.

参数

query
The query

返回值

Returns a SolrUpdateResponse on success and throws an exception on failure.

错误/异常

Throws SolrClientException if the client had failed, or there was a connection issue.

Throws SolrServerException if the Solr Server had failed to process the request.

范例

示例 #1 SolrQuery::deleteByQuery example

<?php

$options = array
(
    'hostname' => SOLR_SERVER_HOSTNAME,
    'login'    => SOLR_SERVER_USERNAME,
    'password' => SOLR_SERVER_PASSWORD,
    'port'     => SOLR_SERVER_PORT,
);

$client = new SolrClient($options);

//This will erase the entire index
$client->deleteByQuery("*:*");
$client->commit();

?>

参见

  • SolrClient::deleteById
  • SolrClient::deleteByIds
  • SolrClient::deleteByQueries

SolrClient::__destruct

Destructor for SolrClient

说明

public void SolrClient::__destruct ( <span class="methodparam">void )

Destructor

参数

此函数没有参数。

返回值

Destructor for SolrClient

参见

  • SolrClient::__construct

SolrClient::getById

Get Document By Id. Utilizes Solr Realtime Get (RTG)

说明

public <span class="type">SolrQueryResponse <span class="methodname">SolrClient::getById ( <span class="methodparam">string $id )

Get Document By Id. Utilizes Solr Realtime Get (RTG).

参数

id
Document ID

返回值

SolrQueryResponse

范例

示例 #1 SolrClient::getById example

<?php

include "bootstrap.php";

$options = array
(
    'hostname' => SOLR_SERVER_HOSTNAME,
    'login'    => SOLR_SERVER_USERNAME,
    'password' => SOLR_SERVER_PASSWORD,
    'port'     => SOLR_SERVER_PORT,
    'path'     => SOLR_SERVER_PATH
);

$client = new SolrClient($options);
$response = $client->getById('GB18030TEST');
print_r($response->getResponse());

?>

以上例程的输出类似于:

SolrObject Object
(
    [doc] => SolrObject Object
        (
            [id] => GB18030TEST
            [name] => Array
                (
                    [0] => Test with some GB18030 encoded characters
                )

            [features] => Array
                (
                    [0] => No accents here
                    [1] => 这是一个功能
                    [2] => This is a feature (translated)
                    [3] => 这份文件是很有光泽
                    [4] => This document is very shiny (translated)
                )

            [price] => Array
                (
                    [0] => 0
                )

            [inStock] => Array
                (
                    [0] => 1
                )

            [_version_] => 1510294336239042560
        )

)

参见

  • SolrClient::getByIds

SolrClient::getByIds

Get Documents by their Ids. Utilizes Solr Realtime Get (RTG)

说明

public <span class="type">SolrQueryResponse <span class="methodname">SolrClient::getByIds ( <span class="methodparam">array $ids )

Get Documents by their Ids. Utilizes Solr Realtime Get (RTG).

参数

ids
Document ids

返回值

SolrQueryResponse

范例

示例 #1 SolrClient::getByIds example

<?php

include "bootstrap.php";

$options = array
(
    'hostname' => SOLR_SERVER_HOSTNAME,
    'login'    => SOLR_SERVER_USERNAME,
    'password' => SOLR_SERVER_PASSWORD,
    'port'     => SOLR_SERVER_PORT,
    'path'     => SOLR_SERVER_PATH
);

$client = new SolrClient($options);
$response = $client->getByIds(['GB18030TEST', '6H500F0']);

print_r($response->getResponse());

?>

以上例程的输出类似于:

SolrObject Object
(
    [response] => SolrObject Object
        (
            [numFound] => 2
            [start] => 0
            [docs] => Array
                (
                    [0] => SolrObject Object
                        (
                            [id] => GB18030TEST
                            [name] => Array
                                (
                                    [0] => Test with some GB18030 encoded characters
                                )

                            [features] => Array
                                (
                                    [0] => No accents here
                                    [1] => 这是一个功能
                                    [2] => This is a feature (translated)
                                    [3] => 这份文件是很有光泽
                                    [4] => This document is very shiny (translated)
                                )

                            [price] => Array
                                (
                                    [0] => 0
                                )

                            [inStock] => Array
                                (
                                    [0] => 1
                                )

                            [_version_] => 1510294336239042560
                        )

                    [1] => SolrObject Object
                        (
                            [id] => 6H500F0
                            [name] => Array
                                (
                                    [0] => Maxtor DiamondMax 11 - hard drive - 500 GB - SATA-300
                                )

                            [manu] => Array
                                (
                                    [0] => Maxtor Corp.
                                )

                            [manu_id_s] => maxtor
                            [cat] => Array
                                (
                                    [0] => electronics
                                    [1] => hard drive
                                )

                            [features] => Array
                                (
                                    [0] => SATA 3.0Gb/s, NCQ
                                    [1] => 8.5ms seek
                                    [2] => 16MB cache
                                )

                            [price] => Array
                                (
                                    [0] => 350
                                )

                            [popularity] => Array
                                (
                                    [0] => 6
                                )

                            [inStock] => Array
                                (
                                    [0] => 1
                                )

                            [store] => Array
                                (
                                    [0] => 45.17614,-93.87341
                                )

                            [manufacturedate_dt] => 2006-02-13T15:26:37Z
                            [_version_] => 1510294336449806336
                        )

                )

        )

)

参见

  • SolrClient::getById

SolrClient::getDebug

Returns the debug data for the last connection attempt

说明

public string SolrClient::getDebug ( <span class="methodparam">void )

Returns the debug data for the last connection attempt

参数

此函数没有参数。

返回值

Returns a string on success and null if there is nothing to return.

SolrClient::getOptions

Returns the client options set internally

说明

public array SolrClient::getOptions ( <span class="methodparam">void )

Returns the client options set internally. Very useful for debugging. The values returned are readonly and can only be set when the object is instantiated.

参数

此函数没有参数。

返回值

Returns an array containing all the options for the SolrClient object set internally.

参见

  • SolrClient::__construct

SolrClient::optimize

Defragments the index

说明

public <span class="type">SolrUpdateResponse <span class="methodname">SolrClient::optimize ([ <span class="methodparam">int $maxSegments<span class="initializer"> = 1 [, <span class="methodparam">bool $softCommit<span class="initializer"> = true [, <span class="methodparam">bool $waitSearcher<span class="initializer"> = true ]]] )

Defragments the index for faster search performance.

参数

maxSegments
Optimizes down to at most this number of segments. Since Solr 1.3

softCommit
This will refresh the 'view' of the index in a more performant manner, but without "on-disk" guarantees. (Solr4.0+)

waitSearcher
Block until a new searcher is opened and registered as the main query searcher, making the changes visible.

返回值

Returns a SolrUpdateResponse on success or throws an exception on failure.

错误/异常

Throws SolrClientException if the client had failed, or there was a connection issue.

Throws SolrServerException if the Solr Server had failed to process the request.

注释

Warning

PECL Solr >= 2.0 only supports Solr Server >= 4.0

Prior to PECL Solr 2.0 this method used to accept these arguments "int $maxSegments, bool $waitFlush, bool $waitSearcher".

参见

  • SolrClient::commit
  • SolrClient::rollback

SolrClient::ping

Checks if Solr server is still up

说明

public <span class="type">SolrPingResponse <span class="methodname">SolrClient::ping ( <span class="methodparam">void )

Checks if the Solr server is still alive. Sends a HEAD request to the Apache Solr server.

参数

此函数没有参数。

返回值

Returns a SolrPingResponse object on success and throws an exception on failure.

错误/异常

Throws SolrClientException if the client had failed, or there was a connection issue.

Throws SolrServerException if the Solr Server had failed to satisfy the request.

范例

示例 #1 SolrClient::ping example

<?php
$options = array
(
    'hostname' => SOLR_SERVER_HOSTNAME,
    'login'    => SOLR_SERVER_USERNAME,
    'password' => SOLR_SERVER_PASSWORD,
    'port'     => SOLR_SERVER_PORT,
);

$client = new SolrClient($options);

$pingresponse = $client->ping();

?>

以上例程的输出类似于:

SolrClient::query

Sends a query to the server

说明

public <span class="type">SolrQueryResponse <span class="methodname">SolrClient::query ( <span class="methodparam">SolrParams $query )

Sends a query to the server.

参数

query
A SolrParams object. It is recommended to use SolrQuery for advanced queries.

返回值

Returns a SolrQueryResponse object on success and throws an exception on failure.

错误/异常

Throws SolrClientException if the client had failed, or there was a connection issue.

Throws SolrServerException if the Solr Server had failed to satisfy the query.

范例

示例 #1 SolrClient::query example

<?php

$options = array
(
    'hostname' => 'localhost',
    'login'    => 'username',
    'password' => 'password',
    'port'     => '8983',
);

$client = new SolrClient($options);

$query = new SolrQuery();

$query->setQuery('lucene');

$query->setStart(0);

$query->setRows(50);

$query->addField('cat')->addField('features')->addField('id')->addField('timestamp');

$query_response = $client->query($query);

$response = $query_response->getResponse();

print_r($response);

?>

以上例程的输出类似于:

SolrObject Object
(
    [responseHeader] => SolrObject Object
        (
            [status] => 0
            [QTime] => 3
            [params] => SolrObject Object
                (
                    [fl] => cat,features,id,timestamp
                    [indent] => on
                    [start] => 0
                    [q] => lucene
                    [wt] => xml
                    [version] => 2.2
                    [rows] => 50
                )

        )

    [response] => SolrObject Object
        (
            [numFound] => 1
            [start] => 0
            [docs] => Array
                (
                    [0] => SolrObject Object
                        (
                            [id] => SOLR1000
                            [cat] => Array
                                (
                                    [0] => software
                                    [1] => search
                                )

                            [features] => Array
                                (
                                    [0] => Advanced Full-Text Search Capabilities using Lucene
                                    [1] => Optimized for High Volume Web Traffic
                                    [2] => Standards Based Open Interfaces - XML and HTTP
                                    [3] => Comprehensive HTML Administration Interfaces
                                    [4] => Scalability - Efficient Replication to other Solr Search Servers
                                    [5] => Flexible and Adaptable with XML configuration and Schema
                                    [6] => Good unicode support: héllo (hello with an accent over the e)
                                )

                        )

                )

        )

)

SolrClient::request

Sends a raw update request

说明

public <span class="type">SolrUpdateResponse <span class="methodname">SolrClient::request ( <span class="methodparam">string $raw_request )

Sends a raw XML update request to the server

参数

raw_request
An XML string with the raw request to the server.

返回值

Returns a SolrUpdateResponse on success. Throws an exception on failure.

错误/异常

Throws SolrIllegalArgumentException if raw_request was an empty string

Throws SolrClientException if the client had failed, or there was a connection issue.

Throws SolrServerException if the Solr Server had failed to satisfy the query.

范例

示例 #1 SolrClient::request example

<?php
$options = array
(
    'hostname' => SOLR_SERVER_HOSTNAME,
    'login'    => SOLR_SERVER_USERNAME,
    'password' => SOLR_SERVER_PASSWORD,
    'port'     => SOLR_SERVER_PORT,
);

$client = new SolrClient($options);

$update_response = $client->request("<commit/>");

$response = $update_response->getResponse();

print_r($response);
?>

以上例程的输出类似于:

...

SolrClient::rollback

Rollbacks all add/deletes made to the index since the last commit

说明

public <span class="type">SolrUpdateResponse <span class="methodname">SolrClient::rollback ( <span class="methodparam">void )

Rollbacks all add/deletes made to the index since the last commit. It neither calls any event listeners nor creates a new searcher.

参数

此函数没有参数。

返回值

Returns a SolrUpdateResponse on success or throws a SolrClientException on failure.

参见

  • SolrClient::commit
  • SolrClient::optimize

SolrClient::setResponseWriter

Sets the response writer used to prepare the response from Solr

说明

public void SolrClient::setResponseWriter ( <span class="methodparam">string $responseWriter )

Sets the response writer used to prepare the response from Solr

参数

responseWriter
One of the following:

  • json
  • phps
  • xml

返回值

没有返回值。

范例

示例 #1 SolrClient::setResponseWriter example

<?php

// This is my custom class for objects
class SolrClass
{
   public $_properties = array();

   public function __get($property_name) {

      if (property_exists($this, $property_name)) {

          return $this->$property_name;

      } else if (isset($_properties[$property_name])) {

          return $_properties[$property_name];
      }

      return null;
   }
}

$options = array
(
  'hostname' => 'localhost',
  'port' => 8983,
  'path' => '/solr/core1'
);

$client = new SolrClient($options);

$client->setResponseWriter("json");

//$response = $client->ping();

$query = new SolrQuery();

$query->setQuery("*:*");

$query->set("objectClassName", "SolrClass");

$query->set("objectPropertiesStorageMode", 1); // 0 for independent properties, 1 for combined

try
{

$response = $client->query($query);

$resp = $response->getResponse();

print_r($response);

print_r($resp);

} catch (Exception $e) {

print_r($e);

}

?>

SolrClient::setServlet

Changes the specified servlet type to a new value

说明

public bool SolrClient::setServlet ( <span class="methodparam">int $type , <span class="methodparam">string $value )

Changes the specified servlet type to a new value

参数

type
One of the following :

- SolrClient::SEARCH_SERVLET_TYPE
 - SolrClient::UPDATE_SERVLET_TYPE
 - SolrClient::THREADS_SERVLET_TYPE
 - SolrClient::PING_SERVLET_TYPE
 - SolrClient::TERMS_SERVLET_TYPE

value
The new value for the servlet

返回值

成功时返回 true, 或者在失败时返回 false

SolrClient::system

Retrieve Solr Server information

说明

public void SolrClient::system ( <span class="methodparam">void )

Retrieve Solr Server information

参数

此函数没有参数。

返回值

Returns a SolrGenericResponse object on success.

错误/异常

Emits SolrClientException if the client failed, or there was a connection issue.

Emits SolrServerException if the Solr Server failed to satisfy the query.

SolrClient::threads

Checks the threads status

说明

public void SolrClient::threads ( <span class="methodparam">void )

Checks the threads status

参数

此函数没有参数。

返回值

Returns a SolrGenericResponse object.

错误/异常

Throws SolrClientException if the client failed, or there was a connection issue.

throws SolrServerException if the Solr Server failed to process the request.

简介

Represents a response from the Solr server.

类摘要

SolrResponse

abstract class SolrResponse {

/* 常量 */

const int SolrResponse::PARSE_SOLR_OBJ = 0 ;

const int SolrResponse::PARSE_SOLR_DOC = 1 ;

/* 属性 */

protected int $http_status ;

protected int $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 ;

/* 方法 */

public string getDigestedResponse ( <span class="methodparam">void )

public int <span class="methodname">getHttpStatus ( <span class="methodparam">void )

public string getHttpStatusMessage ( <span class="methodparam">void )

public string getRawRequest ( <span class="methodparam">void )

public string getRawRequestHeaders ( <span class="methodparam">void )

public string getRawResponse ( <span class="methodparam">void )

public string getRawResponseHeaders ( <span class="methodparam">void )

public string getRequestUrl ( <span class="methodparam">void )

public <span class="type">SolrObject <span class="methodname">getResponse ( <span class="methodparam">void )

public bool setParseMode ([ <span class="methodparam">int $parser_mode<span class="initializer"> = 0 ] )

public bool success ( <span class="methodparam">void )

}

属性

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.

预定义常量

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.

SolrResponse::getDigestedResponse

Returns the XML response as serialized PHP data

说明

public string SolrResponse::getDigestedResponse ( void )

Returns the XML response as serialized PHP data

参数

此函数没有参数。

返回值

Returns the XML response as serialized PHP data

SolrResponse::getHttpStatus

Returns the HTTP status of the response

说明

public int <span class="methodname">SolrResponse::getHttpStatus ( <span class="methodparam">void )

Returns the HTTP status of the response.

参数

此函数没有参数。

返回值

Returns the HTTP status of the response.

SolrResponse::getHttpStatusMessage

Returns more details on the HTTP status

说明

public string SolrResponse::getHttpStatusMessage ( void )

Returns more details on the HTTP status.

参数

此函数没有参数。

返回值

Returns more details on the HTTP status

SolrResponse::getRawRequest

Returns the raw request sent to the Solr server

说明

public string SolrResponse::getRawRequest ( <span class="methodparam">void )

Returns the raw request sent to the Solr server.

参数

此函数没有参数。

返回值

Returns the raw request sent to the Solr server

SolrResponse::getRawRequestHeaders

Returns the raw request headers sent to the Solr server

说明

public string SolrResponse::getRawRequestHeaders ( void )

Returns the raw request headers sent to the Solr server.

参数

此函数没有参数。

返回值

Returns the raw request headers sent to the Solr server

SolrResponse::getRawResponse

Returns the raw response from the server

说明

public string SolrResponse::getRawResponse ( <span class="methodparam">void )

Returns the raw response from the server.

参数

此函数没有参数。

返回值

Returns the raw response from the server.

SolrResponse::getRawResponseHeaders

Returns the raw response headers from the server

说明

public string SolrResponse::getRawResponseHeaders ( void )

Returns the raw response headers from the server.

参数

此函数没有参数。

返回值

Returns the raw response headers from the server.

SolrResponse::getRequestUrl

Returns the full URL the request was sent to

说明

public string SolrResponse::getRequestUrl ( <span class="methodparam">void )

Returns the full URL the request was sent to.

参数

此函数没有参数。

返回值

Returns the full URL the request was sent to

SolrResponse::getResponse

Returns a SolrObject representing the XML response from the server

说明

public <span class="type">SolrObject <span class="methodname">SolrResponse::getResponse ( <span class="methodparam">void )

Returns a SolrObject representing the XML response from the server.

参数

此函数没有参数。

返回值

Returns a SolrObject representing the XML response from the server

SolrResponse::setParseMode

Sets the parse mode

说明

public bool SolrResponse::setParseMode ([ <span class="methodparam">int $parser_mode<span class="initializer"> = 0 ] )

Sets the parse mode.

参数

parser_mode
SolrResponse::PARSE_SOLR_DOC parses documents in SolrDocument instances. SolrResponse::PARSE_SOLR_OBJ parses document into SolrObjects.

返回值

成功时返回 true, 或者在失败时返回 false

SolrResponse::success

Was the request a success

说明

public bool SolrResponse::success ( <span class="methodparam">void )

Used to check if the request to the server was successful.

参数

此函数没有参数。

返回值

Returns true if it was successful and false if it was not.

简介

Represents a response to a query request.

类摘要

SolrQueryResponse

final class SolrQueryResponse <span class="modifier">extends SolrResponse {

/* 常量 */

const int SolrQueryResponse::PARSE_SOLR_OBJ = 0 ;

const int SolrQueryResponse::PARSE_SOLR_DOC = 1 ;

/* 继承的属性 */

const int SolrResponse::PARSE_SOLR_OBJ = 0 ;

const int SolrResponse::PARSE_SOLR_DOC = 1 ;

protected int $http_status ;

protected int $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 ;

/* 方法 */

public <span class="methodname">__construct ( <span class="methodparam">void )

public void __destruct ( <span class="methodparam">void )

/* 继承的方法 */

public string SolrResponse::getDigestedResponse ( void )

public int <span class="methodname">SolrResponse::getHttpStatus ( <span class="methodparam">void )

public string SolrResponse::getHttpStatusMessage ( void )

public string SolrResponse::getRawRequest ( <span class="methodparam">void )

public string SolrResponse::getRawRequestHeaders ( void )

public string SolrResponse::getRawResponse ( <span class="methodparam">void )

public string SolrResponse::getRawResponseHeaders ( void )

public string SolrResponse::getRequestUrl ( <span class="methodparam">void )

public <span class="type">SolrObject <span class="methodname">SolrResponse::getResponse ( <span class="methodparam">void )

public bool SolrResponse::setParseMode ([ <span class="methodparam">int $parser_mode<span class="initializer"> = 0 ] )

public bool SolrResponse::success ( <span class="methodparam">void )

}

预定义常量

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.

SolrQueryResponse::__construct

Constructor

说明

public <span class="methodname">SolrQueryResponse::__construct ( <span class="methodparam">void )

Constructor

参数

此函数没有参数。

返回值

None

SolrQueryResponse::__destruct

Destructor

说明

public void SolrQueryResponse::__destruct ( <span class="methodparam">void )

Destructor.

参数

此函数没有参数。

返回值

None

简介

Represents a response to an update request.

类摘要

SolrUpdateResponse

final class SolrUpdateResponse <span class="modifier">extends SolrResponse {

/* 常量 */

const int SolrUpdateResponse::PARSE_SOLR_OBJ = 0 ;

const int SolrUpdateResponse::PARSE_SOLR_DOC = 1 ;

/* 继承的属性 */

const int SolrResponse::PARSE_SOLR_OBJ = 0 ;

const int SolrResponse::PARSE_SOLR_DOC = 1 ;

protected int $http_status ;

protected int $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 ;

/* 方法 */

public <span class="methodname">__construct ( <span class="methodparam">void )

public void __destruct ( <span class="methodparam">void )

/* 继承的方法 */

public string SolrResponse::getDigestedResponse ( void )

public int <span class="methodname">SolrResponse::getHttpStatus ( <span class="methodparam">void )

public string SolrResponse::getHttpStatusMessage ( void )

public string SolrResponse::getRawRequest ( <span class="methodparam">void )

public string SolrResponse::getRawRequestHeaders ( void )

public string SolrResponse::getRawResponse ( <span class="methodparam">void )

public string SolrResponse::getRawResponseHeaders ( void )

public string SolrResponse::getRequestUrl ( <span class="methodparam">void )

public <span class="type">SolrObject <span class="methodname">SolrResponse::getResponse ( <span class="methodparam">void )

public bool SolrResponse::setParseMode ([ <span class="methodparam">int $parser_mode<span class="initializer"> = 0 ] )

public bool SolrResponse::success ( <span class="methodparam">void )

}

预定义常量

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.

SolrUpdateResponse::__construct

Constructor

说明

public <span class="methodname">SolrUpdateResponse::__construct ( <span class="methodparam">void )

Constructor

参数

此函数没有参数。

返回值

None

SolrUpdateResponse::__destruct

Destructor

说明

public void SolrUpdateResponse::__destruct ( <span class="methodparam">void )

Destructor

参数

此函数没有参数。

返回值

None

简介

Represents a response to a ping request to the server

类摘要

SolrPingResponse

final class SolrPingResponse <span class="modifier">extends SolrResponse {

/* 常量 */

const int SolrPingResponse::PARSE_SOLR_OBJ = 0 ;

const int SolrPingResponse::PARSE_SOLR_DOC = 1 ;

/* 属性 */

/* 方法 */

public <span class="methodname">__construct ( <span class="methodparam">void )

public void __destruct ( <span class="methodparam">void )

public string getResponse ( <span class="methodparam">void )

/* 继承的方法 */

public string SolrResponse::getDigestedResponse ( void )

public int <span class="methodname">SolrResponse::getHttpStatus ( <span class="methodparam">void )

public string SolrResponse::getHttpStatusMessage ( void )

public string SolrResponse::getRawRequest ( <span class="methodparam">void )

public string SolrResponse::getRawRequestHeaders ( void )

public string SolrResponse::getRawResponse ( <span class="methodparam">void )

public string SolrResponse::getRawResponseHeaders ( void )

public string SolrResponse::getRequestUrl ( <span class="methodparam">void )

public <span class="type">SolrObject <span class="methodname">SolrResponse::getResponse ( <span class="methodparam">void )

public bool SolrResponse::setParseMode ([ <span class="methodparam">int $parser_mode<span class="initializer"> = 0 ] )

public bool SolrResponse::success ( <span class="methodparam">void )

}

属性

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.

预定义常量

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.

SolrPingResponse::__construct

Constructor

说明

public <span class="methodname">SolrPingResponse::__construct ( <span class="methodparam">void )

Constructor

参数

此函数没有参数。

返回值

None

SolrPingResponse::__destruct

Destructor

说明

public void SolrPingResponse::__destruct ( <span class="methodparam">void )

Destructor

参数

此函数没有参数。

返回值

None

SolrPingResponse::getResponse

Returns the response from the server

说明

public string SolrPingResponse::getResponse ( <span class="methodparam">void )

Returns the response from the server. This should be empty because the request as a HEAD request.

参数

此函数没有参数。

返回值

Returns an empty string.

简介

Represents a response from the solr server.

类摘要

SolrGenericResponse

final class SolrGenericResponse <span class="modifier">extends SolrResponse {

/* 常量 */

const int SolrGenericResponse::PARSE_SOLR_OBJ = 0 ;

const int SolrGenericResponse::PARSE_SOLR_DOC = 1 ;

/* 继承的属性 */

const int SolrResponse::PARSE_SOLR_OBJ = 0 ;

const int SolrResponse::PARSE_SOLR_DOC = 1 ;

protected int $http_status ;

protected int $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 ;

/* 方法 */

public <span class="methodname">__construct ( <span class="methodparam">void )

public void __destruct ( <span class="methodparam">void )

/* 继承的方法 */

public string SolrResponse::getDigestedResponse ( void )

public int <span class="methodname">SolrResponse::getHttpStatus ( <span class="methodparam">void )

public string SolrResponse::getHttpStatusMessage ( void )

public string SolrResponse::getRawRequest ( <span class="methodparam">void )

public string SolrResponse::getRawRequestHeaders ( void )

public string SolrResponse::getRawResponse ( <span class="methodparam">void )

public string SolrResponse::getRawResponseHeaders ( void )

public string SolrResponse::getRequestUrl ( <span class="methodparam">void )

public <span class="type">SolrObject <span class="methodname">SolrResponse::getResponse ( <span class="methodparam">void )

public bool SolrResponse::setParseMode ([ <span class="methodparam">int $parser_mode<span class="initializer"> = 0 ] )

public bool SolrResponse::success ( <span class="methodparam">void )

}

预定义常量

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.

SolrGenericResponse::__construct

Constructor

说明

public <span class="methodname">SolrGenericResponse::__construct ( <span class="methodparam">void )

Constructor

参数

此函数没有参数。

返回值

None

SolrGenericResponse::__destruct

Destructor

说明

public void SolrGenericResponse::__destruct ( void )

Destructor.

参数

此函数没有参数。

返回值

None

简介

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

类摘要

SolrParams

abstract class SolrParams implements <span class="interfacename">Serializable {

/* 方法 */

final public SolrParams add ( string $name , <span class="type">string $value )

public <span class="type">SolrParams addParam ( string $name , <span class="type">string $value )

final public mixed get ( string $param_name )

final public mixed getParam ([ string $param_name ] )

final public array <span class="methodname">getParams ( <span class="methodparam">void )

final public array <span class="methodname">getPreparedParams ( <span class="methodparam">void )

final public string <span class="methodname">serialize ( <span class="methodparam">void )

final public void set ( string $name , <span class="type">string $value )

public <span class="type">SolrParams setParam ( string $name , <span class="type">string $value )

final public string <span class="methodname">toString ([ <span class="type">bool $url_encode = false ] )

final public void <span class="methodname">unserialize ( <span class="type">string $serialized )

}

SolrParams::add

This is an alias for SolrParams::addParam

说明

final public SolrParams <span class="methodname">SolrParams::add ( <span class="methodparam">string $name , string $value )

This is an alias for SolrParams::addParam

参数

name
The name of the parameter

value
The value of the parameter

返回值

Returns a SolrParams instance on success

SolrParams::addParam

Adds a parameter to the object

说明

public <span class="type">SolrParams <span class="methodname">SolrParams::addParam ( <span class="methodparam">string $name , string $value )

Adds a parameter to the object. This is used for parameters that can be specified multiple times.

参数

name
Name of parameter

value
Value of parameter

返回值

Returns a SolrParam object on success and false on failure.

SolrParams::get

This is an alias for SolrParams::getParam

说明

final public mixed <span class="methodname">SolrParams::get ( <span class="methodparam">string $param_name )

This is an alias for SolrParams::getParam

参数

param_name
Then name of the parameter

返回值

Returns an array or string depending on the type of parameter

SolrParams::getParam

Returns a parameter value

说明

final public mixed <span class="methodname">SolrParams::getParam ([ <span class="methodparam">string $param_name ] )

Returns a parameter with name param_name

参数

param_name
The name of the parameter

返回值

Returns a string or an array depending on the type of the parameter

SolrParams::getParams

Returns an array of non URL-encoded parameters

说明

final public array <span class="methodname">SolrParams::getParams ( <span class="methodparam">void )

Returns an array of non URL-encoded parameters

参数

此函数没有参数。

返回值

Returns an array of non URL-encoded parameters

SolrParams::getPreparedParams

Returns an array of URL-encoded parameters

说明

final public array <span class="methodname">SolrParams::getPreparedParams ( <span class="methodparam">void )

Returns an array on URL-encoded parameters

参数

此函数没有参数。

返回值

Returns an array on URL-encoded parameters

SolrParams::serialize

Used for custom serialization

说明

final public string <span class="methodname">SolrParams::serialize ( <span class="methodparam">void )

Used for custom serialization

参数

此函数没有参数。

返回值

Used for custom serialization

SolrParams::set

An alias of SolrParams::setParam

说明

final public void <span class="methodname">SolrParams::set ( <span class="methodparam">string $name , string $value )

An alias of SolrParams::setParam

参数

name
Then name of the parameter

value
The parameter value

返回值

Returns an instance of the SolrParams object on success

SolrParams::setParam

Sets the parameter to the specified value

说明

public <span class="type">SolrParams <span class="methodname">SolrParams::setParam ( <span class="methodparam">string $name , string $value )

Sets the query parameter to the specified value. This is used for parameters that can only be specified once. Subsequent calls with the same parameter name will override the existing value

参数

name
Name of the parameter

value
Value of the parameter

返回值

Returns a SolrParam object on success and false on value.

范例

示例 #1 SolrParams::setParam example

<?php

$param = new SolrParams();

$param->setParam('q', 'solr')->setParam('rows', 2);

?>

以上例程的输出类似于:

SolrParams::toString

Returns all the name-value pair parameters in the object

说明

final public string <span class="methodname">SolrParams::toString ([ <span class="methodparam">bool $url_encode<span class="initializer"> = false ] )

Returns all the name-value pair parameters in the object

参数

url_encode
Whether to return URL-encoded values

返回值

Returns a string on success and false on failure.

SolrParams::unserialize

Used for custom serialization

说明

final public void <span class="methodname">SolrParams::unserialize ( <span class="methodparam">string $serialized )

Used for custom serialization

参数

serialized
The serialized representation of the object

返回值

None

简介

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

类摘要

SolrModifiableParams

class SolrModifiableParams <span class="ooclass"> extends SolrParams implements <span class="interfacename">Serializable {

/* 方法 */

public <span class="methodname">__construct ( <span class="methodparam">void )

public void __destruct ( <span class="methodparam">void )

/* 继承的方法 */

final public SolrParams <span class="methodname">SolrParams::add ( <span class="methodparam">string $name , string $value )

public <span class="type">SolrParams <span class="methodname">SolrParams::addParam ( <span class="methodparam">string $name , string $value )

final public mixed <span class="methodname">SolrParams::get ( <span class="methodparam">string $param_name )

final public mixed <span class="methodname">SolrParams::getParam ([ <span class="methodparam">string $param_name ] )

final public array <span class="methodname">SolrParams::getParams ( <span class="methodparam">void )

final public array <span class="methodname">SolrParams::getPreparedParams ( <span class="methodparam">void )

final public string <span class="methodname">SolrParams::serialize ( <span class="methodparam">void )

final public void <span class="methodname">SolrParams::set ( <span class="methodparam">string $name , string $value )

public <span class="type">SolrParams <span class="methodname">SolrParams::setParam ( <span class="methodparam">string $name , string $value )

final public string <span class="methodname">SolrParams::toString ([ <span class="methodparam">bool $url_encode<span class="initializer"> = false ] )

final public void <span class="methodname">SolrParams::unserialize ( <span class="methodparam">string $serialized )

}

SolrModifiableParams::__construct

Constructor

说明

public <span class="methodname">SolrModifiableParams::__construct ( <span class="methodparam">void )

Constructor

参数

此函数没有参数。

返回值

None

SolrModifiableParams::__destruct

Destructor

说明

public void SolrModifiableParams::__destruct ( void )

Destructor

参数

此函数没有参数。

返回值

None

简介

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

类摘要

SolrQuery

class SolrQuery <span class="ooclass"> extends SolrModifiableParams implements Serializable {

/* 常量 */

const int SolrQuery::ORDER_ASC = 0 ;

const int SolrQuery::ORDER_DESC = 1 ;

const int SolrQuery::FACET_SORT_INDEX = 0 ;

const int SolrQuery::FACET_SORT_COUNT = 1 ;

const int SolrQuery::TERMS_SORT_INDEX = 0 ;

const int SolrQuery::TERMS_SORT_COUNT = 1 ;

/* 属性 */

/* 方法 */

public SolrQuery addExpandFilterQuery ( <span class="methodparam">string $fq )

public SolrQuery addExpandSortField ( <span class="methodparam">string $field [, string $order ] )

public SolrQuery addFacetDateField ( <span class="methodparam">string $dateField )

public SolrQuery addFacetDateOther ( <span class="methodparam">string $value [, string $field_override ] )

public SolrQuery addFacetField ( <span class="methodparam">string $field )

public SolrQuery addFacetQuery ( <span class="methodparam">string $facetQuery )

public SolrQuery addField ( <span class="methodparam">string $field )

public SolrQuery addFilterQuery ( <span class="methodparam">string $fq )

public SolrQuery addGroupField ( <span class="methodparam">string $value )

public SolrQuery addGroupFunction ( <span class="methodparam">string $value )

public SolrQuery addGroupQuery ( <span class="methodparam">string $value )

public SolrQuery addGroupSortField ( <span class="methodparam">string $field [, int $order ] )

public SolrQuery addHighlightField ( <span class="methodparam">string $field )

public SolrQuery addMltField ( <span class="methodparam">string $field )

public SolrQuery addMltQueryField ( <span class="methodparam">string $field , float $boost )

public SolrQuery addSortField ( <span class="methodparam">string $field [, int $order<span class="initializer"> = SolrQuery::ORDER_DESC ] )

public SolrQuery addStatsFacet ( <span class="methodparam">string $field )

public SolrQuery addStatsField ( <span class="methodparam">string $field )

public SolrQuery collapse ( <span class="methodparam">SolrCollapseFunction $collapseFunction )

public <span class="methodname">__construct ([ <span class="methodparam">string $q ] )

public void __destruct ( <span class="methodparam">void )

public bool getExpand ( <span class="methodparam">void )

public array getExpandFilterQueries ( <span class="methodparam">void )

public array getExpandQuery ( <span class="methodparam">void )

public int <span class="methodname">getExpandRows ( <span class="methodparam">void )

public array getExpandSortFields ( <span class="methodparam">void )

public bool getFacet ( <span class="methodparam">void )

public string getFacetDateEnd ([ <span class="methodparam">string $field_override ] )

public array getFacetDateFields ( <span class="methodparam">void )

public string getFacetDateGap ([ <span class="methodparam">string $field_override ] )

public string getFacetDateHardEnd ([ <span class="methodparam">string $field_override ] )

public array getFacetDateOther ([ <span class="methodparam">string $field_override ] )

public string getFacetDateStart ([ <span class="methodparam">string $field_override ] )

public array getFacetFields ( <span class="methodparam">void )

public int <span class="methodname">getFacetLimit ([ <span class="methodparam">string $field_override ] )

public string getFacetMethod ([ <span class="methodparam">string $field_override ] )

public int <span class="methodname">getFacetMinCount ([ <span class="methodparam">string $field_override ] )

public bool getFacetMissing ([ <span class="methodparam">string $field_override ] )

public int <span class="methodname">getFacetOffset ([ <span class="methodparam">string $field_override ] )

public string getFacetPrefix ([ <span class="methodparam">string $field_override ] )

public array getFacetQueries ( <span class="methodparam">void )

public int <span class="methodname">getFacetSort ([ <span class="methodparam">string $field_override ] )

public array getFields ( <span class="methodparam">void )

public array getFilterQueries ( <span class="methodparam">void )

public bool getGroup ( <span class="methodparam">void )

public int <span class="methodname">getGroupCachePercent ( <span class="methodparam">void )

public bool getGroupFacet ( <span class="methodparam">void )

public array getGroupFields ( <span class="methodparam">void )

public string getGroupFormat ( <span class="methodparam">void )

public array getGroupFunctions ( <span class="methodparam">void )

public int <span class="methodname">getGroupLimit ( <span class="methodparam">void )

public bool getGroupMain ( <span class="methodparam">void )

public bool getGroupNGroups ( <span class="methodparam">void )

public int <span class="methodname">getGroupOffset ( <span class="methodparam">void )

public array getGroupQueries ( <span class="methodparam">void )

public array getGroupSortFields ( <span class="methodparam">void )

public bool getGroupTruncate ( <span class="methodparam">void )

public bool getHighlight ( <span class="methodparam">void )

public string getHighlightAlternateField ([ <span class="methodparam">string $field_override ] )

public array getHighlightFields ( <span class="methodparam">void )

public string getHighlightFormatter ([ <span class="methodparam">string $field_override ] )

public string getHighlightFragmenter ([ <span class="methodparam">string $field_override ] )

public int <span class="methodname">getHighlightFragsize ([ <span class="methodparam">string $field_override ] )

public bool getHighlightHighlightMultiTerm ( <span class="methodparam">void )

public int <span class="methodname">getHighlightMaxAlternateFieldLength ([ <span class="methodparam">string $field_override ] )

public int <span class="methodname">getHighlightMaxAnalyzedChars ( <span class="methodparam">void )

public bool getHighlightMergeContiguous ([ <span class="methodparam">string $field_override ] )

public int <span class="methodname">getHighlightRegexMaxAnalyzedChars ( <span class="methodparam">void )

public string getHighlightRegexPattern ( <span class="methodparam">void )

public float getHighlightRegexSlop ( <span class="methodparam">void )

public bool getHighlightRequireFieldMatch ( <span class="methodparam">void )

public string getHighlightSimplePost ([ <span class="methodparam">string $field_override ] )

public string getHighlightSimplePre ([ <span class="methodparam">string $field_override ] )

public int <span class="methodname">getHighlightSnippets ([ <span class="methodparam">string $field_override ] )

public bool getHighlightUsePhraseHighlighter ( <span class="methodparam">void )

public bool getMlt ( <span class="methodparam">void )

public bool getMltBoost ( <span class="methodparam">void )

public int <span class="methodname">getMltCount ( <span class="methodparam">void )

public array getMltFields ( <span class="methodparam">void )

public int <span class="methodname">getMltMaxNumQueryTerms ( <span class="methodparam">void )

public int <span class="methodname">getMltMaxNumTokens ( <span class="methodparam">void )

public int <span class="methodname">getMltMaxWordLength ( <span class="methodparam">void )

public int <span class="methodname">getMltMinDocFrequency ( <span class="methodparam">void )

public int <span class="methodname">getMltMinTermFrequency ( <span class="methodparam">void )

public int <span class="methodname">getMltMinWordLength ( <span class="methodparam">void )

public array getMltQueryFields ( <span class="methodparam">void )

public string getQuery ( <span class="methodparam">void )

public int <span class="methodname">getRows ( <span class="methodparam">void )

public array getSortFields ( <span class="methodparam">void )

public int <span class="methodname">getStart ( <span class="methodparam">void )

public bool getStats ( <span class="methodparam">void )

public array getStatsFacets ( <span class="methodparam">void )

public array getStatsFields ( <span class="methodparam">void )

public bool getTerms ( <span class="methodparam">void )

public string getTermsField ( <span class="methodparam">void )

public bool getTermsIncludeLowerBound ( <span class="methodparam">void )

public bool getTermsIncludeUpperBound ( <span class="methodparam">void )

public int <span class="methodname">getTermsLimit ( <span class="methodparam">void )

public string getTermsLowerBound ( <span class="methodparam">void )

public int <span class="methodname">getTermsMaxCount ( <span class="methodparam">void )

public int <span class="methodname">getTermsMinCount ( <span class="methodparam">void )

public string getTermsPrefix ( <span class="methodparam">void )

public bool getTermsReturnRaw ( <span class="methodparam">void )

public int <span class="methodname">getTermsSort ( <span class="methodparam">void )

public string getTermsUpperBound ( <span class="methodparam">void )

public int <span class="methodname">getTimeAllowed ( <span class="methodparam">void )

public SolrQuery removeExpandFilterQuery ( <span class="methodparam">string $fq )

public SolrQuery removeExpandSortField ( <span class="methodparam">string $field )

public SolrQuery removeFacetDateField ( <span class="methodparam">string $field )

public SolrQuery removeFacetDateOther ( <span class="methodparam">string $value [, string $field_override ] )

public SolrQuery removeFacetField ( <span class="methodparam">string $field )

public SolrQuery removeFacetQuery ( <span class="methodparam">string $value )

public SolrQuery removeField ( <span class="methodparam">string $field )

public SolrQuery removeFilterQuery ( <span class="methodparam">string $fq )

public SolrQuery removeHighlightField ( <span class="methodparam">string $field )

public SolrQuery removeMltField ( <span class="methodparam">string $field )

public SolrQuery removeMltQueryField ( <span class="methodparam">string $queryField )

public SolrQuery removeSortField ( <span class="methodparam">string $field )

public SolrQuery removeStatsFacet ( <span class="methodparam">string $value )

public SolrQuery removeStatsField ( <span class="methodparam">string $field )

public SolrQuery setEchoHandler ( <span class="methodparam">bool $flag )

public SolrQuery setEchoParams ( <span class="methodparam">string $type )

public SolrQuery setExpand ( <span class="methodparam">bool $value )

public SolrQuery setExpandQuery ( <span class="methodparam">string $q )

public SolrQuery setExpandRows ( <span class="methodparam">int $value )

public SolrQuery setExplainOther ( <span class="methodparam">string $query )

public SolrQuery setFacet ( <span class="methodparam">bool $flag )

public SolrQuery setFacetDateEnd ( <span class="methodparam">string $value [, string $field_override ] )

public SolrQuery setFacetDateGap ( <span class="methodparam">string $value [, string $field_override ] )

public SolrQuery setFacetDateHardEnd ( <span class="methodparam">bool $value [, string $field_override ] )

public SolrQuery setFacetDateStart ( <span class="methodparam">string $value [, string $field_override ] )

public SolrQuery setFacetEnumCacheMinDefaultFrequency ( int $frequency [, <span class="type">string $field_override ] )

public SolrQuery setFacetLimit ( <span class="methodparam">int $limit [, string $field_override ] )

public SolrQuery setFacetMethod ( <span class="methodparam">string $method [, string $field_override ] )

public SolrQuery setFacetMinCount ( <span class="methodparam">int $mincount [, string $field_override ] )

public SolrQuery setFacetMissing ( <span class="methodparam">bool $flag [, string $field_override ] )

public SolrQuery setFacetOffset ( <span class="methodparam">int $offset [, string $field_override ] )

public SolrQuery setFacetPrefix ( <span class="methodparam">string $prefix [, string $field_override ] )

public SolrQuery setFacetSort ( <span class="methodparam">int $facetSort [, string $field_override ] )

public SolrQuery setGroup ( <span class="methodparam">bool $value )

public SolrQuery setGroupCachePercent ( <span class="methodparam">int $percent )

public SolrQuery setGroupFacet ( <span class="methodparam">bool $value )

public SolrQuery setGroupFormat ( <span class="methodparam">string $value )

public SolrQuery setGroupLimit ( <span class="methodparam">int $value )

public SolrQuery setGroupMain ( <span class="methodparam">string $value )

public SolrQuery setGroupNGroups ( <span class="methodparam">bool $value )

public SolrQuery setGroupOffset ( <span class="methodparam">int $value )

public SolrQuery setGroupTruncate ( <span class="methodparam">bool $value )

public SolrQuery setHighlight ( <span class="methodparam">bool $flag )

public SolrQuery setHighlightAlternateField ( <span class="methodparam">string $field [, string $field_override ] )

public SolrQuery setHighlightFormatter ( <span class="methodparam">string $formatter [, string $field_override ] )

public SolrQuery setHighlightFragmenter ( <span class="methodparam">string $fragmenter [, <span class="type">string $field_override ] )

public SolrQuery setHighlightFragsize ( <span class="methodparam">int $size [, string $field_override ] )

public SolrQuery setHighlightHighlightMultiTerm ( <span class="methodparam">bool $flag )

public SolrQuery setHighlightMaxAlternateFieldLength ( int $fieldLength [, <span class="type">string $field_override ] )

public SolrQuery setHighlightMaxAnalyzedChars ( <span class="methodparam">int $value )

public SolrQuery setHighlightMergeContiguous ( <span class="methodparam">bool $flag [, string $field_override ] )

public SolrQuery setHighlightRegexMaxAnalyzedChars ( int $maxAnalyzedChars )

public SolrQuery setHighlightRegexPattern ( <span class="methodparam">string $value )

public SolrQuery setHighlightRegexSlop ( <span class="methodparam">float $factor )

public SolrQuery setHighlightRequireFieldMatch ( <span class="methodparam">bool $flag )

public SolrQuery setHighlightSimplePost ( <span class="methodparam">string $simplePost [, <span class="type">string $field_override ] )

public SolrQuery setHighlightSimplePre ( <span class="methodparam">string $simplePre [, string $field_override ] )

public SolrQuery setHighlightSnippets ( <span class="methodparam">int $value [, string $field_override ] )

public SolrQuery setHighlightUsePhraseHighlighter ( <span class="methodparam">bool $flag )

public SolrQuery setMlt ( <span class="type">bool $flag )

public SolrQuery setMltBoost ( <span class="methodparam">bool $flag )

public SolrQuery setMltCount ( <span class="methodparam">int $count )

public SolrQuery setMltMaxNumQueryTerms ( <span class="methodparam">int $value )

public SolrQuery setMltMaxNumTokens ( <span class="methodparam">int $value )

public SolrQuery setMltMaxWordLength ( <span class="methodparam">int $maxWordLength )

public SolrQuery setMltMinDocFrequency ( <span class="methodparam">int $minDocFrequency )

public SolrQuery setMltMinTermFrequency ( <span class="methodparam">int $minTermFrequency )

public SolrQuery setMltMinWordLength ( <span class="methodparam">int $minWordLength )

public SolrQuery setOmitHeader ( <span class="methodparam">bool $flag )

public SolrQuery setQuery ( <span class="methodparam">string $query )

public SolrQuery setRows ( <span class="methodparam">int $rows )

public SolrQuery setShowDebugInfo ( <span class="methodparam">bool $flag )

public SolrQuery setStart ( <span class="methodparam">int $start )

public SolrQuery setStats ( <span class="methodparam">bool $flag )

public SolrQuery setTerms ( <span class="methodparam">bool $flag )

public SolrQuery setTermsField ( <span class="methodparam">string $fieldname )

public SolrQuery setTermsIncludeLowerBound ( <span class="methodparam">bool $flag )

public SolrQuery setTermsIncludeUpperBound ( <span class="methodparam">bool $flag )

public SolrQuery setTermsLimit ( <span class="methodparam">int $limit )

public SolrQuery setTermsLowerBound ( <span class="methodparam">string $lowerBound )

public SolrQuery setTermsMaxCount ( <span class="methodparam">int $frequency )

public SolrQuery setTermsMinCount ( <span class="methodparam">int $frequency )

public SolrQuery setTermsPrefix ( <span class="methodparam">string $prefix )

public SolrQuery setTermsReturnRaw ( <span class="methodparam">bool $flag )

public SolrQuery setTermsSort ( <span class="methodparam">int $sortType )

public SolrQuery setTermsUpperBound ( <span class="methodparam">string $upperBound )

public SolrQuery setTimeAllowed ( <span class="methodparam">int $timeAllowed )

/* 继承的方法 */

public <span class="methodname">SolrModifiableParams::__construct ( <span class="methodparam">void )

public void SolrModifiableParams::__destruct ( void )

}

预定义常量

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

SolrQuery::addExpandFilterQuery

Overrides main filter query, determines which documents to include in the main group

说明

public SolrQuery SolrQuery::addExpandFilterQuery ( <span class="methodparam">string $fq )

Overrides main filter query, determines which documents to include in the main group.

参数

fq

返回值

SolrQuery

参见

  • SolrQuery::setExpand
  • SolrQuery::addExpandSortField
  • SolrQuery::removeExpandSortField
  • SolrQuery::setExpandRows
  • SolrQuery::setExpandQuery
  • SolrQuery::removeExpandFilterQuery

SolrQuery::addExpandSortField

Orders the documents within the expanded groups (expand.sort parameter)

说明

public SolrQuery SolrQuery::addExpandSortField ( <span class="methodparam">string $field [, string $order ] )

Orders the documents within the expanded groups (expand.sort parameter).

参数

field
field name

order
Order ASC/DESC, utilizes SolrQuery::ORDER_* constants.

Default: SolrQuery::ORDER_DESC

返回值

SolrQuery

参见

  • SolrQuery::setExpand
  • SolrQuery::removeExpandSortField
  • SolrQuery::setExpandRows
  • SolrQuery::setExpandQuery
  • SolrQuery::addExpandFilterQuery
  • SolrQuery::removeExpandFilterQuery

SolrQuery::addFacetDateField

Maps to facet.date

说明

public SolrQuery SolrQuery::addFacetDateField ( <span class="methodparam">string $dateField )

This method allows you to specify a field which should be treated as a facet.

It can be used multiple times with different field names to indicate multiple facet fields

参数

dateField
The name of the date field.

返回值

Returns a SolrQuery object.

SolrQuery::addFacetDateOther

Adds another facet.date.other parameter

说明

public SolrQuery SolrQuery::addFacetDateOther ( <span class="methodparam">string $value [, string $field_override ] )

Sets the facet.date.other parameter. Accepts an optional field override

参数

value
The value to use.

field_override
The field name for the override.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::addFacetField

Adds another field to the facet

说明

public SolrQuery SolrQuery::addFacetField ( <span class="methodparam">string $field )

Adds another field to the facet

参数

field
The name of the field

返回值

Returns the current SolrQuery object, if the return value is used.

范例

示例 #1 SolrQuery::addFacetField example

<?php

$options = array
(
    'hostname' => SOLR_SERVER_HOSTNAME,
    'login'    => SOLR_SERVER_USERNAME,
    'password' => SOLR_SERVER_PASSWORD,
    'port'     => SOLR_SERVER_PORT,
);

$client = new SolrClient($options);

$query = new SolrQuery();

$query->setQuery($query);

$query->addField('price')->addField('color');

$query->setFacet(true);

$query->addFacetField('price')->addFacetField('color');

$query_response = $client->query($query);

$response = $query_response->getResponse();

print_r($response['facet_counts']['facet_fields']);

?>

以上例程的输出类似于:

SolrObject Object
(
    [color] => SolrObject Object
        (
            [blue] => 20
            [green] => 100
        )

)

SolrQuery::addFacetQuery

Adds a facet query

说明

public SolrQuery SolrQuery::addFacetQuery ( <span class="methodparam">string $facetQuery )

Adds a facet query

参数

facetQuery
The facet query

返回值

Returns the current SolrQuery object, if the return value is used.

范例

示例 #1 SolrQuery::addFacetField example

<?php

$options = array
(
        'hostname' => SOLR_SERVER_HOSTNAME,
        'login'    => SOLR_SERVER_USERNAME,
        'password' => SOLR_SERVER_PASSWORD,
        'port'     => SOLR_SERVER_PORT,
);

$client = new SolrClient($options);

$query = new SolrQuery('*:*');

$query->setFacet(true);

$query->addFacetQuery('price:[* TO 500]')->addFacetQuery('price:[500 TO *]');

$query_response = $client->query($query);

$response = $query_response->getResponse();

print_r($response->facet_counts->facet_queries);

?>

以上例程的输出类似于:

SolrObject Object
(
    [price:[* TO 500]] => 14
    [price:[500 TO *]] => 2
)

SolrQuery::addField

Specifies which fields to return in the result

说明

public SolrQuery SolrQuery::addField ( <span class="methodparam">string $field )

This method is used to used to specify a set of fields to return, thereby restricting the amount of data returned in the response.

It should be called multiple time, once for each field name.

参数

field
The name of the field

返回值

Returns the current SolrQuery object

SolrQuery::addFilterQuery

Specifies a filter query

说明

public SolrQuery SolrQuery::addFilterQuery ( <span class="methodparam">string $fq )

Specifies a filter query

参数

fq
The filter query

返回值

Returns the current SolrQuery object.

范例

示例 #1 SolrQuery::addFilterQuery example

<?php

$options = array
(
    'hostname' => SOLR_SERVER_HOSTNAME,
    'login'    => SOLR_SERVER_USERNAME,
    'password' => SOLR_SERVER_PASSWORD,
    'port'     => SOLR_SERVER_PORT,
);

$client = new SolrClient($options);

$query = new SolrQuery();

$query->setQuery('*:*');

$query->addFilterQuery('color:blue,green');

$query_response = $client->query($query);

$response = $query_response->getResponse();

print_r($response['facet_counts']['facet_fields']);

?>

以上例程的输出类似于:

 &fq=color:blue,green

SolrQuery::addGroupField

Add a field to be used to group results

说明

public SolrQuery SolrQuery::addGroupField ( <span class="methodparam">string $value )

The name of the field by which to group results. The field must be single-valued, and either be indexed or a field type that has a value source and works in a function query, such as ExternalFileField. It must also be a string-based field, such as StrField or TextField Uses group.field parameter

参数

value

参见

  • SolrQuery::setGroup
  • SolrQuery::addGroupFunction
  • SolrQuery::addGroupQuery
  • SolrQuery::addGroupSortField
  • SolrQuery::setGroupFacet
  • SolrQuery::setGroupOffset
  • SolrQuery::setGroupLimit
  • SolrQuery::setGroupMain
  • SolrQuery::setGroupNGroups
  • SolrQuery::setGroupTruncate
  • SolrQuery::setGroupFormat
  • SolrQuery::setGroupCachePercent

SolrQuery::addGroupFunction

Allows grouping results based on the unique values of a function query (group.func parameter)

说明

public SolrQuery SolrQuery::addGroupFunction ( <span class="methodparam">string $value )

Adds a group function (group.func parameter) Allows grouping results based on the unique values of a function query.

参数

value

返回值

SolrQuery

参见

  • SolrQuery::setGroup
  • SolrQuery::addGroupField
  • SolrQuery::addGroupQuery
  • SolrQuery::addGroupSortField
  • SolrQuery::setGroupFacet
  • SolrQuery::setGroupOffset
  • SolrQuery::setGroupLimit
  • SolrQuery::setGroupMain
  • SolrQuery::setGroupNGroups
  • SolrQuery::setGroupTruncate
  • SolrQuery::setGroupFormat
  • SolrQuery::setGroupCachePercent

SolrQuery::addGroupQuery

Allows grouping of documents that match the given query

说明

public SolrQuery SolrQuery::addGroupQuery ( <span class="methodparam">string $value )

Allows grouping of documents that match the given query. Adds query to the group.query parameter

参数

value

返回值

SolrQuery

参见

  • SolrQuery::setGroup
  • SolrQuery::addGroupField
  • SolrQuery::addGroupFunction
  • SolrQuery::addGroupSortField
  • SolrQuery::setGroupFacet
  • SolrQuery::setGroupOffset
  • SolrQuery::setGroupLimit
  • SolrQuery::setGroupMain
  • SolrQuery::setGroupNGroups
  • SolrQuery::setGroupTruncate
  • SolrQuery::setGroupFormat
  • SolrQuery::setGroupCachePercent

SolrQuery::addGroupSortField

Add a group sort field (group.sort parameter)

说明

public SolrQuery SolrQuery::addGroupSortField ( <span class="methodparam">string $field [, int $order ] )

Allow sorting group documents, using group sort field (group.sort parameter).

参数

field
Field name

order
Order ASC/DESC, utilizes SolrQuery::ORDER_* constants

返回值

范例

示例 #1 SolrQuery::addGroupSortField example

<?php

$solrQuery = new SolrQuery('*:*');
$solrQuery
    ->setGroup(true)
    ->addGroupSortField('price', SolrQuery::ORDER_ASC);

echo $solrQuery; 
?>

以上例程的输出类似于:

q=*:*&group=true&group.sort=price asc

参见

  • SolrQuery::setGroup
  • SolrQuery::addGroupField
  • SolrQuery::addGroupFunction
  • SolrQuery::addGroupQuery
  • SolrQuery::setGroupFacet
  • SolrQuery::setGroupOffset
  • SolrQuery::setGroupLimit
  • SolrQuery::setGroupMain
  • SolrQuery::setGroupNGroups
  • SolrQuery::setGroupTruncate
  • SolrQuery::setGroupFormat
  • SolrQuery::setGroupCachePercent

SolrQuery::addHighlightField

Maps to hl.fl

说明

public SolrQuery SolrQuery::addHighlightField ( <span class="methodparam">string $field )

Maps to hl.fl. This is used to specify that highlighted snippets should be generated for a particular field

参数

field
Name of the field

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::addMltField

Sets a field to use for similarity

说明

public SolrQuery SolrQuery::addMltField ( <span class="methodparam">string $field )

Maps to mlt.fl. It specifies that a field should be used for similarity.

参数

field
The name of the field

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::addMltQueryField

Maps to mlt.qf

说明

public SolrQuery SolrQuery::addMltQueryField ( <span class="methodparam">string $field , float $boost )

Maps to mlt.qf. It is used to specify query fields and their boosts

参数

field
The name of the field

boost
Its boost value

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::addSortField

Used to control how the results should be sorted

说明

public SolrQuery SolrQuery::addSortField ( <span class="methodparam">string $field [, int $order<span class="initializer"> = SolrQuery::ORDER_DESC ] )

Used to control how the results should be sorted.

参数

field
The name of the field

order
The sort direction. This should be either SolrQuery::ORDER_ASC or SolrQuery::ORDER_DESC.

返回值

Returns the current SolrQuery object.

SolrQuery::addStatsFacet

Requests a return of sub results for values within the given facet

说明

public SolrQuery SolrQuery::addStatsFacet ( <span class="methodparam">string $field )

Requests a return of sub results for values within the given facet. Maps to the stats.facet field

参数

field
The name of the field

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::addStatsField

Maps to stats.field parameter

说明

public SolrQuery SolrQuery::addStatsField ( <span class="methodparam">string $field )

Maps to stats.field parameter This methods adds another stats.field parameter.

参数

field
The name of the field

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::collapse

Collapses the result set to a single document per group

说明

public SolrQuery SolrQuery::collapse ( <span class="methodparam">SolrCollapseFunction $collapseFunction )

Collapses the result set to a single document per group before it forwards the result set to the rest of the search components.

So all downstream components (faceting, highlighting, etc...) will work with the collapsed result set.

参数

collapseFunction

返回值

Returns the current SolrQuery object

范例

示例 #1 SolrQuery::collapse example

<?php

include "bootstrap.php";

$options = array
(
        'hostname' => SOLR_SERVER_HOSTNAME,
        'login'    => SOLR_SERVER_USERNAME,
        'password' => SOLR_SERVER_PASSWORD,
        'port'     => SOLR_SERVER_PORT,
        'path'     => SOLR_SERVER_PATH
);

$client = new SolrClient($options);

$query = new SolrQuery('*:*');

$collapseFunction = new SolrCollapseFunction('manu_id_s');

$collapseFunction
->setSize(2)
->setNullPolicy(SolrCollapseFunction::NULLPOLICY_IGNORE);

$query
->collapse($collapseFunction)
->setRows(4);

$queryResponse = $client->query($query);

$response = $queryResponse->getResponse();

print_r($response);

?>

以上例程的输出类似于:

SolrObject Object
(
    [responseHeader] => SolrObject Object
        (
            [status] => 0
            [QTime] => 1
            [params] => SolrObject Object
                (
                    [q] => *:*
                    [indent] => on
                    [fq] => {!collapse field=manu_id_s size=2 nullPolicy=ignore}
                    [rows] => 4
                    [version] => 2.2
                    [wt] => xml
                )

        )

    [response] => SolrObject Object
        (
            [numFound] => 14
            [start] => 0
            [docs] => Array
                (
                    [0] => SolrObject Object
                        (
                            [id] => SP2514N
                            [name] => Array
                                (
                                    [0] => Samsung SpinPoint P120 SP2514N - hard drive - 250 GB - ATA-133
                                )

                            [manu] => Array
                                (
                                    [0] => Samsung Electronics Co. Ltd.
                                )

                            [manu_id_s] => samsung
                            [cat] => Array
                                (
                                    [0] => electronics
                                    [1] => hard drive
                                )

                            [features] => Array
                                (
                                    [0] => 7200RPM, 8MB cache, IDE Ultra ATA-133
                                    [1] => NoiseGuard, SilentSeek technology, Fluid Dynamic Bearing (FDB) motor
                                )

                            [price] => Array
                                (
                                    [0] => 92
                                )

                            [popularity] => Array
                                (
                                    [0] => 6
                                )

                            [inStock] => Array
                                (
                                    [0] => 1
                                )

                            [manufacturedate_dt] => 2006-02-13T15:26:37Z
                            [store] => Array
                                (
                                    [0] => 35.0752,-97.032
                                )

                            [_version_] => 1510294336412057600
                        )

                    [1] => SolrObject Object
                        (
                            [id] => 6H500F0
                            [name] => Array
                                (
                                    [0] => Maxtor DiamondMax 11 - hard drive - 500 GB - SATA-300
                                )

                            [manu] => Array
                                (
                                    [0] => Maxtor Corp.
                                )

                            [manu_id_s] => maxtor
                            [cat] => Array
                                (
                                    [0] => electronics
                                    [1] => hard drive
                                )

                            [features] => Array
                                (
                                    [0] => SATA 3.0Gb/s, NCQ
                                    [1] => 8.5ms seek
                                    [2] => 16MB cache
                                )

                            [price] => Array
                                (
                                    [0] => 350
                                )

                            [popularity] => Array
                                (
                                    [0] => 6
                                )

                            [inStock] => Array
                                (
                                    [0] => 1
                                )

                            [store] => Array
                                (
                                    [0] => 45.17614,-93.87341
                                )

                            [manufacturedate_dt] => 2006-02-13T15:26:37Z
                            [_version_] => 1510294336449806336
                        )

                    [2] => SolrObject Object
                        (
                            [id] => F8V7067-APL-KIT
                            [name] => Array
                                (
                                    [0] => Belkin Mobile Power Cord for iPod w/ Dock
                                )

                            [manu] => Array
                                (
                                    [0] => Belkin
                                )

                            [manu_id_s] => belkin
                            [cat] => Array
                                (
                                    [0] => electronics
                                    [1] => connector
                                )

                            [features] => Array
                                (
                                    [0] => car power adapter, white
                                )

                            [weight] => Array
                                (
                                    [0] => 4
                                )

                            [price] => Array
                                (
                                    [0] => 19.95
                                )

                            [popularity] => Array
                                (
                                    [0] => 1
                                )

                            [inStock] => Array
                                (
                                    [0] => 
                                )

                            [store] => Array
                                (
                                    [0] => 45.18014,-93.87741
                                )

                            [manufacturedate_dt] => 2005-08-01T16:30:25Z
                            [_version_] => 1510294336458194944
                        )

                    [3] => SolrObject Object
                        (
                            [id] => MA147LL/A
                            [name] => Array
                                (
                                    [0] => Apple 60 GB iPod with Video Playback Black
                                )

                            [manu] => Array
                                (
                                    [0] => Apple Computer Inc.
                                )

                            [manu_id_s] => apple
                            [cat] => Array
                                (
                                    [0] => electronics
                                    [1] => music
                                )

                            [features] => Array
                                (
                                    [0] => iTunes, Podcasts, Audiobooks
                                    [1] => Stores up to 15,000 songs, 25,000 photos, or 150 hours of video
                                    [2] => 2.5-inch, 320x240 color TFT LCD display with LED backlight
                                    [3] => Up to 20 hours of battery life
                                    [4] => Plays AAC, MP3, WAV, AIFF, Audible, Apple Lossless, H.264 video
                                    [5] => Notes, Calendar, Phone book, Hold button, Date display, Photo wallet, Built-in games, JPEG photo playback, Upgradeable firmware, USB 2.0 compatibility, Playback speed control, Rechargeable capability, Battery level indication
                                )

                            [includes] => Array
                                (
                                    [0] => earbud headphones, USB cable
                                )

                            [weight] => Array
                                (
                                    [0] => 5.5
                                )

                            [price] => Array
                                (
                                    [0] => 399
                                )

                            [popularity] => Array
                                (
                                    [0] => 10
                                )

                            [inStock] => Array
                                (
                                    [0] => 1
                                )

                            [store] => Array
                                (
                                    [0] => 37.7752,-100.0232
                                )

                            [manufacturedate_dt] => 2005-10-12T08:00:00Z
                            [_version_] => 1510294336562003968
                        )

                )

        )

)

SolrQuery::__construct

Constructor

说明

public <span class="methodname">SolrQuery::__construct ([ <span class="methodparam">string $q ] )

Constructor.

参数

q
Optional search query

返回值

None

错误/异常

Emits SolrIllegalArgumentException in case of an invalid parameter was passed.

更新日志

版本 说明
PECL solr 2.0.0 If q was invalid, then a SolrIllegalArgumentException is now thrown. Previously an error was emitted.

SolrQuery::__destruct

Destructor

说明

public void SolrQuery::__destruct ( <span class="methodparam">void )

Destructor

参数

此函数没有参数。

返回值

None.

SolrQuery::getExpand

Returns true if group expanding is enabled

说明

public bool SolrQuery::getExpand ( <span class="methodparam">void )

Returns true if group expanding is enabled

SolrQuery::getExpandFilterQueries

Returns the expand filter queries

说明

public array SolrQuery::getExpandFilterQueries ( void )

Returns the expand filter queries

SolrQuery::getExpandQuery

Returns the expand query expand.q parameter

说明

public array SolrQuery::getExpandQuery ( <span class="methodparam">void )

Returns the expand query expand.q parameter

SolrQuery::getExpandRows

Returns The number of rows to display in each group (expand.rows)

说明

public int <span class="methodname">SolrQuery::getExpandRows ( <span class="methodparam">void )

Returns The number of rows to display in each group (expand.rows)

SolrQuery::getExpandSortFields

Returns an array of fields

说明

public array SolrQuery::getExpandSortFields ( <span class="methodparam">void )

Returns an array of fields

SolrQuery::getFacet

Returns the value of the facet parameter

说明

public bool SolrQuery::getFacet ( <span class="methodparam">void )

Returns the value of the facet parameter.

参数

此函数没有参数。

返回值

Returns a boolean on success and null if not set

SolrQuery::getFacetDateEnd

Returns the value for the facet.date.end parameter

说明

public string SolrQuery::getFacetDateEnd ([ <span class="methodparam">string $field_override ] )

Returns the value for the facet.date.end parameter. This method accepts an optional field override

参数

field_override
The name of the field

返回值

Returns a string on success and null if not set

SolrQuery::getFacetDateFields

Returns all the facet.date fields

说明

public array SolrQuery::getFacetDateFields ( <span class="methodparam">void )

Returns all the facet.date fields

参数

此函数没有参数。

返回值

Returns all the facet.date fields as an array or null if none was set

SolrQuery::getFacetDateGap

Returns the value of the facet.date.gap parameter

说明

public string SolrQuery::getFacetDateGap ([ <span class="methodparam">string $field_override ] )

Returns the value of the facet.date.gap parameter. It accepts an optional field override

参数

field_override
The name of the field

返回值

Returns a string on success and null if not set

SolrQuery::getFacetDateHardEnd

Returns the value of the facet.date.hardend parameter

说明

public string SolrQuery::getFacetDateHardEnd ([ <span class="methodparam">string $field_override ] )

Returns the value of the facet.date.hardend parameter. Accepts an optional field override

参数

field_override
The name of the field

返回值

Returns a string on success and null if not set

SolrQuery::getFacetDateOther

Returns the value for the facet.date.other parameter

说明

public array SolrQuery::getFacetDateOther ([ <span class="methodparam">string $field_override ] )

Returns the value for the facet.date.other parameter. This method accepts an optional field override.

参数

field_override
The name of the field

返回值

Returns an array on success and null if not set.

SolrQuery::getFacetDateStart

Returns the lower bound for the first date range for all date faceting on this field

说明

public string SolrQuery::getFacetDateStart ([ <span class="methodparam">string $field_override ] )

Returns the lower bound for the first date range for all date faceting on this field. Accepts an optional field override

参数

field_override
The name of the field

返回值

Returns a string on success and null if not set

SolrQuery::getFacetFields

Returns all the facet fields

说明

public array SolrQuery::getFacetFields ( <span class="methodparam">void )

Returns all the facet fields

参数

此函数没有参数。

返回值

Returns an array of all the fields and null if none was set

SolrQuery::getFacetLimit

Returns the maximum number of constraint counts that should be returned for the facet fields

说明

public int <span class="methodname">SolrQuery::getFacetLimit ([ <span class="methodparam">string $field_override ] )

Returns the maximum number of constraint counts that should be returned for the facet fields. This method accepts an optional field override

参数

field_override
The name of the field to override for

返回值

Returns an integer on success and null if not set

SolrQuery::getFacetMethod

Returns the value of the facet.method parameter

说明

public string SolrQuery::getFacetMethod ([ <span class="methodparam">string $field_override ] )

Returns the value of the facet.method parameter. This accepts an optional field override.

参数

field_override
The name of the field

返回值

Returns a string on success and null if not set

SolrQuery::getFacetMinCount

Returns the minimum counts for facet fields should be included in the response

说明

public int <span class="methodname">SolrQuery::getFacetMinCount ([ <span class="methodparam">string $field_override ] )

Returns the minimum counts for facet fields should be included in the response. It accepts an optional field override

参数

field_override
The name of the field

返回值

Returns an integer on success and null if not set

SolrQuery::getFacetMissing

Returns the current state of the facet.missing parameter

说明

public bool SolrQuery::getFacetMissing ([ <span class="methodparam">string $field_override ] )

Returns the current state of the facet.missing parameter. This accepts an optional field override

参数

field_override
The name of the field

返回值

Returns a boolean on success and null if not set

SolrQuery::getFacetOffset

Returns an offset into the list of constraints to be used for pagination

说明

public int <span class="methodname">SolrQuery::getFacetOffset ([ <span class="methodparam">string $field_override ] )

Returns an offset into the list of constraints to be used for pagination. Accepts an optional field override

参数

field_override
The name of the field to override for.

返回值

Returns an integer on success and null if not set

SolrQuery::getFacetPrefix

Returns the facet prefix

说明

public string SolrQuery::getFacetPrefix ([ <span class="methodparam">string $field_override ] )

Returns the facet prefix

参数

field_override
The name of the field

返回值

Returns a string on success and null if not set.

SolrQuery::getFacetQueries

Returns all the facet queries

说明

public array SolrQuery::getFacetQueries ( <span class="methodparam">void )

Returns all the facet queries

参数

此函数没有参数。

返回值

Returns an array on success and null if not set.

SolrQuery::getFacetSort

Returns the facet sort type

说明

public int <span class="methodname">SolrQuery::getFacetSort ([ <span class="methodparam">string $field_override ] )

Returns an integer (SolrQuery::FACET_SORT_INDEX or SolrQuery::FACET_SORT_COUNT)

参数

field_override
The name of the field

返回值

Returns an integer (SolrQuery::FACET_SORT_INDEX or SolrQuery::FACET_SORT_COUNT) on success or null if not set.

SolrQuery::getFields

Returns the list of fields that will be returned in the response

说明

public array SolrQuery::getFields ( <span class="methodparam">void )

Returns the list of fields that will be returned in the response

参数

此函数没有参数。

返回值

Returns an array on success and null if not set.

SolrQuery::getFilterQueries

Returns an array of filter queries

说明

public array SolrQuery::getFilterQueries ( <span class="methodparam">void )

Returns an array of filter queries. These are queries that can be used to restrict the super set of documents that can be returned, without influencing score

参数

此函数没有参数。

返回值

Returns an array on success and null if not set.

SolrQuery::getGroup

Returns true if grouping is enabled

说明

public bool SolrQuery::getGroup ( <span class="methodparam">void )

Returns true if grouping is enabled

参数

此函数没有参数。

返回值

参见

  • SolrQuery::setGroup

SolrQuery::getGroupCachePercent

Returns group cache percent value

说明

public int <span class="methodname">SolrQuery::getGroupCachePercent ( <span class="methodparam">void )

Returns group cache percent value

参数

此函数没有参数。

返回值

参见

  • SolrQuery::setGroupCachePercent

SolrQuery::getGroupFacet

Returns the group.facet parameter value

说明

public bool SolrQuery::getGroupFacet ( <span class="methodparam">void )

Returns the group.facet parameter value

参数

此函数没有参数。

返回值

参见

  • SolrQuery::setGroupFacet

SolrQuery::getGroupFields

Returns group fields (group.field parameter values)

说明

public array SolrQuery::getGroupFields ( <span class="methodparam">void )

Returns group fields (group.field parameter values)

参数

此函数没有参数。

返回值

参见

  • SolrQuery::addGroupField

SolrQuery::getGroupFormat

Returns the group.format value

说明

public string SolrQuery::getGroupFormat ( <span class="methodparam">void )

Returns the group.format value

参数

此函数没有参数。

返回值

参见

  • SolrQuery::setGroupFormat

SolrQuery::getGroupFunctions

Returns group functions (group.func parameter values)

说明

public array SolrQuery::getGroupFunctions ( <span class="methodparam">void )

Returns group functions (group.func parameter values)

参数

此函数没有参数。

返回值

参见

  • SolrQuery::addGroupFunction

SolrQuery::getGroupLimit

Returns the group.limit value

说明

public int <span class="methodname">SolrQuery::getGroupLimit ( <span class="methodparam">void )

Returns the group.limit value

参数

此函数没有参数。

返回值

参见

  • SolrQuery::setGroupLimit

SolrQuery::getGroupMain

Returns the group.main value

说明

public bool SolrQuery::getGroupMain ( <span class="methodparam">void )

Returns the group.main value

参数

此函数没有参数。

返回值

参见

  • SolrQuery::setGroupMain

SolrQuery::getGroupNGroups

Returns the group.ngroups value

说明

public bool SolrQuery::getGroupNGroups ( <span class="methodparam">void )

Returns the group.ngroups value

参数

此函数没有参数。

返回值

参见

  • SolrQuery::setGroupNGroups

SolrQuery::getGroupOffset

Returns the group.offset value

说明

public int <span class="methodname">SolrQuery::getGroupOffset ( <span class="methodparam">void )

Returns the group.offset value

参数

此函数没有参数。

返回值

参见

  • SolrQuery::setGroupOffset

SolrQuery::getGroupQueries

Returns all the group.query parameter values

说明

public array SolrQuery::getGroupQueries ( <span class="methodparam">void )

Returns all the group.query parameter values

参数

此函数没有参数。

返回值

array

参见

  • SolrQuery::addGroupQuery

SolrQuery::getGroupSortFields

Returns the group.sort value

说明

public array SolrQuery::getGroupSortFields ( <span class="methodparam">void )

Returns the group.sort value

参数

此函数没有参数。

返回值

参见

  • SolrQuery::addGroupSortField

SolrQuery::getGroupTruncate

Returns the group.truncate value

说明

public bool SolrQuery::getGroupTruncate ( <span class="methodparam">void )

Returns the group.truncate value

参数

此函数没有参数。

返回值

参见

  • SolrQuery::setGroupTruncate

SolrQuery::getHighlight

Returns the state of the hl parameter

说明

public bool SolrQuery::getHighlight ( <span class="methodparam">void )

Returns a boolean indicating whether or not to enable highlighted snippets to be generated in the query response.

参数

此函数没有参数。

返回值

Returns a boolean on success and null if not set.

SolrQuery::getHighlightAlternateField

Returns the highlight field to use as backup or default

说明

public string SolrQuery::getHighlightAlternateField ([ string $field_override ] )

Returns the highlight field to use as backup or default. It accepts an optional override.

参数

field_override
The name of the field

返回值

Returns a string on success and null if not set.

SolrQuery::getHighlightFields

Returns all the fields that Solr should generate highlighted snippets for

说明

public array SolrQuery::getHighlightFields ( <span class="methodparam">void )

Returns all the fields that Solr should generate highlighted snippets for

参数

此函数没有参数。

返回值

Returns an array on success and null if not set.

SolrQuery::getHighlightFormatter

Returns the formatter for the highlighted output

说明

public string SolrQuery::getHighlightFormatter ([ string $field_override ] )

Returns the formatter for the highlighted output

参数

field_override
The name of the field

返回值

Returns a string on success and null if not set.

SolrQuery::getHighlightFragmenter

Returns the text snippet generator for highlighted text

说明

public string SolrQuery::getHighlightFragmenter ([ string $field_override ] )

Returns the text snippet generator for highlighted text. Accepts an optional field override.

参数

field_override
The name of the field

返回值

Returns a string on success and null if not set.

SolrQuery::getHighlightFragsize

Returns the number of characters of fragments to consider for highlighting

说明

public int <span class="methodname">SolrQuery::getHighlightFragsize ([ <span class="methodparam">string $field_override ] )

Returns the number of characters of fragments to consider for highlighting. Zero implies no fragmenting. The entire field should be used.

参数

field_override
The name of the field

返回值

Returns an integer on success or null if not set.

SolrQuery::getHighlightHighlightMultiTerm

Returns whether or not to enable highlighting for range/wildcard/fuzzy/prefix queries

说明

public bool <span class="methodname">SolrQuery::getHighlightHighlightMultiTerm ( void )

Returns whether or not to enable highlighting for range/wildcard/fuzzy/prefix queries

参数

此函数没有参数。

返回值

Returns a boolean on success and null if not set.

SolrQuery::getHighlightMaxAlternateFieldLength

Returns the maximum number of characters of the field to return

说明

public int <span class="methodname">SolrQuery::getHighlightMaxAlternateFieldLength ([ string $field_override ] )

Returns the maximum number of characters of the field to return

参数

field_override
The name of the field

返回值

Returns an integer on success and null if not set.

SolrQuery::getHighlightMaxAnalyzedChars

Returns the maximum number of characters into a document to look for suitable snippets

说明

public int <span class="methodname">SolrQuery::getHighlightMaxAnalyzedChars ( void )

Returns the maximum number of characters into a document to look for suitable snippets

参数

此函数没有参数。

返回值

Returns an integer on success and null if not set.

SolrQuery::getHighlightMergeContiguous

Returns whether or not the collapse contiguous fragments into a single fragment

说明

public bool SolrQuery::getHighlightMergeContiguous ([ string $field_override ] )

Returns whether or not the collapse contiguous fragments into a single fragment. Accepts an optional field override.

参数

field_override
The name of the field

返回值

Returns a boolean on success and null if not set.

SolrQuery::getHighlightRegexMaxAnalyzedChars

Returns the maximum number of characters from a field when using the regex fragmenter

说明

public int <span class="methodname">SolrQuery::getHighlightRegexMaxAnalyzedChars ( void )

Returns the maximum number of characters from a field when using the regex fragmenter

参数

此函数没有参数。

返回值

Returns an integer on success and null if not set.

SolrQuery::getHighlightRegexPattern

Returns the regular expression for fragmenting

说明

public string SolrQuery::getHighlightRegexPattern ( void )

Returns the regular expression used for fragmenting

参数

此函数没有参数。

返回值

Returns a string on success and null if not set.

SolrQuery::getHighlightRegexSlop

Returns the deviation factor from the ideal fragment size

说明

public float SolrQuery::getHighlightRegexSlop ( <span class="methodparam">void )

Returns the factor by which the regex fragmenter can deviate from the ideal fragment size to accomodate the regular expression

参数

此函数没有参数。

返回值

Returns a double on success and null if not set.

SolrQuery::getHighlightRequireFieldMatch

Returns if a field will only be highlighted if the query matched in this particular field

说明

public bool SolrQuery::getHighlightRequireFieldMatch ( void )

Returns if a field will only be highlighted if the query matched in this particular field.

参数

此函数没有参数。

返回值

Returns a boolean on success and null if not set.

SolrQuery::getHighlightSimplePost

Returns the text which appears after a highlighted term

说明

public string SolrQuery::getHighlightSimplePost ([ string $field_override ] )

Returns the text which appears after a highlighted term. Accepts an optional field override

参数

field_override
The name of the field

返回值

Returns a string on success and null if not set.

SolrQuery::getHighlightSimplePre

Returns the text which appears before a highlighted term

说明

public string SolrQuery::getHighlightSimplePre ([ string $field_override ] )

Returns the text which appears before a highlighted term. Accepts an optional field override

参数

field_override
The name of the field

返回值

Returns a string on success and null if not set.

SolrQuery::getHighlightSnippets

Returns the maximum number of highlighted snippets to generate per field

说明

public int <span class="methodname">SolrQuery::getHighlightSnippets ([ <span class="methodparam">string $field_override ] )

Returns the maximum number of highlighted snippets to generate per field. Accepts an optional field override

参数

field_override
The name of the field

返回值

Returns an integer on success and null if not set.

SolrQuery::getHighlightUsePhraseHighlighter

Returns the state of the hl.usePhraseHighlighter parameter

说明

public bool <span class="methodname">SolrQuery::getHighlightUsePhraseHighlighter ( void )

Returns whether or not to use SpanScorer to highlight phrase terms only when they appear within the query phrase in the document.

参数

此函数没有参数。

返回值

Returns a boolean on success and null if not set.

SolrQuery::getMlt

Returns whether or not MoreLikeThis results should be enabled

说明

public bool SolrQuery::getMlt ( <span class="methodparam">void )

Returns whether or not MoreLikeThis results should be enabled

参数

此函数没有参数。

返回值

Returns a boolean on success and null if not set.

SolrQuery::getMltBoost

Returns whether or not the query will be boosted by the interesting term relevance

说明

public bool SolrQuery::getMltBoost ( <span class="methodparam">void )

Returns whether or not the query will be boosted by the interesting term relevance

参数

此函数没有参数。

返回值

Returns a boolean on success and null if not set.

SolrQuery::getMltCount

Returns the number of similar documents to return for each result

说明

public int <span class="methodname">SolrQuery::getMltCount ( <span class="methodparam">void )

Returns the number of similar documents to return for each result

参数

此函数没有参数。

返回值

Returns an integer on success and null if not set.

SolrQuery::getMltFields

Returns all the fields to use for similarity

说明

public array SolrQuery::getMltFields ( <span class="methodparam">void )

Returns all the fields to use for similarity

参数

此函数没有参数。

返回值

Returns an array on success and null if not set.

SolrQuery::getMltMaxNumQueryTerms

Returns the maximum number of query terms that will be included in any generated query

说明

public int <span class="methodname">SolrQuery::getMltMaxNumQueryTerms ( <span class="methodparam">void )

Returns the maximum number of query terms that will be included in any generated query

参数

此函数没有参数。

返回值

Returns an integer on success and null if not set.

SolrQuery::getMltMaxNumTokens

Returns the maximum number of tokens to parse in each document field that is not stored with TermVector support

说明

public int <span class="methodname">SolrQuery::getMltMaxNumTokens ( <span class="methodparam">void )

Returns the maximum number of tokens to parse in each document field that is not stored with TermVector support

参数

此函数没有参数。

返回值

Returns an integer on success and null if not set.

SolrQuery::getMltMaxWordLength

Returns the maximum word length above which words will be ignored

说明

public int <span class="methodname">SolrQuery::getMltMaxWordLength ( <span class="methodparam">void )

Returns the maximum word length above which words will be ignored

参数

此函数没有参数。

返回值

Returns an integer on success and null if not set.

SolrQuery::getMltMinDocFrequency

Returns the treshold frequency at which words will be ignored which do not occur in at least this many docs

说明

public int <span class="methodname">SolrQuery::getMltMinDocFrequency ( <span class="methodparam">void )

Returns the treshold frequency at which words will be ignored which do not occur in at least this many docs

参数

此函数没有参数。

返回值

Returns an integer on success and null if not set.

SolrQuery::getMltMinTermFrequency

Returns the frequency below which terms will be ignored in the source document

说明

public int <span class="methodname">SolrQuery::getMltMinTermFrequency ( <span class="methodparam">void )

Returns the frequency below which terms will be ignored in the source document

参数

此函数没有参数。

返回值

Returns an integer on success and null if not set.

SolrQuery::getMltMinWordLength

Returns the minimum word length below which words will be ignored

说明

public int <span class="methodname">SolrQuery::getMltMinWordLength ( <span class="methodparam">void )

Returns the minimum word length below which words will be ignored

参数

此函数没有参数。

返回值

Returns an integer on success and null if not set.

SolrQuery::getMltQueryFields

Returns the query fields and their boosts

说明

public array SolrQuery::getMltQueryFields ( <span class="methodparam">void )

Returns the query fields and their boosts

参数

此函数没有参数。

返回值

Returns an array on success and null if not set.

SolrQuery::getQuery

Returns the main query

说明

public string SolrQuery::getQuery ( <span class="methodparam">void )

Returns the main search query

参数

此函数没有参数。

返回值

Returns a string on success and null if not set.

SolrQuery::getRows

Returns the maximum number of documents

说明

public int <span class="methodname">SolrQuery::getRows ( <span class="methodparam">void )

Returns the maximum number of documents from the complete result set to return to the client for every request

参数

此函数没有参数。

返回值

Returns an integer on success and null if not set.

SolrQuery::getSortFields

Returns all the sort fields

说明

public array SolrQuery::getSortFields ( <span class="methodparam">void )

Returns all the sort fields

参数

此函数没有参数。

返回值

Returns an array on success and null if none of the parameters was set.

SolrQuery::getStart

Returns the offset in the complete result set

说明

public int <span class="methodname">SolrQuery::getStart ( <span class="methodparam">void )

Returns the offset in the complete result set for the queries where the set of returned documents should begin.

参数

此函数没有参数。

返回值

Returns an integer on success and null if not set.

SolrQuery::getStats

Returns whether or not stats is enabled

说明

public bool SolrQuery::getStats ( <span class="methodparam">void )

Returns whether or not stats is enabled

参数

此函数没有参数。

返回值

Returns a boolean on success and null if not set.

SolrQuery::getStatsFacets

Returns all the stats facets that were set

说明

public array SolrQuery::getStatsFacets ( <span class="methodparam">void )

Returns all the stats facets that were set

参数

此函数没有参数。

返回值

Returns an array on success and null if not set.

SolrQuery::getStatsFields

Returns all the statistics fields

说明

public array SolrQuery::getStatsFields ( <span class="methodparam">void )

Returns all the statistics fields

参数

此函数没有参数。

返回值

Returns an array on success and null if not set.

SolrQuery::getTerms

Returns whether or not the TermsComponent is enabled

说明

public bool SolrQuery::getTerms ( <span class="methodparam">void )

Returns whether or not the TermsComponent is enabled

参数

此函数没有参数。

返回值

Returns a boolean on success and null if not set.

SolrQuery::getTermsField

Returns the field from which the terms are retrieved

说明

public string SolrQuery::getTermsField ( <span class="methodparam">void )

Returns the field from which the terms are retrieved

参数

此函数没有参数。

返回值

Returns a string on success and null if not set.

SolrQuery::getTermsIncludeLowerBound

Returns whether or not to include the lower bound in the result set

说明

public bool SolrQuery::getTermsIncludeLowerBound ( void )

Returns whether or not to include the lower bound in the result set

参数

此函数没有参数。

返回值

Returns a boolean on success and null if not set.

SolrQuery::getTermsIncludeUpperBound

Returns whether or not to include the upper bound term in the result set

说明

public bool SolrQuery::getTermsIncludeUpperBound ( void )

Returns whether or not to include the upper bound term in the result set

参数

此函数没有参数。

返回值

Returns a boolean on success and null if not set.

SolrQuery::getTermsLimit

Returns the maximum number of terms Solr should return

说明

public int <span class="methodname">SolrQuery::getTermsLimit ( <span class="methodparam">void )

Returns the maximum number of terms Solr should return

参数

此函数没有参数。

返回值

Returns an integer on success and null if not set.

SolrQuery::getTermsLowerBound

Returns the term to start at

说明

public string SolrQuery::getTermsLowerBound ( <span class="methodparam">void )

Returns the term to start at

参数

此函数没有参数。

返回值

Returns a string on success and null if not set.

SolrQuery::getTermsMaxCount

Returns the maximum document frequency

说明

public int <span class="methodname">SolrQuery::getTermsMaxCount ( <span class="methodparam">void )

Returns the maximum document frequency

参数

此函数没有参数。

返回值

Returns an integer on success and null if not set.

SolrQuery::getTermsMinCount

Returns the minimum document frequency to return in order to be included

说明

public int <span class="methodname">SolrQuery::getTermsMinCount ( <span class="methodparam">void )

Returns the minimum document frequency to return in order to be included

参数

此函数没有参数。

返回值

Returns an integer on success and null if not set.

SolrQuery::getTermsPrefix

Returns the term prefix

说明

public string SolrQuery::getTermsPrefix ( <span class="methodparam">void )

Returns the prefix to which matching terms must be restricted. This will restrict matches to only terms that start with the prefix

参数

此函数没有参数。

返回值

Returns a string on success and null if not set.

SolrQuery::getTermsReturnRaw

Whether or not to return raw characters

说明

public bool SolrQuery::getTermsReturnRaw ( <span class="methodparam">void )

Returns a boolean indicating whether or not to return the raw characters of the indexed term, regardless of if it is human readable

参数

此函数没有参数。

返回值

Returns a boolean on success and null if not set.

SolrQuery::getTermsSort

Returns an integer indicating how terms are sorted

说明

public int <span class="methodname">SolrQuery::getTermsSort ( <span class="methodparam">void )

SolrQuery::TERMS_SORT_INDEX indicates that the terms are returned by index order. SolrQuery::TERMS_SORT_COUNT implies that the terms are sorted by term frequency (highest count first)

参数

此函数没有参数。

返回值

Returns an integer on success and null if not set.

SolrQuery::getTermsUpperBound

Returns the term to stop at

说明

public string SolrQuery::getTermsUpperBound ( <span class="methodparam">void )

Returns the term to stop at

参数

此函数没有参数。

返回值

Returns a string on success and null if not set.

SolrQuery::getTimeAllowed

Returns the time in milliseconds allowed for the query to finish

说明

public int <span class="methodname">SolrQuery::getTimeAllowed ( <span class="methodparam">void )

Returns the time in milliseconds allowed for the query to finish.

参数

此函数没有参数。

返回值

Returns and integer on success and null if it is not set.

SolrQuery::removeExpandFilterQuery

Removes an expand filter query

说明

public SolrQuery SolrQuery::removeExpandFilterQuery ( string $fq )

Removes an expand filter query.

参数

fq

返回值

SolrQuery

参见

  • SolrQuery::setExpand
  • SolrQuery::addExpandSortField
  • SolrQuery::removeExpandSortField
  • SolrQuery::setExpandRows
  • SolrQuery::setExpandQuery
  • SolrQuery::addExpandFilterQuery

SolrQuery::removeExpandSortField

Removes an expand sort field from the expand.sort parameter

说明

public SolrQuery SolrQuery::removeExpandSortField ( <span class="methodparam">string $field )

Removes an expand sort field from the expand.sort parameter.

参数

field
field name

返回值

SolrQuery

参见

  • SolrQuery::setExpand
  • SolrQuery::addExpandSortField
  • SolrQuery::setExpandRows
  • SolrQuery::setExpandQuery
  • SolrQuery::addExpandFilterQuery
  • SolrQuery::removeExpandFilterQuery

SolrQuery::removeFacetDateField

Removes one of the facet date fields

说明

public SolrQuery SolrQuery::removeFacetDateField ( <span class="methodparam">string $field )

The name of the field

参数

field
The name of the date field to remove

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::removeFacetDateOther

Removes one of the facet.date.other parameters

说明

public SolrQuery SolrQuery::removeFacetDateOther ( <span class="methodparam">string $value [, string $field_override ] )

Removes one of the facet.date.other parameters

参数

value
The value

field_override
The name of the field.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::removeFacetField

Removes one of the facet.date parameters

说明

public SolrQuery SolrQuery::removeFacetField ( <span class="methodparam">string $field )

Removes one of the facet.date parameters

参数

field
The name of the field

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::removeFacetQuery

Removes one of the facet.query parameters

说明

public SolrQuery SolrQuery::removeFacetQuery ( <span class="methodparam">string $value )

Removes one of the facet.query parameters.

参数

value
The value

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::removeField

Removes a field from the list of fields

说明

public SolrQuery SolrQuery::removeField ( <span class="methodparam">string $field )

Removes a field from the list of fields

参数

field
Name of the field.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::removeFilterQuery

Removes a filter query

说明

public SolrQuery SolrQuery::removeFilterQuery ( <span class="methodparam">string $fq )

Removes a filter query.

参数

fq
The filter query to remove

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::removeHighlightField

Removes one of the fields used for highlighting

说明

public SolrQuery SolrQuery::removeHighlightField ( <span class="methodparam">string $field )

Removes one of the fields used for highlighting.

参数

field
The name of the field

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::removeMltField

Removes one of the moreLikeThis fields

说明

public SolrQuery SolrQuery::removeMltField ( <span class="methodparam">string $field )

Removes one of the moreLikeThis fields.

参数

field
Name of the field

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::removeMltQueryField

Removes one of the moreLikeThis query fields

说明

public SolrQuery SolrQuery::removeMltQueryField ( <span class="methodparam">string $queryField )

Removes one of the moreLikeThis query fields.

参数

queryField
The query field

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::removeSortField

Removes one of the sort fields

说明

public SolrQuery SolrQuery::removeSortField ( <span class="methodparam">string $field )

Removes one of the sort fields

参数

field
The name of the field

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::removeStatsFacet

Removes one of the stats.facet parameters

说明

public SolrQuery SolrQuery::removeStatsFacet ( <span class="methodparam">string $value )

Removes one of the stats.facet parameters

参数

value
The value

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::removeStatsField

Removes one of the stats.field parameters

说明

public SolrQuery SolrQuery::removeStatsField ( <span class="methodparam">string $field )

Removes one of the stats.field parameters

参数

field
The name of the field.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setEchoHandler

Toggles the echoHandler parameter

说明

public SolrQuery SolrQuery::setEchoHandler ( <span class="methodparam">bool $flag )

If set to true, Solr places the name of the handle used in the response to the client for debugging purposes.

参数

flag
true or false

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setEchoParams

Determines what kind of parameters to include in the response

说明

public SolrQuery SolrQuery::setEchoParams ( <span class="methodparam">string $type )

Instructs Solr what kinds of Request parameters should be included in the response for debugging purposes, legal values include:

- none - don't include any request parameters for debugging
- explicit - include the parameters explicitly specified by the client in the request
- all - include all parameters involved in this request, either specified explicitly by the client, or implicit because of the request handler configuration.

参数

type
The type of parameters to include

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setExpand

Enables/Disables the Expand Component

说明

public SolrQuery SolrQuery::setExpand ( <span class="methodparam">bool $value )

Enables/Disables the Expand Component.

参数

value
Bool flag

返回值

SolrQuery

范例

示例 #1 SolrQuery::setExpand example

<?php

$query = new SolrQuery('lucene');

$query
    ->setExpand(true)
    ->setExpandRows(50)
    ->setExpandQuery('text:product')
    ->addExpandFilterQuery('manu:apple')
    ->addExpandFilterQuery('inStock:true')
    ->addExpandSortField('score', SolrQuery::ORDER_DESC)
    ->addExpandSortField('title', SolrQuery::ORDER_ASC);

echo $query.PHP_EOL;

?>

以上例程的输出类似于:

q=lucene&expand=true&expand.rows=50&expand.q=text:product&expand.fq=manu:apple&expand.fq=inStock:true&expand.sort=score desc,title asc

参见

  • SolrQuery::addExpandSortField
  • SolrQuery::removeExpandSortField
  • SolrQuery::setExpandRows
  • SolrQuery::setExpandQuery
  • SolrQuery::addExpandFilterQuery
  • SolrQuery::removeExpandFilterQuery

SolrQuery::setExpandQuery

Sets the expand.q parameter

说明

public SolrQuery SolrQuery::setExpandQuery ( <span class="methodparam">string $q )

Sets the expand.q parameter.

Overrides the main q parameter, determines which documents to include in the main group.

参数

q

返回值

SolrQuery

参见

  • SolrQuery::setExpand
  • SolrQuery::addExpandSortField
  • SolrQuery::removeExpandSortField
  • SolrQuery::setExpandRows
  • SolrQuery::addExpandFilterQuery
  • SolrQuery::removeExpandFilterQuery

SolrQuery::setExpandRows

Sets the number of rows to display in each group (expand.rows). Server Default 5

说明

public SolrQuery SolrQuery::setExpandRows ( <span class="methodparam">int $value )

Sets the number of rows to display in each group (expand.rows). Server Default 5

参数

value

返回值

SolrQuery

参见

  • SolrQuery::setExpand
  • SolrQuery::addExpandSortField
  • SolrQuery::removeExpandSortField
  • SolrQuery::setExpandQuery
  • SolrQuery::addExpandFilterQuery
  • SolrQuery::removeExpandFilterQuery

SolrQuery::setExplainOther

Sets the explainOther common query parameter

说明

public SolrQuery SolrQuery::setExplainOther ( <span class="methodparam">string $query )

Sets the explainOther common query parameter

参数

query
The Lucene query to identify a set of documents

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setFacet

Maps to the facet parameter. Enables or disables facetting

说明

public SolrQuery SolrQuery::setFacet ( <span class="methodparam">bool $flag )

Enables or disables faceting.

参数

value
true enables faceting and false disables it.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setFacetDateEnd

Maps to facet.date.end

说明

public SolrQuery SolrQuery::setFacetDateEnd ( <span class="methodparam">string $value [, string $field_override ] )

Maps to facet.date.end

参数

value
See facet.date.end

field_override
Name of the field

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setFacetDateGap

Maps to facet.date.gap

说明

public SolrQuery SolrQuery::setFacetDateGap ( <span class="methodparam">string $value [, string $field_override ] )

Maps to facet.date.gap

参数

value
See facet.date.gap

field_override
The name of the field

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setFacetDateHardEnd

Maps to facet.date.hardend

说明

public SolrQuery SolrQuery::setFacetDateHardEnd ( <span class="methodparam">bool $value [, string $field_override ] )

Maps to facet.date.hardend

参数

value
See facet.date.hardend

field_override
The name of the field

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setFacetDateStart

Maps to facet.date.start

说明

public SolrQuery SolrQuery::setFacetDateStart ( <span class="methodparam">string $value [, string $field_override ] )

Maps to facet.date.start

参数

value
See facet.date.start

field_override
The name of the field.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setFacetEnumCacheMinDefaultFrequency

Sets the minimum document frequency used for determining term count

说明

public SolrQuery <span class="methodname">SolrQuery::setFacetEnumCacheMinDefaultFrequency ( int $frequency [, <span class="type">string $field_override ] )

Sets the minimum document frequency used for determining term count

参数

value
The minimum frequency

field_override
The name of the field.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setFacetLimit

Maps to facet.limit

说明

public SolrQuery SolrQuery::setFacetLimit ( <span class="methodparam">int $limit [, string $field_override ] )

Maps to facet.limit. Sets the maximum number of constraint counts that should be returned for the facet fields.

参数

limit
The maximum number of constraint counts

field_override
The name of the field.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setFacetMethod

Specifies the type of algorithm to use when faceting a field

说明

public SolrQuery SolrQuery::setFacetMethod ( <span class="methodparam">string $method [, string $field_override ] )

Specifies the type of algorithm to use when faceting a field. This method accepts optional field override.

参数

method
The method to use.

field_override
The name of the field.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setFacetMinCount

Maps to facet.mincount

说明

public SolrQuery SolrQuery::setFacetMinCount ( <span class="methodparam">int $mincount [, string $field_override ] )

Sets the minimum counts for facet fields that should be included in the response

参数

mincount
The minimum count

field_override
The name of the field.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setFacetMissing

Maps to facet.missing

说明

public SolrQuery SolrQuery::setFacetMissing ( <span class="methodparam">bool $flag [, string $field_override ] )

Used to indicate that in addition to the Term-based constraints of a facet field, a count of all matching results which have no value for the field should be computed

参数

flag
true turns this feature on. false disables it.

field_override
The name of the field.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setFacetOffset

Sets the offset into the list of constraints to allow for pagination

说明

public SolrQuery SolrQuery::setFacetOffset ( <span class="methodparam">int $offset [, string $field_override ] )

Sets the offset into the list of constraints to allow for pagination.

参数

offset
The offset

field_override
The name of the field.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setFacetPrefix

Specifies a string prefix with which to limits the terms on which to facet

说明

public SolrQuery SolrQuery::setFacetPrefix ( <span class="methodparam">string $prefix [, string $field_override ] )

Specifies a string prefix with which to limits the terms on which to facet.

参数

prefix
The prefix string

field_override
The name of the field.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setFacetSort

Determines the ordering of the facet field constraints

说明

public SolrQuery SolrQuery::setFacetSort ( <span class="methodparam">int $facetSort [, string $field_override ] )

Determines the ordering of the facet field constraints

参数

facetSort
Use SolrQuery::FACET_SORT_INDEX for sorting by index order or SolrQuery::FACET_SORT_COUNT for sorting by count.

field_override
The name of the field.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setGroup

Enable/Disable result grouping (group parameter)

说明

public SolrQuery SolrQuery::setGroup ( <span class="methodparam">bool $value )

Enable/Disable result grouping (group parameter)

参数

value

返回值

参见

  • SolrQuery::getGroup
  • SolrQuery::addGroupField
  • SolrQuery::addGroupFunction
  • SolrQuery::addGroupQuery
  • SolrQuery::addGroupSortField
  • SolrQuery::setGroupFacet
  • SolrQuery::setGroupOffset
  • SolrQuery::setGroupLimit
  • SolrQuery::setGroupMain
  • SolrQuery::setGroupNGroups
  • SolrQuery::setGroupTruncate
  • SolrQuery::setGroupFormat
  • SolrQuery::setGroupCachePercent

SolrQuery::setGroupCachePercent

Enables caching for result grouping

说明

public SolrQuery SolrQuery::setGroupCachePercent ( <span class="methodparam">int $percent )

Setting this parameter to a number greater than 0 enables caching for result grouping. Result Grouping executes two searches; this option caches the second search. The server default value is 0. Testing has shown that group caching only improves search time with Boolean, wildcard, and fuzzy queries. For simple queries like term or "match all" queries, group caching degrades performance. group.cache.percent parameter

参数

percent

返回值

错误/异常

Emits SolrIllegalArgumentException in case of an invalid parameter was passed.

参见

  • SolrQuery::setGroup
  • SolrQuery::addGroupField
  • SolrQuery::addGroupFunction
  • SolrQuery::addGroupQuery
  • SolrQuery::addGroupSortField
  • SolrQuery::setGroupFacet
  • SolrQuery::setGroupOffset
  • SolrQuery::setGroupLimit
  • SolrQuery::setGroupMain
  • SolrQuery::setGroupNGroups
  • SolrQuery::setGroupTruncate
  • SolrQuery::setGroupFormat

SolrQuery::setGroupFacet

Sets group.facet parameter

说明

public SolrQuery SolrQuery::setGroupFacet ( <span class="methodparam">bool $value )

Determines whether to compute grouped facets for the field facets specified in facet.field parameters. Grouped facets are computed based on the first specified group.

参数

value

返回值

参见

  • SolrQuery::setGroup
  • SolrQuery::addGroupField
  • SolrQuery::addGroupFunction
  • SolrQuery::addGroupQuery
  • SolrQuery::addGroupSortField
  • SolrQuery::setGroupOffset
  • SolrQuery::setGroupLimit
  • SolrQuery::setGroupMain
  • SolrQuery::setGroupNGroups
  • SolrQuery::setGroupTruncate
  • SolrQuery::setGroupFormat
  • SolrQuery::setGroupCachePercent

SolrQuery::setGroupFormat

Sets the group format, result structure (group.format parameter)

说明

public SolrQuery SolrQuery::setGroupFormat ( <span class="methodparam">string $value )

Sets the group.format parameter. If this parameter is set to simple, the grouped documents are presented in a single flat list, and the start and rows parameters affect the numbers of documents instead of groups. Accepts: grouped/simple

参数

value

返回值

参见

  • SolrQuery::setGroup
  • SolrQuery::addGroupField
  • SolrQuery::addGroupFunction
  • SolrQuery::addGroupQuery
  • SolrQuery::addGroupSortField
  • SolrQuery::setGroupFacet
  • SolrQuery::setGroupOffset
  • SolrQuery::setGroupLimit
  • SolrQuery::setGroupMain
  • SolrQuery::setGroupNGroups
  • SolrQuery::setGroupTruncate
  • SolrQuery::setGroupCachePercent

SolrQuery::setGroupLimit

Specifies the number of results to return for each group. The server default value is 1

说明

public SolrQuery SolrQuery::setGroupLimit ( <span class="methodparam">int $value )

Specifies the number of results to return for each group. The server default value is 1.

参数

value

返回值

参见

  • SolrQuery::setGroup
  • SolrQuery::addGroupField
  • SolrQuery::addGroupFunction
  • SolrQuery::addGroupQuery
  • SolrQuery::addGroupSortField
  • SolrQuery::setGroupFacet
  • SolrQuery::setGroupOffset
  • SolrQuery::setGroupMain
  • SolrQuery::setGroupNGroups
  • SolrQuery::setGroupTruncate
  • SolrQuery::setGroupFormat
  • SolrQuery::setGroupCachePercent

SolrQuery::setGroupMain

If true, the result of the first field grouping command is used as the main result list in the response, using group.format=simple

说明

public SolrQuery SolrQuery::setGroupMain ( <span class="methodparam">string $value )

If true, the result of the first field grouping command is used as the main result list in the response, using group.format=simple.

参数

value

返回值

参见

参见

  • SolrQuery::setGroup
  • SolrQuery::addGroupField
  • SolrQuery::addGroupFunction
  • SolrQuery::addGroupQuery
  • SolrQuery::addGroupSortField
  • SolrQuery::setGroupFacet
  • SolrQuery::setGroupOffset
  • SolrQuery::setGroupMain
  • SolrQuery::setGroupNGroups
  • SolrQuery::setGroupTruncate
  • SolrQuery::setGroupFormat
  • SolrQuery::setGroupCachePercent

SolrQuery::setGroupNGroups

If true, Solr includes the number of groups that have matched the query in the results

说明

public SolrQuery SolrQuery::setGroupNGroups ( <span class="methodparam">bool $value )

If true, Solr includes the number of groups that have matched the query in the results.

参数

value

返回值

参见

  • SolrQuery::setGroup
  • SolrQuery::addGroupField
  • SolrQuery::addGroupFunction
  • SolrQuery::addGroupQuery
  • SolrQuery::addGroupSortField
  • SolrQuery::setGroupFacet
  • SolrQuery::setGroupOffset
  • SolrQuery::setGroupLimit
  • SolrQuery::setGroupMain
  • SolrQuery::setGroupTruncate
  • SolrQuery::setGroupFormat
  • SolrQuery::setGroupCachePercent

SolrQuery::setGroupOffset

Sets the group.offset parameter

说明

public SolrQuery SolrQuery::setGroupOffset ( <span class="methodparam">int $value )

Sets the group.offset parameter.

参数

value

返回值

参见

  • SolrQuery::setGroup
  • SolrQuery::addGroupField
  • SolrQuery::addGroupFunction
  • SolrQuery::addGroupQuery
  • SolrQuery::addGroupSortField
  • SolrQuery::setGroupFacet
  • SolrQuery::setGroupLimit
  • SolrQuery::setGroupMain
  • SolrQuery::setGroupNGroups
  • SolrQuery::setGroupTruncate
  • SolrQuery::setGroupFormat
  • SolrQuery::setGroupCachePercent

SolrQuery::setGroupTruncate

If true, facet counts are based on the most relevant document of each group matching the query

说明

public SolrQuery SolrQuery::setGroupTruncate ( <span class="methodparam">bool $value )

If true, facet counts are based on the most relevant document of each group matching the query. The server default value is false. group.truncate parameter

参数

value

返回值

参见

  • SolrQuery::setGroup
  • SolrQuery::addGroupField
  • SolrQuery::addGroupFunction
  • SolrQuery::addGroupQuery
  • SolrQuery::addGroupSortField
  • SolrQuery::setGroupFacet
  • SolrQuery::setGroupOffset
  • SolrQuery::setGroupLimit
  • SolrQuery::setGroupMain
  • SolrQuery::setGroupNGroups
  • SolrQuery::setGroupFormat
  • SolrQuery::setGroupCachePercent

SolrQuery::setHighlight

Enables or disables highlighting

说明

public SolrQuery SolrQuery::setHighlight ( <span class="methodparam">bool $flag )

Setting it to true enables highlighted snippets to be generated in the query response.

Setting it to false disables highlighting

参数

flag
Enable or disable highlighting

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setHighlightAlternateField

Specifies the backup field to use

说明

public SolrQuery SolrQuery::setHighlightAlternateField ( string $field [, <span class="type">string $field_override ] )

If a snippet cannot be generated because there were no matching terms, one can specify a field to use as the backup or default summary

参数

field
The name of the backup field

field_override
The name of the field we are overriding this setting for.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setHighlightFormatter

Specify a formatter for the highlight output

说明

public SolrQuery SolrQuery::setHighlightFormatter ( <span class="methodparam">string $formatter [, string $field_override ] )

Specify a formatter for the highlight output.

参数

formatter
Currently the only legal value is "simple"

field_override
The name of the field.

SolrQuery::setHighlightFragmenter

Sets a text snippet generator for highlighted text

说明

public SolrQuery SolrQuery::setHighlightFragmenter ( string $fragmenter [, <span class="type">string $field_override ] )

Specify a text snippet generator for highlighted text.

参数

fragmenter
The standard fragmenter is gap. Another option is regex, which tries to create fragments that resembles a certain regular expression

field_override
The name of the field.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setHighlightFragsize

The size of fragments to consider for highlighting

说明

public SolrQuery SolrQuery::setHighlightFragsize ( <span class="methodparam">int $size [, string $field_override ] )

Sets the size, in characters, of fragments to consider for highlighting. "0" indicates that the whole field value should be used (no fragmenting).

参数

size
The size, in characters, of fragments to consider for highlighting

field_override
The name of the field.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setHighlightHighlightMultiTerm

Use SpanScorer to highlight phrase terms

说明

public SolrQuery <span class="methodname">SolrQuery::setHighlightHighlightMultiTerm ( bool $flag )

Use SpanScorer to highlight phrase terms only when they appear within the query phrase in the document.

参数

flag
Whether or not to use SpanScorer to highlight phrase terms only when they appear within the query phrase in the document.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setHighlightMaxAlternateFieldLength

Sets the maximum number of characters of the field to return

说明

public SolrQuery <span class="methodname">SolrQuery::setHighlightMaxAlternateFieldLength ( int $fieldLength [, <span class="type">string $field_override ] )

If SolrQuery::setHighlightAlternateField() was passed the value true, this parameter specifies the maximum number of characters of the field to return

Any value less than or equal to 0 means unlimited.

参数

fieldLength
The length of the field

field_override
The name of the field.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setHighlightMaxAnalyzedChars

Specifies the number of characters into a document to look for suitable snippets

说明

public SolrQuery SolrQuery::setHighlightMaxAnalyzedChars ( int $value )

Specifies the number of characters into a document to look for suitable snippets

参数

value
The number of characters into a document to look for suitable snippets

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setHighlightMergeContiguous

Whether or not to collapse contiguous fragments into a single fragment

说明

public SolrQuery SolrQuery::setHighlightMergeContiguous ( bool $flag [, string $field_override ] )

Whether or not to collapse contiguous fragments into a single fragment

参数

value
Whether or not to collapse contiguous fragments into a single fragment

field_override
The name of the field.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setHighlightRegexMaxAnalyzedChars

Specify the maximum number of characters to analyze

说明

public SolrQuery <span class="methodname">SolrQuery::setHighlightRegexMaxAnalyzedChars ( int $maxAnalyzedChars )

Specify the maximum number of characters to analyze from a field when using the regex fragmenter

参数

maxAnalyzedChars
The maximum number of characters to analyze from a field when using the regex fragmenter

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setHighlightRegexPattern

Specify the regular expression for fragmenting

说明

public SolrQuery SolrQuery::setHighlightRegexPattern ( string $value )

Specifies the regular expression for fragmenting. This could be used to extract sentences

参数

value
The regular expression for fragmenting. This could be used to extract sentences

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setHighlightRegexSlop

Sets the factor by which the regex fragmenter can stray from the ideal fragment size

说明

public SolrQuery SolrQuery::setHighlightRegexSlop ( <span class="methodparam">float $factor )

The factor by which the regex fragmenter can stray from the ideal fragment size ( specfied by SolrQuery::setHighlightFragsize )to accommodate the regular expression

参数

factor
The factor by which the regex fragmenter can stray from the ideal fragment size

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setHighlightRequireFieldMatch

Require field matching during highlighting

说明

public SolrQuery SolrQuery::setHighlightRequireFieldMatch ( bool $flag )

If true, then a field will only be highlighted if the query matched in this particular field.

This will only work if SolrQuery::setHighlightUsePhraseHighlighter() was set to true

参数

flag
true or false

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setHighlightSimplePost

Sets the text which appears after a highlighted term

说明

public SolrQuery SolrQuery::setHighlightSimplePost ( string $simplePost [, <span class="type">string $field_override ] )

Sets the text which appears before a highlighted term

参数

simplePost
Sets the text which appears after a highlighted term

The default is </em>

field_override
The name of the field.

SolrQuery::setHighlightSimplePre

Sets the text which appears before a highlighted term

说明

public SolrQuery SolrQuery::setHighlightSimplePre ( <span class="methodparam">string $simplePre [, string $field_override ] )

Sets the text which appears before a highlighted term

The default is <em>

参数

simplePre
The text which appears before a highlighted term

field_override
The name of the field.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setHighlightSnippets

Sets the maximum number of highlighted snippets to generate per field

说明

public SolrQuery SolrQuery::setHighlightSnippets ( <span class="methodparam">int $value [, string $field_override ] )

Sets the maximum number of highlighted snippets to generate per field

参数

value
The maximum number of highlighted snippets to generate per field

field_override
The name of the field.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setHighlightUsePhraseHighlighter

Whether to highlight phrase terms only when they appear within the query phrase

说明

public SolrQuery <span class="methodname">SolrQuery::setHighlightUsePhraseHighlighter ( bool $flag )

Sets whether or not to use SpanScorer to highlight phrase terms only when they appear within the query phrase in the document

参数

value
Whether or not to use SpanScorer to highlight phrase terms only when they appear within the query phrase in the document

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setMlt

Enables or disables moreLikeThis

说明

public SolrQuery SolrQuery::setMlt ( <span class="methodparam">bool $flag )

Enables or disables moreLikeThis

参数

flag
true enables it and false turns it off.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setMltBoost

Set if the query will be boosted by the interesting term relevance

说明

public SolrQuery SolrQuery::setMltBoost ( <span class="methodparam">bool $flag )

Set if the query will be boosted by the interesting term relevance

参数

value
Sets to true or false

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setMltCount

Set the number of similar documents to return for each result

说明

public SolrQuery SolrQuery::setMltCount ( <span class="methodparam">int $count )

Set the number of similar documents to return for each result

参数

count
The number of similar documents to return for each result

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setMltMaxNumQueryTerms

Sets the maximum number of query terms included

说明

public SolrQuery SolrQuery::setMltMaxNumQueryTerms ( int $value )

Sets the maximum number of query terms that will be included in any generated query.

参数

value
The maximum number of query terms that will be included in any generated query

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setMltMaxNumTokens

Specifies the maximum number of tokens to parse

说明

public SolrQuery SolrQuery::setMltMaxNumTokens ( <span class="methodparam">int $value )

Specifies the maximum number of tokens to parse in each example doc field that is not stored with TermVector support.

参数

value
The maximum number of tokens to parse

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setMltMaxWordLength

Sets the maximum word length

说明

public SolrQuery SolrQuery::setMltMaxWordLength ( <span class="methodparam">int $maxWordLength )

Sets the maximum word length above which words will be ignored.

参数

maxWordLength
The maximum word length above which words will be ignored

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setMltMinDocFrequency

Sets the mltMinDoc frequency

说明

public SolrQuery SolrQuery::setMltMinDocFrequency ( <span class="methodparam">int $minDocFrequency )

The frequency at which words will be ignored which do not occur in at least this many docs.

参数

minDocFrequency
Sets the frequency at which words will be ignored which do not occur in at least this many docs.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setMltMinTermFrequency

Sets the frequency below which terms will be ignored in the source docs

说明

public SolrQuery SolrQuery::setMltMinTermFrequency ( int $minTermFrequency )

Sets the frequency below which terms will be ignored in the source docs

参数

minTermFrequency
The frequency below which terms will be ignored in the source docs

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setMltMinWordLength

Sets the minimum word length

说明

public SolrQuery SolrQuery::setMltMinWordLength ( <span class="methodparam">int $minWordLength )

Sets the minimum word length below which words will be ignored.

参数

minWordLength
The minimum word length below which words will be ignored

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setOmitHeader

Exclude the header from the returned results

说明

public SolrQuery SolrQuery::setOmitHeader ( <span class="methodparam">bool $flag )

Exclude the header from the returned results.

参数

flag
true excludes the header from the result.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setQuery

Sets the search query

说明

public SolrQuery SolrQuery::setQuery ( <span class="methodparam">string $query )

Sets the search query.

参数

query
The search query

返回值

Returns the current SolrQuery object

SolrQuery::setRows

Specifies the maximum number of rows to return in the result

说明

public SolrQuery SolrQuery::setRows ( <span class="methodparam">int $rows )

Specifies the maximum number of rows to return in the result

参数

rows
The maximum number of rows to return

返回值

Returns the current SolrQuery object.

SolrQuery::setShowDebugInfo

Flag to show debug information

说明

public SolrQuery SolrQuery::setShowDebugInfo ( <span class="methodparam">bool $flag )

Whether to show debug info

参数

flag
Whether to show debug info. true or false

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setStart

Specifies the number of rows to skip

说明

public SolrQuery SolrQuery::setStart ( <span class="methodparam">int $start )

Specifies the number of rows to skip. Useful in pagination of results.

参数

start
The number of rows to skip.

返回值

Returns the current SolrQuery object.

SolrQuery::setStats

Enables or disables the Stats component

说明

public SolrQuery SolrQuery::setStats ( <span class="methodparam">bool $flag )

Enables or disables the Stats component.

参数

flag
true turns on the stats component and false disables it.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setTerms

Enables or disables the TermsComponent

说明

public SolrQuery SolrQuery::setTerms ( <span class="methodparam">bool $flag )

Enables or disables the TermsComponent

参数

flag
true enables it. false turns it off

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setTermsField

Sets the name of the field to get the Terms from

说明

public SolrQuery SolrQuery::setTermsField ( <span class="methodparam">string $fieldname )

Sets the name of the field to get the terms from

参数

fieldname
The field name

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setTermsIncludeLowerBound

Include the lower bound term in the result set

说明

public SolrQuery SolrQuery::setTermsIncludeLowerBound ( bool $flag )

Include the lower bound term in the result set.

参数

flag
Include the lower bound term in the result set

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setTermsIncludeUpperBound

Include the upper bound term in the result set

说明

public SolrQuery SolrQuery::setTermsIncludeUpperBound ( bool $flag )

Include the upper bound term in the result set.

参数

flag
true or false

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setTermsLimit

Sets the maximum number of terms to return

说明

public SolrQuery SolrQuery::setTermsLimit ( <span class="methodparam">int $limit )

Sets the maximum number of terms to return

参数

limit
The maximum number of terms to return. All the terms will be returned if the limit is negative.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setTermsLowerBound

Specifies the Term to start from

说明

public SolrQuery SolrQuery::setTermsLowerBound ( <span class="methodparam">string $lowerBound )

Specifies the Term to start from

参数

lowerBound
The lower bound Term

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setTermsMaxCount

Sets the maximum document frequency

说明

public SolrQuery SolrQuery::setTermsMaxCount ( <span class="methodparam">int $frequency )

Sets the maximum document frequency.

参数

frequency
The maximum document frequency.

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setTermsMinCount

Sets the minimum document frequency

说明

public SolrQuery SolrQuery::setTermsMinCount ( <span class="methodparam">int $frequency )

Sets the minimum doc frequency to return in order to be included

参数

frequency
The minimum frequency

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setTermsPrefix

Restrict matches to terms that start with the prefix

说明

public SolrQuery SolrQuery::setTermsPrefix ( <span class="methodparam">string $prefix )

Restrict matches to terms that start with the prefix

参数

prefix
Restrict matches to terms that start with the prefix

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setTermsReturnRaw

Return the raw characters of the indexed term

说明

public SolrQuery SolrQuery::setTermsReturnRaw ( <span class="methodparam">bool $flag )

If true, return the raw characters of the indexed term, regardless of if it is human readable

参数

value
true or false

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setTermsSort

Specifies how to sort the returned terms

说明

public SolrQuery SolrQuery::setTermsSort ( <span class="methodparam">int $sortType )

If SolrQuery::TERMS_SORT_COUNT, sorts the terms by the term frequency (highest count first). If SolrQuery::TERMS_SORT_INDEX, returns the terms in index order

参数

sortType
SolrQuery::TERMS_SORT_INDEX or SolrQuery::TERMS_SORT_COUNT

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setTermsUpperBound

Sets the term to stop at

说明

public SolrQuery SolrQuery::setTermsUpperBound ( <span class="methodparam">string $upperBound )

Sets the term to stop at

参数

upperBound
The term to stop at

返回值

Returns the current SolrQuery object, if the return value is used.

SolrQuery::setTimeAllowed

The time allowed for search to finish

说明

public SolrQuery SolrQuery::setTimeAllowed ( <span class="methodparam">int $timeAllowed )

The time allowed for a search to finish. This value only applies to the search and not to requests in general. Time is in milliseconds. Values less than or equal to zero implies no time restriction. Partial results may be returned, if there are any.

参数

timeAllowed
The time allowed for a search to finish.

返回值

Returns the current SolrQuery object, if the return value is used.

简介

类摘要

SolrDisMaxQuery

class SolrDisMaxQuery <span class="ooclass"> extends SolrQuery implements <span class="interfacename">Serializable {

/* 继承的属性 */

const int SolrQuery::ORDER_ASC = 0 ;

const int SolrQuery::ORDER_DESC = 1 ;

const int SolrQuery::FACET_SORT_INDEX = 0 ;

const int SolrQuery::FACET_SORT_COUNT = 1 ;

const int SolrQuery::TERMS_SORT_INDEX = 0 ;

const int SolrQuery::TERMS_SORT_COUNT = 1 ;

/* 方法 */

public <span class="type">SolrDisMaxQuery <span class="methodname">addBigramPhraseField ( <span class="methodparam">string $field , string $boost [, <span class="type">string $slop ] )

public <span class="type">SolrDisMaxQuery <span class="methodname">addBoostQuery ( <span class="methodparam">string $field , string $value [, <span class="type">string $boost ] )

public <span class="type">SolrDisMaxQuery <span class="methodname">addPhraseField ( <span class="methodparam">string $field , string $boost [, <span class="type">string $slop ] )

public <span class="type">SolrDisMaxQuery <span class="methodname">addQueryField ( <span class="methodparam">string $field [, string $boost ] )

public <span class="type">SolrDisMaxQuery <span class="methodname">addTrigramPhraseField ( <span class="methodparam">string $field , string $boost [, <span class="type">string $slop ] )

public <span class="type">SolrDisMaxQuery <span class="methodname">addUserField ( <span class="type">string $field )

public <span class="methodname">__construct ([ <span class="methodparam">string $q ] )

public <span class="type">SolrDisMaxQuery <span class="methodname">removeBigramPhraseField ( <span class="methodparam">string $field )

public <span class="type">SolrDisMaxQuery <span class="methodname">removeBoostQuery ( <span class="methodparam">string $field )

public <span class="type">SolrDisMaxQuery <span class="methodname">removePhraseField ( <span class="methodparam">string $field )

public <span class="type">SolrDisMaxQuery <span class="methodname">removeQueryField ( <span class="methodparam">string $field )

public <span class="type">SolrDisMaxQuery <span class="methodname">removeTrigramPhraseField ( <span class="methodparam">string $field )

public <span class="type">SolrDisMaxQuery <span class="methodname">removeUserField ( <span class="methodparam">string $field )

public <span class="type">SolrDisMaxQuery <span class="methodname">setBigramPhraseFields ( <span class="methodparam">string $fields )

public <span class="type">SolrDisMaxQuery <span class="methodname">setBigramPhraseSlop ( <span class="methodparam">string $slop )

public <span class="type">SolrDisMaxQuery <span class="methodname">setBoostFunction ( <span class="methodparam">string $function )

public <span class="type">SolrDisMaxQuery <span class="methodname">setBoostQuery ( <span class="methodparam">string $q )

public <span class="type">SolrDisMaxQuery <span class="methodname">setMinimumMatch ( <span class="methodparam">string $value )

public <span class="type">SolrDisMaxQuery <span class="methodname">setPhraseFields ( <span class="methodparam">string $fields )

public <span class="type">SolrDisMaxQuery <span class="methodname">setPhraseSlop ( <span class="methodparam">string $slop )

public <span class="type">SolrDisMaxQuery <span class="methodname">setQueryAlt ( <span class="type">string $q )

public <span class="type">SolrDisMaxQuery <span class="methodname">setQueryPhraseSlop ( <span class="methodparam">string $slop )

public <span class="type">SolrDisMaxQuery <span class="methodname">setTieBreaker ( <span class="methodparam">string $tieBreaker )

public <span class="type">SolrDisMaxQuery <span class="methodname">setTrigramPhraseFields ( <span class="methodparam">string $fields )

public <span class="type">SolrDisMaxQuery <span class="methodname">setTrigramPhraseSlop ( <span class="methodparam">string $slop )

public <span class="type">SolrDisMaxQuery <span class="methodname">setUserFields ( <span class="methodparam">string $fields )

public <span class="type">SolrDisMaxQuery <span class="methodname">useDisMaxQueryParser ( <span class="methodparam">void )

public <span class="type">SolrDisMaxQuery <span class="methodname">useEDisMaxQueryParser ( <span class="methodparam">void )

/* 继承的方法 */

public SolrQuery SolrQuery::addExpandFilterQuery ( <span class="methodparam">string $fq )

public SolrQuery SolrQuery::addExpandSortField ( <span class="methodparam">string $field [, string $order ] )

public SolrQuery SolrQuery::addFacetDateField ( <span class="methodparam">string $dateField )

public SolrQuery SolrQuery::addFacetDateOther ( <span class="methodparam">string $value [, string $field_override ] )

public SolrQuery SolrQuery::addFacetField ( <span class="methodparam">string $field )

public SolrQuery SolrQuery::addFacetQuery ( <span class="methodparam">string $facetQuery )

public SolrQuery SolrQuery::addField ( <span class="methodparam">string $field )

public SolrQuery SolrQuery::addFilterQuery ( <span class="methodparam">string $fq )

public SolrQuery SolrQuery::addGroupField ( <span class="methodparam">string $value )

public SolrQuery SolrQuery::addGroupFunction ( <span class="methodparam">string $value )

public SolrQuery SolrQuery::addGroupQuery ( <span class="methodparam">string $value )

public SolrQuery SolrQuery::addGroupSortField ( <span class="methodparam">string $field [, int $order ] )

public SolrQuery SolrQuery::addHighlightField ( <span class="methodparam">string $field )

public SolrQuery SolrQuery::addMltField ( <span class="methodparam">string $field )

public SolrQuery SolrQuery::addMltQueryField ( <span class="methodparam">string $field , float $boost )

public SolrQuery SolrQuery::addSortField ( <span class="methodparam">string $field [, int $order<span class="initializer"> = SolrQuery::ORDER_DESC ] )

public SolrQuery SolrQuery::addStatsFacet ( <span class="methodparam">string $field )

public SolrQuery SolrQuery::addStatsField ( <span class="methodparam">string $field )

public SolrQuery SolrQuery::collapse ( <span class="methodparam">SolrCollapseFunction $collapseFunction )

public <span class="methodname">SolrQuery::__construct ([ <span class="methodparam">string $q ] )

public void SolrQuery::__destruct ( <span class="methodparam">void )

public bool SolrQuery::getExpand ( <span class="methodparam">void )

public array SolrQuery::getExpandFilterQueries ( void )

public array SolrQuery::getExpandQuery ( <span class="methodparam">void )

public int <span class="methodname">SolrQuery::getExpandRows ( <span class="methodparam">void )

public array SolrQuery::getExpandSortFields ( <span class="methodparam">void )

public bool SolrQuery::getFacet ( <span class="methodparam">void )

public string SolrQuery::getFacetDateEnd ([ <span class="methodparam">string $field_override ] )

public array SolrQuery::getFacetDateFields ( <span class="methodparam">void )

public string SolrQuery::getFacetDateGap ([ <span class="methodparam">string $field_override ] )

public string SolrQuery::getFacetDateHardEnd ([ <span class="methodparam">string $field_override ] )

public array SolrQuery::getFacetDateOther ([ <span class="methodparam">string $field_override ] )

public string SolrQuery::getFacetDateStart ([ <span class="methodparam">string $field_override ] )

public array SolrQuery::getFacetFields ( <span class="methodparam">void )

public int <span class="methodname">SolrQuery::getFacetLimit ([ <span class="methodparam">string $field_override ] )

public string SolrQuery::getFacetMethod ([ <span class="methodparam">string $field_override ] )

public int <span class="methodname">SolrQuery::getFacetMinCount ([ <span class="methodparam">string $field_override ] )

public bool SolrQuery::getFacetMissing ([ <span class="methodparam">string $field_override ] )

public int <span class="methodname">SolrQuery::getFacetOffset ([ <span class="methodparam">string $field_override ] )

public string SolrQuery::getFacetPrefix ([ <span class="methodparam">string $field_override ] )

public array SolrQuery::getFacetQueries ( <span class="methodparam">void )

public int <span class="methodname">SolrQuery::getFacetSort ([ <span class="methodparam">string $field_override ] )

public array SolrQuery::getFields ( <span class="methodparam">void )

public array SolrQuery::getFilterQueries ( <span class="methodparam">void )

public bool SolrQuery::getGroup ( <span class="methodparam">void )

public int <span class="methodname">SolrQuery::getGroupCachePercent ( <span class="methodparam">void )

public bool SolrQuery::getGroupFacet ( <span class="methodparam">void )

public array SolrQuery::getGroupFields ( <span class="methodparam">void )

public string SolrQuery::getGroupFormat ( <span class="methodparam">void )

public array SolrQuery::getGroupFunctions ( <span class="methodparam">void )

public int <span class="methodname">SolrQuery::getGroupLimit ( <span class="methodparam">void )

public bool SolrQuery::getGroupMain ( <span class="methodparam">void )

public bool SolrQuery::getGroupNGroups ( <span class="methodparam">void )

public int <span class="methodname">SolrQuery::getGroupOffset ( <span class="methodparam">void )

public array SolrQuery::getGroupQueries ( <span class="methodparam">void )

public array SolrQuery::getGroupSortFields ( <span class="methodparam">void )

public bool SolrQuery::getGroupTruncate ( <span class="methodparam">void )

public bool SolrQuery::getHighlight ( <span class="methodparam">void )

public string SolrQuery::getHighlightAlternateField ([ string $field_override ] )

public array SolrQuery::getHighlightFields ( <span class="methodparam">void )

public string SolrQuery::getHighlightFormatter ([ string $field_override ] )

public string SolrQuery::getHighlightFragmenter ([ string $field_override ] )

public int <span class="methodname">SolrQuery::getHighlightFragsize ([ <span class="methodparam">string $field_override ] )

public bool <span class="methodname">SolrQuery::getHighlightHighlightMultiTerm ( void )

public int <span class="methodname">SolrQuery::getHighlightMaxAlternateFieldLength ([ string $field_override ] )

public int <span class="methodname">SolrQuery::getHighlightMaxAnalyzedChars ( void )

public bool SolrQuery::getHighlightMergeContiguous ([ string $field_override ] )

public int <span class="methodname">SolrQuery::getHighlightRegexMaxAnalyzedChars ( void )

public string SolrQuery::getHighlightRegexPattern ( void )

public float SolrQuery::getHighlightRegexSlop ( <span class="methodparam">void )

public bool SolrQuery::getHighlightRequireFieldMatch ( void )

public string SolrQuery::getHighlightSimplePost ([ string $field_override ] )

public string SolrQuery::getHighlightSimplePre ([ string $field_override ] )

public int <span class="methodname">SolrQuery::getHighlightSnippets ([ <span class="methodparam">string $field_override ] )

public bool <span class="methodname">SolrQuery::getHighlightUsePhraseHighlighter ( void )

public bool SolrQuery::getMlt ( <span class="methodparam">void )

public bool SolrQuery::getMltBoost ( <span class="methodparam">void )

public int <span class="methodname">SolrQuery::getMltCount ( <span class="methodparam">void )

public array SolrQuery::getMltFields ( <span class="methodparam">void )

public int <span class="methodname">SolrQuery::getMltMaxNumQueryTerms ( <span class="methodparam">void )

public int <span class="methodname">SolrQuery::getMltMaxNumTokens ( <span class="methodparam">void )

public int <span class="methodname">SolrQuery::getMltMaxWordLength ( <span class="methodparam">void )

public int <span class="methodname">SolrQuery::getMltMinDocFrequency ( <span class="methodparam">void )

public int <span class="methodname">SolrQuery::getMltMinTermFrequency ( <span class="methodparam">void )

public int <span class="methodname">SolrQuery::getMltMinWordLength ( <span class="methodparam">void )

public array SolrQuery::getMltQueryFields ( <span class="methodparam">void )

public string SolrQuery::getQuery ( <span class="methodparam">void )

public int <span class="methodname">SolrQuery::getRows ( <span class="methodparam">void )

public array SolrQuery::getSortFields ( <span class="methodparam">void )

public int <span class="methodname">SolrQuery::getStart ( <span class="methodparam">void )

public bool SolrQuery::getStats ( <span class="methodparam">void )

public array SolrQuery::getStatsFacets ( <span class="methodparam">void )

public array SolrQuery::getStatsFields ( <span class="methodparam">void )

public bool SolrQuery::getTerms ( <span class="methodparam">void )

public string SolrQuery::getTermsField ( <span class="methodparam">void )

public bool SolrQuery::getTermsIncludeLowerBound ( void )

public bool SolrQuery::getTermsIncludeUpperBound ( void )

public int <span class="methodname">SolrQuery::getTermsLimit ( <span class="methodparam">void )

public string SolrQuery::getTermsLowerBound ( <span class="methodparam">void )

public int <span class="methodname">SolrQuery::getTermsMaxCount ( <span class="methodparam">void )

public int <span class="methodname">SolrQuery::getTermsMinCount ( <span class="methodparam">void )

public string SolrQuery::getTermsPrefix ( <span class="methodparam">void )

public bool SolrQuery::getTermsReturnRaw ( <span class="methodparam">void )

public int <span class="methodname">SolrQuery::getTermsSort ( <span class="methodparam">void )

public string SolrQuery::getTermsUpperBound ( <span class="methodparam">void )

public int <span class="methodname">SolrQuery::getTimeAllowed ( <span class="methodparam">void )

public SolrQuery SolrQuery::removeExpandFilterQuery ( string $fq )

public SolrQuery SolrQuery::removeExpandSortField ( <span class="methodparam">string $field )

public SolrQuery SolrQuery::removeFacetDateField ( <span class="methodparam">string $field )

public SolrQuery SolrQuery::removeFacetDateOther ( <span class="methodparam">string $value [, string $field_override ] )

public SolrQuery SolrQuery::removeFacetField ( <span class="methodparam">string $field )

public SolrQuery SolrQuery::removeFacetQuery ( <span class="methodparam">string $value )

public SolrQuery SolrQuery::removeField ( <span class="methodparam">string $field )

public SolrQuery SolrQuery::removeFilterQuery ( <span class="methodparam">string $fq )

public SolrQuery SolrQuery::removeHighlightField ( <span class="methodparam">string $field )

public SolrQuery SolrQuery::removeMltField ( <span class="methodparam">string $field )

public SolrQuery SolrQuery::removeMltQueryField ( <span class="methodparam">string $queryField )

public SolrQuery SolrQuery::removeSortField ( <span class="methodparam">string $field )

public SolrQuery SolrQuery::removeStatsFacet ( <span class="methodparam">string $value )

public SolrQuery SolrQuery::removeStatsField ( <span class="methodparam">string $field )

public SolrQuery SolrQuery::setEchoHandler ( <span class="methodparam">bool $flag )

public SolrQuery SolrQuery::setEchoParams ( <span class="methodparam">string $type )

public SolrQuery SolrQuery::setExpand ( <span class="methodparam">bool $value )

public SolrQuery SolrQuery::setExpandQuery ( <span class="methodparam">string $q )

public SolrQuery SolrQuery::setExpandRows ( <span class="methodparam">int $value )

public SolrQuery SolrQuery::setExplainOther ( <span class="methodparam">string $query )

public SolrQuery SolrQuery::setFacet ( <span class="methodparam">bool $flag )

public SolrQuery SolrQuery::setFacetDateEnd ( <span class="methodparam">string $value [, string $field_override ] )

public SolrQuery SolrQuery::setFacetDateGap ( <span class="methodparam">string $value [, string $field_override ] )

public SolrQuery SolrQuery::setFacetDateHardEnd ( <span class="methodparam">bool $value [, string $field_override ] )

public SolrQuery SolrQuery::setFacetDateStart ( <span class="methodparam">string $value [, string $field_override ] )

public SolrQuery <span class="methodname">SolrQuery::setFacetEnumCacheMinDefaultFrequency ( int $frequency [, <span class="type">string $field_override ] )

public SolrQuery SolrQuery::setFacetLimit ( <span class="methodparam">int $limit [, string $field_override ] )

public SolrQuery SolrQuery::setFacetMethod ( <span class="methodparam">string $method [, string $field_override ] )

public SolrQuery SolrQuery::setFacetMinCount ( <span class="methodparam">int $mincount [, string $field_override ] )

public SolrQuery SolrQuery::setFacetMissing ( <span class="methodparam">bool $flag [, string $field_override ] )

public SolrQuery SolrQuery::setFacetOffset ( <span class="methodparam">int $offset [, string $field_override ] )

public SolrQuery SolrQuery::setFacetPrefix ( <span class="methodparam">string $prefix [, string $field_override ] )

public SolrQuery SolrQuery::setFacetSort ( <span class="methodparam">int $facetSort [, string $field_override ] )

public SolrQuery SolrQuery::setGroup ( <span class="methodparam">bool $value )

public SolrQuery SolrQuery::setGroupCachePercent ( <span class="methodparam">int $percent )

public SolrQuery SolrQuery::setGroupFacet ( <span class="methodparam">bool $value )

public SolrQuery SolrQuery::setGroupFormat ( <span class="methodparam">string $value )

public SolrQuery SolrQuery::setGroupLimit ( <span class="methodparam">int $value )

public SolrQuery SolrQuery::setGroupMain ( <span class="methodparam">string $value )

public SolrQuery SolrQuery::setGroupNGroups ( <span class="methodparam">bool $value )

public SolrQuery SolrQuery::setGroupOffset ( <span class="methodparam">int $value )

public SolrQuery SolrQuery::setGroupTruncate ( <span class="methodparam">bool $value )

public SolrQuery SolrQuery::setHighlight ( <span class="methodparam">bool $flag )

public SolrQuery SolrQuery::setHighlightAlternateField ( string $field [, <span class="type">string $field_override ] )

public SolrQuery SolrQuery::setHighlightFormatter ( <span class="methodparam">string $formatter [, string $field_override ] )

public SolrQuery SolrQuery::setHighlightFragmenter ( string $fragmenter [, <span class="type">string $field_override ] )

public SolrQuery SolrQuery::setHighlightFragsize ( <span class="methodparam">int $size [, string $field_override ] )

public SolrQuery <span class="methodname">SolrQuery::setHighlightHighlightMultiTerm ( bool $flag )

public SolrQuery <span class="methodname">SolrQuery::setHighlightMaxAlternateFieldLength ( int $fieldLength [, <span class="type">string $field_override ] )

public SolrQuery SolrQuery::setHighlightMaxAnalyzedChars ( int $value )

public SolrQuery SolrQuery::setHighlightMergeContiguous ( bool $flag [, string $field_override ] )

public SolrQuery <span class="methodname">SolrQuery::setHighlightRegexMaxAnalyzedChars ( int $maxAnalyzedChars )

public SolrQuery SolrQuery::setHighlightRegexPattern ( string $value )

public SolrQuery SolrQuery::setHighlightRegexSlop ( <span class="methodparam">float $factor )

public SolrQuery SolrQuery::setHighlightRequireFieldMatch ( bool $flag )

public SolrQuery SolrQuery::setHighlightSimplePost ( string $simplePost [, <span class="type">string $field_override ] )

public SolrQuery SolrQuery::setHighlightSimplePre ( <span class="methodparam">string $simplePre [, string $field_override ] )

public SolrQuery SolrQuery::setHighlightSnippets ( <span class="methodparam">int $value [, string $field_override ] )

public SolrQuery <span class="methodname">SolrQuery::setHighlightUsePhraseHighlighter ( bool $flag )

public SolrQuery SolrQuery::setMlt ( <span class="methodparam">bool $flag )

public SolrQuery SolrQuery::setMltBoost ( <span class="methodparam">bool $flag )

public SolrQuery SolrQuery::setMltCount ( <span class="methodparam">int $count )

public SolrQuery SolrQuery::setMltMaxNumQueryTerms ( int $value )

public SolrQuery SolrQuery::setMltMaxNumTokens ( <span class="methodparam">int $value )

public SolrQuery SolrQuery::setMltMaxWordLength ( <span class="methodparam">int $maxWordLength )

public SolrQuery SolrQuery::setMltMinDocFrequency ( <span class="methodparam">int $minDocFrequency )

public SolrQuery SolrQuery::setMltMinTermFrequency ( int $minTermFrequency )

public SolrQuery SolrQuery::setMltMinWordLength ( <span class="methodparam">int $minWordLength )

public SolrQuery SolrQuery::setOmitHeader ( <span class="methodparam">bool $flag )

public SolrQuery SolrQuery::setQuery ( <span class="methodparam">string $query )

public SolrQuery SolrQuery::setRows ( <span class="methodparam">int $rows )

public SolrQuery SolrQuery::setShowDebugInfo ( <span class="methodparam">bool $flag )

public SolrQuery SolrQuery::setStart ( <span class="methodparam">int $start )

public SolrQuery SolrQuery::setStats ( <span class="methodparam">bool $flag )

public SolrQuery SolrQuery::setTerms ( <span class="methodparam">bool $flag )

public SolrQuery SolrQuery::setTermsField ( <span class="methodparam">string $fieldname )

public SolrQuery SolrQuery::setTermsIncludeLowerBound ( bool $flag )

public SolrQuery SolrQuery::setTermsIncludeUpperBound ( bool $flag )

public SolrQuery SolrQuery::setTermsLimit ( <span class="methodparam">int $limit )

public SolrQuery SolrQuery::setTermsLowerBound ( <span class="methodparam">string $lowerBound )

public SolrQuery SolrQuery::setTermsMaxCount ( <span class="methodparam">int $frequency )

public SolrQuery SolrQuery::setTermsMinCount ( <span class="methodparam">int $frequency )

public SolrQuery SolrQuery::setTermsPrefix ( <span class="methodparam">string $prefix )

public SolrQuery SolrQuery::setTermsReturnRaw ( <span class="methodparam">bool $flag )

public SolrQuery SolrQuery::setTermsSort ( <span class="methodparam">int $sortType )

public SolrQuery SolrQuery::setTermsUpperBound ( <span class="methodparam">string $upperBound )

public SolrQuery SolrQuery::setTimeAllowed ( <span class="methodparam">int $timeAllowed )

}

预定义常量

SolrDisMaxQuery::ORDER_ASC
Used to specify that the sorting should be in acending order (Duplicated for easier migration)

SolrDisMaxQuery::ORDER_DESC
Used to specify that the sorting should be in descending order (Duplicated for easier migration)

SolrDisMaxQuery::FACET_SORT_INDEX
Used to specify that the facet should sort by index (Duplicated for easier migration)

SolrDisMaxQuery::FACET_SORT_COUNT
Used to specify that the facet should sort by count (Duplicated for easier migration)

SolrDisMaxQuery::TERMS_SORT_INDEX
Used in the TermsComponent (Duplicated for easier migration)

SolrDisMaxQuery::TERMS_SORT_COUNT
Used in the TermsComponent (Duplicated for easier migration)

SolrDisMaxQuery::addBigramPhraseField

Adds a Phrase Bigram Field (pf2 parameter)

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::addBigramPhraseField ( <span class="methodparam">string $field , string $boost [, <span class="type">string $slop ] )

Adds a Phrase Bigram Field (pf2 parameter) output format: field~slop^boost OR field^boost Slop is optional

参数

field

boost

slop

返回值

SolrDisMaxQuery

范例

示例 #1 <span class="function">SolrDisMaxQuery::addBigramPhraseField example

<?php

$dismaxQuery = new SolrDisMaxQuery("lucene");
$dismaxQuery
    ->addBigramPhraseField('cat', 2, 5.1)
    ->addBigramPhraseField('feature', 4.5)
;
echo $dismaxQuery;

?>

以上例程的输出类似于:

q=lucene&defType=edismax&pf2=cat~5.1^2 feature^4.5

参见

  • <span class="methodname">SolrDisMaxQuery::removeBigramPhraseField
  • <span class="methodname">SolrDisMaxQuery::setBigramPhraseFields
  • SolrDisMaxQuery::setBigramPhraseSlop

SolrDisMaxQuery::addBoostQuery

Adds a boost query field with value and optional boost (bq parameter)

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::addBoostQuery ( <span class="methodparam">string $field , string $value [, <span class="type">string $boost ] )

Adds a Boost Query field with value [and boost] (bq parameter)

参数

field

value

boost

返回值

SolrDisMaxQuery

范例

示例 #1 SolrDisMaxQuery::addBoostQuery example

<?php

$dismaxQuery = new SolrDisMaxQuery("lucene");
$dismaxQuery
    ->addBoostQuery('cat', 'clothing', 2)
    ->addBoostQuery('cat', 'electronics', 5.1)
;
echo $dismaxQuery.PHP_EOL;
?>

以上例程的输出类似于:

q=lucene&defType=edismax&bq=cat:clothing^2 cat:electronics^5.1

参见

  • SolrDisMaxQuery::removeBoostQuery
  • SolrDisMaxQuery::setBoostQuery

SolrDisMaxQuery::addPhraseField

Adds a Phrase Field (pf parameter)

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::addPhraseField ( <span class="methodparam">string $field , string $boost [, <span class="type">string $slop ] )

Adds a Phrase Field (pf parameter)

参数

field
field name

boost

slop

返回值

SolrDisMaxQuery

范例

示例 #1 SolrDisMaxQuery::addPhraseField example

<?php
$dismaxQuery = new SolrDisMaxQuery("lucene");
$dismaxQuery
    ->addPhraseField('cat', 3, 1)
    ->addPhraseField('third', 4, 2)
    ->addPhraseField('source', 55)
;
echo $dismaxQuery;
?>

以上例程的输出类似于:

q=lucene&defType=edismax&pf=cat~1^3 third~2^4 source^55

参见

  • SolrDisMaxQuery::removePhraseField
  • SolrDisMaxQuery::setPhraseFields

SolrDisMaxQuery::addQueryField

Add a query field with optional boost (qf parameter)

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::addQueryField ( <span class="methodparam">string $field [, string $boost ] )

Add a query field with optional boost (qf parameter)

参数

field
field name

boost
Boost value. Boosts documents with matching terms.

返回值

SolrDisMaxQuery

范例

示例 #1 SolrDisMaxQuery::addQueryField example

<?php

$dismaxQuery = new SolrDisMaxQuery("lucene");
$dismaxQuery
    ->addQueryField("location", 4)
    ->addQueryField("price")
    ->addQueryField("sku")
    ->addQueryField("title",3.4)
;
echo $dismaxQuery;

?>

以上例程的输出类似于:

q=lucene&defType=edismax&qf=location^4 price sku title^3.4

参见

  • SolrDisMaxQuery::removeQueryField

SolrDisMaxQuery::addTrigramPhraseField

Adds a Trigram Phrase Field (pf3 parameter)

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::addTrigramPhraseField ( <span class="methodparam">string $field , string $boost [, <span class="type">string $slop ] )

Adds a Trigram Phrase Field (pf3 parameter)

参数

field
Field Name

boost
Field Boost

slop
Field Slop

返回值

SolrDisMaxQuery

范例

示例 #1 <span class="function">SolrDisMaxQuery::addTrigramPhraseField example

<?php

$dismaxQuery = new SolrDisMaxQuery('lucene');
$dismaxQuery
->addTrigramPhraseField('cat', 2, 5.1)
->addTrigramPhraseField('feature', 4.5)
;
echo $dismaxQuery.PHP_EOL;

?>

以上例程会输出:

q=lucene&defType=%s&pf3=cat~5.1^2 feature^4.5

参见

  • <span class="methodname">SolrDisMaxQuery::removeTrigramPhraseField
  • <span class="methodname">SolrDisMaxQuery::setTrigramPhraseFields
  • <span class="methodname">SolrDisMaxQuery::setTrigramPhraseSlop

SolrDisMaxQuery::addUserField

Adds a field to User Fields Parameter (uf)

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::addUserField ( <span class="methodparam">string $field )

Adds a field to The User Fields Parameter (uf)

参数

field
Field Name

返回值

SolrDisMaxQuery

范例

示例 #1 SolrDisMaxQuery::addUserField example

<?php

$dismaxQuery = new SolrDisMaxQuery('lucene');
$dismaxQuery
->addUserField('cat')
->addUserField('text')
->addUserField('*_dt');

echo $dismaxQuery.PHP_EOL;

?>

以上例程的输出类似于:

q=lucene&defType=edismax&uf=cat text *_dt

参见

  • SolrDisMaxQuery::removeUserField
  • SolrDisMaxQuery::setUserFields

SolrDisMaxQuery::__construct

Class Constructor

说明

public <span class="methodname">SolrDisMaxQuery::__construct ([ <span class="methodparam">string $q ] )

Class constructor initializes the object and sets the q parameter if passed

参数

q
Search Query (q parameter)

返回值

错误/异常

Emits SolrIllegalArgumentException in case of an invalid parameter was passed.

范例

示例 #1 SolrDisMaxQuery::__construct example

<?php

$dismaxQuery = new SolrDisMaxQuery('lucene');
echo $dismaxQuery;

?>

以上例程会输出:

q=lucene&defType=edismax

参见

SolrDisMaxQuery::removeBigramPhraseField

Removes phrase bigram field (pf2 parameter)

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::removeBigramPhraseField ( string $field )

Removes a Bigram Phrase Field (pf2 parameter) that was previously added using <span class="methodname">SolrDisMaxQuery::addBigramPhraseField

参数

field
The Field Name

返回值

SolrDisMaxQuery

范例

示例 #1 <span class="function">SolrDisMaxQuery::removeBigramPhraseField example

<?php

$dismaxQuery = new SolrDisMaxQuery("lucene");
$dismaxQuery
    ->addBigramPhraseField('cat', 2, 5.1)
    ->addBigramPhraseField('feature', 4.5)
;
echo $dismaxQuery.PHP_EOL;

// remove cat from pf2
$dismaxQuery
    ->removeBigramPhraseField('cat');
echo $dismaxQuery.PHP_EOL;

?>

以上例程的输出类似于:

q=lucene&defType=edismax&pf2=cat~5.1^2 feature^4.5
q=lucene&defType=edismax&pf2=feature^4.5

参见

  • <span class="methodname">SolrDisMaxQuery::addBigramPhraseField
  • <span class="methodname">SolrDisMaxQuery::setBigramPhraseFields
  • SolrDisMaxQuery::setBigramPhraseSlop

SolrDisMaxQuery::removeBoostQuery

Removes a boost query partial by field name (bq)

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::removeBoostQuery ( <span class="methodparam">string $field )

Removes a boost query partial from the existing query, only if <span class="methodname">SolrDisMaxQuery::addBoostQuery was used.

参数

field
Field Name

返回值

SolrDisMaxQuery

范例

示例 #1 <span class="function">SolrDisMaxQuery::removeBoostQuery example

<?php

$dismaxQuery = new SolrDisMaxQuery("lucene");
$dismaxQuery
    ->addBoostQuery('cat', 'electronics', 5.1)
    ->addBoostQuery('cat', 'hard drive')
;
echo $dismaxQuery.PHP_EOL;
// now remove a query part with field 'cat'
$dismaxQuery
->removeBoostQuery('cat');
echo $dismaxQuery . PHP_EOL;

?>

以上例程的输出类似于:

q=lucene&defType=edismax&bq=cat:electronics^5.1 cat:hard drive
q=lucene&defType=edismax&bq=cat:hard drive

参见

  • SolrDisMaxQuery::addBoostQuery
  • SolrDisMaxQuery::setBoostQuery

SolrDisMaxQuery::removePhraseField

Removes a Phrase Field (pf parameter)

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::removePhraseField ( <span class="methodparam">string $field )

Removes a Phrase Field (pf parameter) that was previously added using SolrDisMaxQuery::addPhraseField

参数

field
Field Name

返回值

SolrDisMaxQuery

范例

示例 #1 <span class="function">SolrDisMaxQuery::removePhraseField example

<?php
$dismaxQuery = new SolrDisMaxQuery('lucene');
$dismaxQuery
    ->addPhraseField('first', 3, 1)
    ->addPhraseField('second', 4, 1)
    ->addPhraseField('cat', 55);
echo $dismaxQuery . PHP_EOL;
echo $dismaxQuery->removePhraseField('second');
?>

以上例程的输出类似于:

q=lucene&defType=edismax&pf=first~1^3 second~1^4 cat^55
q=lucene&defType=edismax&pf=first~1^3 cat^55

参见

  • SolrDisMaxQuery::addPhraseField
  • SolrDisMaxQuery::setPhraseFields

SolrDisMaxQuery::removeQueryField

Removes a Query Field (qf parameter)

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::removeQueryField ( <span class="methodparam">string $field )

Removes a Query Field (qf parameter) from the field list added by <span class="methodname">SolrDisMaxQuery::addQueryField

qf: When building DisjunctionMaxQueries from the user's query it specifies the fields to search in, and boosts for those fields.

参数

field
Field Name

返回值

SolrDisMaxQuery

范例

示例 #1 <span class="function">SolrDisMaxQuery::removeQueryField example

<?php

$dismaxQuery = new SolrDisMaxQuery('lucene');
$dismaxQuery
    ->addQueryField('first', 3)
    ->addQueryField('second', 0.2)
    ->addQueryField('cat');
echo $dismaxQuery . PHP_EOL;
// remove field 'second'
echo $dismaxQuery->removeQueryField('second');
?>

以上例程的输出类似于:

q=lucene&defType=edismax&qf=first^3 second^0.2 cat
q=lucene&defType=edismax&qf=first^3 cat

参见

  • SolrDisMaxQuery::addQueryField

SolrDisMaxQuery::removeTrigramPhraseField

Removes a Trigram Phrase Field (pf3 parameter)

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::removeTrigramPhraseField ( string $field )

Removes a Trigram Phrase Field (pf3 parameter)

参数

field
Field Name

返回值

SolrDisMaxQuery

范例

示例 #1 <span class="function">SolrDisMaxQuery::removeTrigramPhraseField example

<?php

$dismaxQuery = new SolrDisMaxQuery('lucene');
$dismaxQuery
->addTrigramPhraseField('cat', 2, 5.1)
->addTrigramPhraseField('feature', 4.5)
;
echo $dismaxQuery.PHP_EOL;
// reverse
$dismaxQuery
->removeTrigramPhraseField('cat');
echo $dismaxQuery.PHP_EOL;

?>

以上例程会输出:

q=lucene&defType=%s&pf3=cat~5.1^2 feature^4.5
q=lucene&defType=%s&pf3=feature^4.5

参见

  • <span class="methodname">SolrDisMaxQuery::addTrigramPhraseField
  • <span class="methodname">SolrDisMaxQuery::setTrigramPhraseFields
  • <span class="methodname">SolrDisMaxQuery::setTrigramPhraseSlop

SolrDisMaxQuery::removeUserField

Removes a field from The User Fields Parameter (uf)

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::removeUserField ( <span class="methodparam">string $field )

Removes a field from The User Fields Parameter (uf)

Warning

本函数还未编写文档,仅有参数列表。

参数

field
Field Name

返回值

SolrDisMaxQuery

范例

示例 #1 <span class="function">SolrDisMaxQuery::removeUserField example

<?php

$dismaxQuery = new SolrDisMaxQuery('lucene');
$dismaxQuery
->addUserField('cat')
->addUserField('text')
->addUserField('*_dt')
;
echo $dismaxQuery.PHP_EOL;

// remove field named 'text'
$dismaxQuery
->removeUserField('text');
echo $dismaxQuery.PHP_EOL;

?>

以上例程的输出类似于:

q=lucene&defType=%s&uf=cat text *_dt
q=lucene&defType=%s&uf=cat *_dt

参见

  • SolrDisMaxQuery::addUserField
  • SolrDisMaxQuery::setUserFields

SolrDisMaxQuery::setBigramPhraseFields

Sets Bigram Phrase Fields and their boosts (and slops) using pf2 parameter

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::setBigramPhraseFields ( <span class="methodparam">string $fields )

Sets Bigram Phrase Fields (pf2) and their boosts (and slops)

参数

fields
Fields boosts (slops)

返回值

SolrDisMaxQuery

范例

示例 #1 <span class="function">SolrDisMaxQuery::setBigramPhraseFields example

<?php
$dismaxQuery = new SolrDisMaxQuery("lucene");
$dismaxQuery->setBigramPhraseFields("cat~5.1^2 feature^4.5");
echo $dismaxQuery.PHP_EOL;

?>

以上例程的输出类似于:

q=lucene&defType=edismax&pf2=cat~5.1^2 feature^4.5

参见

  • SolrDisMaxQuery::setBigramPhraseSlop
  • <span class="methodname">SolrDisMaxQuery::addBigramPhraseFields
  • <span class="methodname">SolrDisMaxQuery::removeBigramPhraseField
  • <span class="methodname">SolrDisMaxQuery::setTrigramPhraseFields

SolrDisMaxQuery::setBigramPhraseSlop

Sets Bigram Phrase Slop (ps2 parameter)

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::setBigramPhraseSlop ( <span class="methodparam">string $slop )

Sets Bigram Phrase Slop (ps2 parameter). A default slop for Bigram phrase fields.

参数

slop

返回值

SolrDisMaxQuery

范例

示例 #1 <span class="function">SolrDisMaxQuery::setBigramPhraseSlop example

<?php

$dismaxQuery = new SolrDisMaxQuery('lucene');

$dismaxQuery->setBigramPhraseSlop(5);
echo $dismaxQuery.PHP_EOL;

?>

以上例程的输出类似于:

q=lucene&defType=edismax&ps2=5

参见

SolrDisMaxQuery::setBoostFunction

Sets a Boost Function (bf parameter)

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::setBoostFunction ( <span class="methodparam">string $function )

Sets Boost Function (bf parameter).

Functions (with optional boosts) that will be included in the user's query to influence the score. Any function supported natively by Solr can be used, along with a boost value. e.g.:

recip(rord(myfield),1,2,3)^1.5

参数

function

返回值

SolrDisMaxQuery

范例

示例 #1 <span class="function">SolrDisMaxQuery::setBoostFunction example

<?php

$dismaxQuery = new SolrDisMaxQuery('lucene');

$boostRecentDocsFunction = "recip(ms(NOW,mydatefield),3.16e-11,1,1)";
$dismaxQuery->setBoostFunction($boostRecentDocsFunction);

echo $dismaxQuery.PHP_EOL;

?>

以上例程的输出类似于:

q=lucene&defType=edismax&bf=recip(ms(NOW,mydatefield),3.16e-11,1,1)

参见

SolrDisMaxQuery::setBoostQuery

Directly Sets Boost Query Parameter (bq)

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::setBoostQuery ( <span class="methodparam">string $q )

Sets Boost Query Parameter (bq)

参数

q
query

返回值

SolrDisMaxQuery

范例

示例 #1 SolrDisMaxQuery::setBoostQuery example

<?php
$dismaxQuery = new SolrDisMaxQuery("lucene");

$dismaxQuery->setBoostQuery('cat:electronics manu:local^2');
echo $dismaxQuery.PHP_EOL;
?>

以上例程的输出类似于:

q=lucene&defType=edismax&bq=cat:electronics manu:local^2

参见

  • SolrDisMaxQuery::addBoostQuery
  • SolrDisMaxQuery::removeBoostQuery

SolrDisMaxQuery::setMinimumMatch

Set Minimum "Should" Match (mm)

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::setMinimumMatch ( <span class="methodparam">string $value )

Set Minimum "Should" Match parameter (mm). If the default query operator is AND then mm=100%, if the default query operator (q.op) is OR, then mm=0%.

参数

value
Minimum match value/expression

返回值

SolrDisMaxQuery

范例

示例 #1 <span class="function">SolrDisMaxQuery::setMinimumMatch example

<?php

$dismaxQuery = new SolrDisMaxQuery("lucene");
// 75% of the query clauses must match
$dismaxQuery->setMinimumMatch("75%");
echo $dismaxQuery . PHP_EOL;

?>

以上例程会输出:

q=lucene&defType=edismax&mm=75%

SolrDisMaxQuery::setPhraseFields

Sets Phrase Fields and their boosts (and slops) using pf2 parameter

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::setPhraseFields ( <span class="methodparam">string $fields )

Sets Phrase Fields (pf) and their boosts (and slops)

参数

fields
Fields, boosts [, slops]

返回值

SolrDisMaxQuery

范例

示例 #1 <span class="function">SolrDisMaxQuery::setPhraseFields example

<?php
$dismaxQuery = new SolrDisMaxQuery("lucene");
$dismaxQuery->setPhraseFields("cat~5.1^2 feature^4.5");
echo $dismaxQuery.PHP_EOL;

?>

以上例程的输出类似于:

q=lucene&defType=edismax&pf=cat~5.1^2 feature^4.5

参见

  • SolrDisMaxQuery::addPhraseFields
  • SolrDisMaxQuery::removePhraseField

SolrDisMaxQuery::setPhraseSlop

Sets the default slop on phrase queries (ps parameter)

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::setPhraseSlop ( <span class="methodparam">string $slop )

Sets the default amount of slop on phrase queries built with "pf", "pf2" and/or "pf3" fields (affects boosting). "ps" parameter

参数

slop

返回值

SolrDisMaxQuery

范例

示例 #1 SolrDisMaxQuery::setPhraseSlop example

<?php

$dismaxQuery = new SolrDisMaxQuery('lucene');

$dismaxQuery->setPhraseSlop(4);
echo $dismaxQuery.PHP_EOL;

?>

以上例程会输出:

q=lucene&defType=edismax&ps=4

参见

SolrDisMaxQuery::setQueryAlt

Set Query Alternate (q.alt parameter)

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::setQueryAlt ( <span class="methodparam">string $q )

Set Query Alternate (q.alt parameter)

When the main q parameter is not specified or is blank. The q.alt parameter is used

参数

q
Query String

返回值

SolrDisMaxQuery

范例

示例 #1 SolrDisMaxQuery::setQueryAlt example

<?php

$dismaxQuery = new DisMaxQuery();
$dismaxQuery->setQueryAlt('*:*');

?>

以上例程的输出类似于:

defType=edismax&q.alt=*:*&q=

SolrDisMaxQuery::setQueryPhraseSlop

Specifies the amount of slop permitted on phrase queries explicitly included in the user's query string (qf parameter)

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::setQueryPhraseSlop ( <span class="methodparam">string $slop )

The Query Phrase Slop is the amount of slop permitted on phrase queries explicitly included in the user's query string with the qf parameter.

slop refers to the number of positions one token needs to be moved in relation to another token in order to match a phrase specified in a query.

参数

slop
Amount of slop

返回值

SolrDisMaxQuery

范例

示例 #1 <span class="function">SolrDisMaxQuery::setQueryPhraseSlop example

<?php

$dismaxQuery = new SolrDisMaxQuery();
$dismaxQuery->setQueryPhraseSlop(3);
echo $dismaxQuery;
?>

以上例程的输出类似于:

defType=edismax&qs=3

SolrDisMaxQuery::setTieBreaker

Sets Tie Breaker parameter (tie parameter)

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::setTieBreaker ( <span class="methodparam">string $tieBreaker )

Sets Tie Breaker parameter (tie parameter)

参数

tieBreaker
The tie parameter specifies a float value (which should be something much less than 1) to use as tiebreaker in DisMax queries.

返回值

SolrDisMaxQuery

范例

示例 #1 SolrDisMaxQuery::setTieBreaker example

<?php

$dismaxQuery = new SolrDisMaxQuery();
$dismaxQuery->setTieBreaker(0.1);

echo $dismaxQuery;

?>

以上例程会输出:

defType=edismax&tie=0.1

SolrDisMaxQuery::setTrigramPhraseFields

Directly Sets Trigram Phrase Fields (pf3 parameter)

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::setTrigramPhraseFields ( string $fields )

Directly Sets Trigram Phrase Fields (pf3 parameter)

参数

fields
Trigram Phrase Fields

返回值

SolrDisMaxQuery

范例

示例 #1 <span class="function">SolrDisMaxQuery::setTrigramPhraseFields example

<?php

$dismaxQuery = new SolrDisMaxQuery('lucene');
$dismaxQuery->setTrigramPhraseFields('cat~5.1^2 feature^4.5');
echo $dismaxQuery.PHP_EOL;

?>

以上例程会输出:

q=lucene&defType=edismax&pf3=cat~5.1^2 feature^4.5

参见

  • <span class="methodname">SolrDisMaxQuery::addTrigramPhraseField
  • <span class="methodname">SolrDisMaxQuery::removeTrigramPhraseField
  • <span class="methodname">SolrDisMaxQuery::setTrigramPhraseSlop

SolrDisMaxQuery::setTrigramPhraseSlop

Sets Trigram Phrase Slop (ps3 parameter)

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::setTrigramPhraseSlop ( <span class="methodparam">string $slop )

Sets Trigram Phrase Slop (ps3 parameter)

参数

slop
Phrase slop

返回值

SolrDisMaxQuery

范例

示例 #1 <span class="function">SolrDisMaxQuery::setTrigramPhraseSlop example

<?php

$dismaxQuery = new SolrDisMaxQuery('lucene');
$dismaxQuery->setTrigramPhraseSlop(2);
echo $dismaxQuery.PHP_EOL;

?>

以上例程的输出类似于:

q=lucene&defType=edismax&ps3=2

参见

  • <span class="methodname">SolrDisMaxQuery::addTrigramPhraseField
  • <span class="methodname">SolrDisMaxQuery::removeTrigramPhraseField
  • <span class="methodname">SolrDisMaxQuery::setTrigramPhraseFields

SolrDisMaxQuery::setUserFields

Sets User Fields parameter (uf)

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::setUserFields ( <span class="methodparam">string $fields )

Sets User Fields parameter (uf)

User Fields: Specifies which schema fields the end user shall be allowed to query.

参数

fields
Fields names separated by space

This parameter supports wildcards.

返回值

SolrDisMaxQuery

范例

示例 #1 SolrDisMaxQuery::setUserFields example

<?php

$dismaxQuery = new SolrDisMaxQuery('lucene');
$dismaxQuery->setUserFields('field1 field2 *_txt');
echo $dismaxQuery.PHP_EOL;

?>

以上例程的输出类似于:

q=lucene&defType=edismax&uf=field1 field2 *_txt

参见

  • SolrDisMaxQuery::addUserField
  • SolrDisMaxQuery::removeUserField

SolrDisMaxQuery::useDisMaxQueryParser

Switch QueryParser to be DisMax Query Parser

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::useDisMaxQueryParser ( <span class="methodparam">void )

Switch QueryParser to be DisMax Query Parser

参数

此函数没有参数。

返回值

SolrDisMaxQuery

范例

示例 #1 <span class="function">SolrDisMaxQuery::useDisMaxQueryParser example

<?php

$dismaxQuery = new SolrDisMaxQuery();
$dismaxQuery->useDisMaxQueryParser();
echo $dismaxQuery;
?>

以上例程的输出类似于:

defType=dismax

参见

  • <span class="methodname">SolrDisMaxQuery::useDisMaxQueryParser

SolrDisMaxQuery::useEDisMaxQueryParser

Switch QueryParser to be EDisMax

说明

public <span class="type">SolrDisMaxQuery <span class="methodname">SolrDisMaxQuery::useEDisMaxQueryParser ( <span class="methodparam">void )

Switch QueryParser to be EDisMax. By default the query builder uses edismax, if it was switched using <span class="methodname">SolrDisMaxQuery::useDisMaxQueryParser, it can be switched back using this method.

参数

此函数没有参数。

返回值

SolrDisMaxQuery

范例

示例 #1 <span class="function">SolrDisMaxQuery::useEDisMaxQueryParser example

<?php

$dismaxQuery = new SolrDisMaxQuery();
$dismaxQuery->useEDisMaxQueryParser();
echo $dismaxQuery;

?>

以上例程的输出类似于:

defType=edismax

参见

简介

类摘要

SolrCollapseFunction

class SolrCollapseFunction {

/* Constants */

const string SolrCollapseFunction::NULLPOLICY_IGNORE = ignore ;

const string SolrCollapseFunction::NULLPOLICY_EXPAND = expand ;

const string SolrCollapseFunction::NULLPOLICY_COLLAPSE = collapse ;

/* 方法 */

public <span class="methodname">__construct ([ <span class="methodparam">string $field ] )

public string getField ( <span class="methodparam">void )

public string getHint ( <span class="methodparam">void )

public string getMax ( <span class="methodparam">void )

public string getMin ( <span class="methodparam">void )

public string getNullPolicy ( <span class="methodparam">void )

public int <span class="methodname">getSize ( <span class="methodparam">void )

public <span class="type">SolrCollapseFunction <span class="methodname">setField ( <span class="type">string $fieldName )

public <span class="type">SolrCollapseFunction <span class="methodname">setHint ( <span class="type">string $hint )

public <span class="type">SolrCollapseFunction <span class="methodname">setMax ( <span class="type">string $max )

public <span class="type">SolrCollapseFunction <span class="methodname">setMin ( <span class="type">string $min )

public <span class="type">SolrCollapseFunction <span class="methodname">setNullPolicy ( <span class="methodparam">string $nullPolicy )

public <span class="type">SolrCollapseFunction <span class="methodname">setSize ( <span class="type">int $size )

public string __toString ( <span class="methodparam">void )

}

预定义常量

SolrCollapseFunction::NULLPOLICY_IGNORE

SolrCollapseFunction::NULLPOLICY_EXPAND

SolrCollapseFunction::NULLPOLICY_COLLAPSE

SolrCollapseFunction::__construct

Constructor

说明

public <span class="methodname">SolrCollapseFunction::__construct ([ <span class="methodparam">string $field ] )

Collapse Function constructor

参数

field
The field name to collapse on.

In order to collapse a result. The field type must be a single valued String, Int or Float.

范例

示例 #1 <span class="function">SolrCollapseFunction::__construct example

<?php

include "bootstrap.php";

$options = array
(
    'hostname' => SOLR_SERVER_HOSTNAME,
    'login'    => SOLR_SERVER_USERNAME,
    'password' => SOLR_SERVER_PASSWORD,
    'port'     => SOLR_SERVER_PORT,
    'path'     => SOLR_SERVER_PATH
);

$client = new SolrClient($options);

$query = new SolrQuery('*:*');

$func = new SolrCollapseFunction('field_name');

$func->setMax('sum(cscore(),field(some_other_field))');
$func->setSize(100);
$func->setNullPolicy(SolrCollapseFunction::NULLPOLICY_EXPAND);

$query->collapse($func);

$queryResponse = $client->query($query);

$response = $queryResponse->getResponse();

print_r($response);

?>

参见

  • SolrQuery::collapse

SolrCollapseFunction::getField

Returns the field that is being collapsed on

说明

public string SolrCollapseFunction::getField ( <span class="methodparam">void )

Returns the field that is being collapsed on.

参数

此函数没有参数。

返回值

参见

  • SolrCollapseFunction::setField

SolrCollapseFunction::getHint

Returns collapse hint

说明

public string SolrCollapseFunction::getHint ( <span class="methodparam">void )

Returns collapse hint

参数

此函数没有参数。

返回值

参见

  • SolrCollapseFunction::setHint

SolrCollapseFunction::getMax

Returns max parameter

说明

public string SolrCollapseFunction::getMax ( <span class="methodparam">void )

Returns max parameter

参数

此函数没有参数。

返回值

参见

  • SolrCollapseFunction::setMax

SolrCollapseFunction::getMin

Returns min parameter

说明

public string SolrCollapseFunction::getMin ( <span class="methodparam">void )

Returns min parameter

参数

此函数没有参数。

返回值

参见

  • SolrCollapseFunction::setMin

SolrCollapseFunction::getNullPolicy

Returns null policy

说明

public string SolrCollapseFunction::getNullPolicy ( void )

Returns null policy used or null

参数

此函数没有参数。

返回值

参见

  • SolrCollapseFunction::setNullPolicy

SolrCollapseFunction::getSize

Returns size parameter

说明

public int <span class="methodname">SolrCollapseFunction::getSize ( <span class="methodparam">void )

Gets the initial size of the collapse data structures when collapsing on a numeric field only

参数

此函数没有参数。

返回值

参见

  • SolrCollapseFunction::setSize

SolrCollapseFunction::setField

Sets the field to collapse on

说明

public <span class="type">SolrCollapseFunction <span class="methodname">SolrCollapseFunction::setField ( <span class="methodparam">string $fieldName )

The field name to collapse on. In order to collapse a result. The field type must be a single valued String, Int or Float.

参数

fieldName

返回值

SolrCollapseFunction

SolrCollapseFunction::setHint

Sets collapse hint

说明

public <span class="type">SolrCollapseFunction <span class="methodname">SolrCollapseFunction::setHint ( <span class="methodparam">string $hint )

Sets collapse hint

参数

hint
Currently there is only one hint available "top_fc", which stands for top level FieldCache

返回值

SolrCollapseFunction

范例

示例 #1 SolrCollapseFunction::setHint example

<?php

/* ... */

?>

以上例程的输出类似于:

...

SolrCollapseFunction::setMax

Selects the group heads by the max value of a numeric field or function query

说明

public <span class="type">SolrCollapseFunction <span class="methodname">SolrCollapseFunction::setMax ( <span class="methodparam">string $max )

Selects the group heads by the max value of a numeric field or function query.

参数

max

返回值

SolrCollapseFunction

范例

示例 #1 SolrCollapseFunction::setMax example

<?php

$func = new SolrCollapseFunction('field_name');

$func->setMax('sum(cscore(),field(some_field))');

$query = new SolrQuery('*:*');

$query->collapse($func);

?>

SolrCollapseFunction::setMin

Sets the initial size of the collapse data structures when collapsing on a numeric field only

说明

public <span class="type">SolrCollapseFunction <span class="methodname">SolrCollapseFunction::setMin ( <span class="methodparam">string $min )

Sets the initial size of the collapse data structures when collapsing on a numeric field only

参数

min

返回值

SolrCollapseFunction

SolrCollapseFunction::setNullPolicy

Sets the NULL Policy

说明

public <span class="type">SolrCollapseFunction <span class="methodname">SolrCollapseFunction::setNullPolicy ( <span class="methodparam">string $nullPolicy )

Sets the NULL Policy. One of the 3 policies defined as class constants shall be passed. Accepts ignore, expand, or collapse policies.

参数

nullPolicy

返回值

SolrCollapseFunction

SolrCollapseFunction::setSize

Sets the initial size of the collapse data structures when collapsing on a numeric field only

说明

public <span class="type">SolrCollapseFunction <span class="methodname">SolrCollapseFunction::setSize ( <span class="methodparam">int $size )

Sets the initial size of the collapse data structures when collapsing on a numeric field only.

参数

size

返回值

SolrCollapseFunction

SolrCollapseFunction::__toString

Returns a string representing the constructed collapse function

说明

public string SolrCollapseFunction::__toString ( void )

Returns a string representing the constructed collapse function

参数

此函数没有参数。

返回值

简介

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

类摘要

SolrException

class SolrException <span class="ooclass"> extends Exception {

/* 属性 */

protected int $sourceline ;

protected string $sourcefile ;

protected string $zif_name ;

/* 继承的属性 */

protected string $message ;

protected int $code ;

protected string $file ;

protected int $line ;

/* 方法 */

public array getInternalInfo ( <span class="methodparam">void )

/* 继承的方法 */

final public string <span class="methodname">Exception::getMessage ( <span class="methodparam">void )

final public Throwable <span class="methodname">Exception::getPrevious ( <span class="methodparam">void )

final public mixed <span class="methodname">Exception::getCode ( <span class="methodparam">void )

final public string <span class="methodname">Exception::getFile ( <span class="methodparam">void )

final public int <span class="methodname">Exception::getLine ( <span class="methodparam">void )

final public array <span class="methodname">Exception::getTrace ( <span class="methodparam">void )

final public string <span class="methodname">Exception::getTraceAsString ( <span class="methodparam">void )

public string Exception::__toString ( <span class="methodparam">void )

final <span class="modifier">private void <span class="methodname">Exception::__clone ( <span class="methodparam">void )

}

属性

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

SolrException::getInternalInfo

Returns internal information where the Exception was thrown

说明

public array SolrException::getInternalInfo ( <span class="methodparam">void )

Returns internal information where the Exception was thrown.

参数

此函数没有参数。

返回值

Returns an array containing internal information where the error was thrown. Used only for debugging by extension developers.

简介

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

类摘要

SolrClientException

class SolrClientException <span class="ooclass"> extends SolrException {

/* 继承的属性 */

protected string $message ;

protected int $code ;

protected string $file ;

protected int $line ;

protected int $sourceline ;

protected string $sourcefile ;

protected string $zif_name ;

/* 方法 */

public array getInternalInfo ( <span class="methodparam">void )

/* 继承的方法 */

final public string <span class="methodname">Exception::getMessage ( <span class="methodparam">void )

final public Throwable <span class="methodname">Exception::getPrevious ( <span class="methodparam">void )

final public mixed <span class="methodname">Exception::getCode ( <span class="methodparam">void )

final public string <span class="methodname">Exception::getFile ( <span class="methodparam">void )

final public int <span class="methodname">Exception::getLine ( <span class="methodparam">void )

final public array <span class="methodname">Exception::getTrace ( <span class="methodparam">void )

final public string <span class="methodname">Exception::getTraceAsString ( <span class="methodparam">void )

public string Exception::__toString ( <span class="methodparam">void )

final <span class="modifier">private void <span class="methodname">Exception::__clone ( <span class="methodparam">void )

public array SolrException::getInternalInfo ( <span class="methodparam">void )

}

SolrClientException::getInternalInfo

Returns internal information where the Exception was thrown

说明

public array SolrClientException::getInternalInfo ( void )

Returns internal information where the Exception was thrown.

参数

此函数没有参数。

返回值

Returns an array containing internal information where the error was thrown. Used only for debugging by extension developers.

简介

An exception thrown when there is an error produced by the Solr Server itself.

类摘要

SolrServerException

class SolrServerException <span class="ooclass"> extends SolrException {

/* 继承的属性 */

protected string $message ;

protected int $code ;

protected string $file ;

protected int $line ;

protected int $sourceline ;

protected string $sourcefile ;

protected string $zif_name ;

/* 方法 */

public array getInternalInfo ( <span class="methodparam">void )

/* 继承的方法 */

final public string <span class="methodname">Exception::getMessage ( <span class="methodparam">void )

final public Throwable <span class="methodname">Exception::getPrevious ( <span class="methodparam">void )

final public mixed <span class="methodname">Exception::getCode ( <span class="methodparam">void )

final public string <span class="methodname">Exception::getFile ( <span class="methodparam">void )

final public int <span class="methodname">Exception::getLine ( <span class="methodparam">void )

final public array <span class="methodname">Exception::getTrace ( <span class="methodparam">void )

final public string <span class="methodname">Exception::getTraceAsString ( <span class="methodparam">void )

public string Exception::__toString ( <span class="methodparam">void )

final <span class="modifier">private void <span class="methodname">Exception::__clone ( <span class="methodparam">void )

public array SolrException::getInternalInfo ( <span class="methodparam">void )

}

SolrServerException::getInternalInfo

Returns internal information where the Exception was thrown

说明

public array SolrServerException::getInternalInfo ( void )

Returns internal information where the Exception was thrown.

参数

此函数没有参数。

返回值

Returns an array containing internal information where the error was thrown. Used only for debugging by extension developers.

简介

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

类摘要

SolrIllegalArgumentException

class SolrIllegalArgumentException extends SolrException {

/* 继承的属性 */

protected string $message ;

protected int $code ;

protected string $file ;

protected int $line ;

protected int $sourceline ;

protected string $sourcefile ;

protected string $zif_name ;

/* 方法 */

public array getInternalInfo ( <span class="methodparam">void )

/* 继承的方法 */

final public string <span class="methodname">Exception::getMessage ( <span class="methodparam">void )

final public Throwable <span class="methodname">Exception::getPrevious ( <span class="methodparam">void )

final public mixed <span class="methodname">Exception::getCode ( <span class="methodparam">void )

final public string <span class="methodname">Exception::getFile ( <span class="methodparam">void )

final public int <span class="methodname">Exception::getLine ( <span class="methodparam">void )

final public array <span class="methodname">Exception::getTrace ( <span class="methodparam">void )

final public string <span class="methodname">Exception::getTraceAsString ( <span class="methodparam">void )

public string Exception::__toString ( <span class="methodparam">void )

final <span class="modifier">private void <span class="methodname">Exception::__clone ( <span class="methodparam">void )

public array SolrException::getInternalInfo ( <span class="methodparam">void )

}

SolrIllegalArgumentException::getInternalInfo

Returns internal information where the Exception was thrown

说明

public array <span class="methodname">SolrIllegalArgumentException::getInternalInfo ( void )

Returns internal information where the Exception was thrown.

Warning

本函数还未编写文档,仅有参数列表。

参数

此函数没有参数。

返回值

Returns an array containing internal information where the error was thrown. Used only for debugging by extension developers.

简介

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

类摘要

SolrIllegalOperationException

class SolrIllegalOperationException extends SolrException {

/* 继承的属性 */

protected string $message ;

protected int $code ;

protected string $file ;

protected int $line ;

protected int $sourceline ;

protected string $sourcefile ;

protected string $zif_name ;

/* 方法 */

public array getInternalInfo ( <span class="methodparam">void )

/* 继承的方法 */

final public string <span class="methodname">Exception::getMessage ( <span class="methodparam">void )

final public Throwable <span class="methodname">Exception::getPrevious ( <span class="methodparam">void )

final public mixed <span class="methodname">Exception::getCode ( <span class="methodparam">void )

final public string <span class="methodname">Exception::getFile ( <span class="methodparam">void )

final public int <span class="methodname">Exception::getLine ( <span class="methodparam">void )

final public array <span class="methodname">Exception::getTrace ( <span class="methodparam">void )

final public string <span class="methodname">Exception::getTraceAsString ( <span class="methodparam">void )

public string Exception::__toString ( <span class="methodparam">void )

final <span class="modifier">private void <span class="methodname">Exception::__clone ( <span class="methodparam">void )

public array SolrException::getInternalInfo ( <span class="methodparam">void )

}

SolrIllegalOperationException::getInternalInfo

Returns internal information where the Exception was thrown

说明

public array <span class="methodname">SolrIllegalOperationException::getInternalInfo ( void )

Returns internal information where the Exception was thrown.

Warning

本函数还未编写文档,仅有参数列表。

参数

此函数没有参数。

返回值

Returns an array containing internal information where the error was thrown. Used only for debugging by extension developers.

简介

类摘要

SolrMissingMandatoryParameterException

class SolrMissingMandatoryParameterException extends SolrException {

/* 继承的属性 */

protected string $message ;

protected int $code ;

protected string $file ;

protected int $line ;

protected int $sourceline ;

protected string $sourcefile ;

protected string $zif_name ;

/* 继承的方法 */

final public string <span class="methodname">Exception::getMessage ( <span class="methodparam">void )

final public Throwable <span class="methodname">Exception::getPrevious ( <span class="methodparam">void )

final public mixed <span class="methodname">Exception::getCode ( <span class="methodparam">void )

final public string <span class="methodname">Exception::getFile ( <span class="methodparam">void )

final public int <span class="methodname">Exception::getLine ( <span class="methodparam">void )

final public array <span class="methodname">Exception::getTrace ( <span class="methodparam">void )

final public string <span class="methodname">Exception::getTraceAsString ( <span class="methodparam">void )

public string Exception::__toString ( <span class="methodparam">void )

final <span class="modifier">private void <span class="methodname">Exception::__clone ( <span class="methodparam">void )

public array SolrException::getInternalInfo ( <span class="methodparam">void )

}


本站为非盈利网站,作品由网友提供上传,如无意中有侵犯您的版权,请联系删除