mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-27 06:18:56 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@343888 c90b9560-bf6c-de11-be94-00142212c4b1
138 lines
3.1 KiB
XML
138 lines
3.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
|
|
<refentry xml:id="solrclient.getbyid" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>SolrClient::getById</refname>
|
|
<refpurpose>Get Document By Id. Utilizes Solr Realtime Get (RTG)</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <type>SolrQueryResponse</type><methodname>SolrClient::getById</methodname>
|
|
<methodparam><type>string</type><parameter>id</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Get Document By Id. Utilizes Solr Realtime Get (RTG).
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>id</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Document ID
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
<type>SolrQueryResponse</type>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example>
|
|
<title><function>SolrClient::getById</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?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());
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
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
|
|
)
|
|
|
|
)
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</refsect1>
|
|
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<simplelist>
|
|
<member><methodname>SolrClient::getByIds</methodname></member>
|
|
</simplelist>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|