©
本文档使用
php.cn手册 发布
(PECL solr >= 2.2.0)
SolrClient::getById — Get Document By Id. Utilizes Solr Realtime Get (RTG).
$id
)Get Document By Id. Utilizes Solr Realtime Get (RTG).
id
Document ID
SolrQueryResponse
Example #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 ());
?>
以上例程的输出类似于:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
|