SolrClient::getByIds
(PECL solr >= 2.2.0)
SolrClient::getByIds — Get Documents by their Ids. Utilizes Solr Realtime Get (RTG).
Описание
Get Documents by their Ids. Utilizes Solr Realtime Get (RTG).
Список параметров
-
ids
-
Document ids
Возвращаемые значения
Примеры
Пример #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() - Get Document By Id. Utilizes Solr Realtime Get (RTG).
- PHP Руководство
- Функции по категориям
- Индекс функций
- Справочник функций
- Расширения для работы с поисковыми системами
- Apache Solr
- Функция SolrClient::addDocument() - Adds a document to the index
- Функция SolrClient::addDocuments() - Adds a collection of SolrInputDocument instances to the index
- Функция SolrClient::commit() - Finalizes all add/deletes made to the index
- Функция SolrClient::__construct() - Constructor for the SolrClient object
- Функция SolrClient::deleteById() - Delete by Id
- Функция SolrClient::deleteByIds() - Deletes by Ids
- Функция SolrClient::deleteByQueries() - Removes all documents matching any of the queries
- Функция SolrClient::deleteByQuery() - Deletes all documents matching the given query
- Функция SolrClient::__destruct() - Destructor for SolrClient
- SolrClient::getById
- SolrClient::getByIds
- Функция SolrClient::getDebug() - Returns the debug data for the last connection attempt
- Функция SolrClient::getOptions() - Returns the client options set internally
- Функция SolrClient::optimize() - Defragments the index
- Функция SolrClient::ping() - Checks if Solr server is still up
- Функция SolrClient::query() - Sends a query to the server
- Функция SolrClient::request() - Sends a raw update request
- Функция SolrClient::rollback() - Rollbacks all add/deletes made to the index since the last commit
- Функция SolrClient::setResponseWriter() - Sets the response writer used to prepare the response from Solr
- Функция SolrClient::setServlet() - Changes the specified servlet type to a new value
- SolrClient::system
- Функция SolrClient::threads() - Checks the threads status
Коментарии
404 Not Found