SolrDocument::toArray
(PECL solr >= 0.9.2)
SolrDocument::toArray — Returns an array representation of the document
Описание
public array SolrDocument::toArray
( 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 ) ) ) )
- PHP Руководство
- Функции по категориям
- Индекс функций
- Справочник функций
- Расширения для работы с поисковыми системами
- Apache Solr
- Функция SolrDocument::addField() - Adds a field to the document
- Функция SolrDocument::clear() - Drops all the fields in the document
- Функция SolrDocument::__clone() - Creates a copy of a SolrDocument object
- Функция SolrDocument::__construct() - Constructor
- Функция SolrDocument::current() - Retrieves the current field
- Функция SolrDocument::deleteField() - Removes a field from the document
- Функция SolrDocument::__destruct() - Destructor
- Функция SolrDocument::fieldExists() - Checks if a field exists in the document
- Функция SolrDocument::__get() - Access the field as a property
- Функция SolrDocument::getField() - Retrieves a field by name
- Функция SolrDocument::getFieldCount() - Returns the number of fields in this document
- Функция SolrDocument::getFieldNames() - Returns an array of fields names in the document
- Функция SolrDocument::getInputDocument() - Returns a SolrInputDocument equivalent of the object
- Функция SolrDocument::__isset() - Checks if a field exists
- Функция SolrDocument::key() - Retrieves the current key
- Функция SolrDocument::merge() - Merges source to the current SolrDocument
- Функция SolrDocument::next() - Moves the internal pointer to the next field
- Функция SolrDocument::offsetExists() - Checks if a particular field exists
- Функция SolrDocument::offsetGet() - Retrieves a field
- Функция SolrDocument::offsetSet() - Adds a field to the document
- Функция SolrDocument::offsetUnset() - Removes a field
- Функция SolrDocument::reset() - This is an alias to SolrDocument::clear()
- Функция SolrDocument::rewind() - Resets the internal pointer to the beginning
- Функция SolrDocument::serialize() - Used for custom serialization
- Функция SolrDocument::__set() - Adds another field to the document
- Функция SolrDocument::sort() - Sorts the fields in the document
- Функция SolrDocument::toArray() - Returns an array representation of the document
- Функция SolrDocument::unserialize() - Custom serialization of SolrDocument objects
- Функция SolrDocument::__unset() - Removes a field from the document
- Функция SolrDocument::valid() - Checks if the current position internally is still valid
Коментарии
404 Not Found