mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-25 17:32:07 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@334125 c90b9560-bf6c-de11-be94-00142212c4b1
182 lines
4.7 KiB
XML
182 lines
4.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 3b3be96b737e3c90e42a92e0959ed788f06dbbb7 Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
|
|
<refentry xml:id="solrclient.query" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>SolrClient::query</refname>
|
|
<refpurpose>Envoi une requête au serveur</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <type>SolrQueryResponse</type><methodname>SolrClient::query</methodname>
|
|
<methodparam><type>SolrParams</type><parameter>query</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Envoi une requête au serveur.
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>query</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Un objet <type>SolrParams</type>. Il est recommandé d'utiliser un objet
|
|
<type>SolrQuery</type> pour des requêtes avancées.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Retourne un objet <type>SolrQueryResponse</type> en cas de succès, et
|
|
lance une exception en cas d'échec.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors">
|
|
&reftitle.errors;
|
|
<para>
|
|
Lance une exception <classname>SolrClientException</classname> si le client a échoué
|
|
ou s'il y a eu un problème avec la connexion.
|
|
</para>
|
|
<para>
|
|
Lance une exception <classname>SolrServerException</classname> si le serveur
|
|
Solr a échoué dans l'exécution de la requête.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <methodname>SolrClient::query</methodname></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?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);
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
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)
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</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
|
|
-->
|