1
0
mirror of https://github.com/php/doc-es.git synced 2026-03-26 08:22:08 +01:00
Files
archived-doc-es/reference/swish/examples.xml
Jesus Ruiz Garcia b22c5b6c1d Traducidos
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@321364 c90b9560-bf6c-de11-be94-00142212c4b1
2011-12-24 04:44:56 +00:00

84 lines
1.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: af4410a7e15898c3dbe83d6ea38246745ed9c6fb Maintainer: jesusruiz Status: ready -->
<!-- Reviewed: no -->
<chapter xml:id="swish.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.examples;
<section xml:id="swish.examples-basic">
<title>Uso básico</title>
<para>
<example>
<title>Consulta de búsqueda básica</title>
<programlisting role="php">
<![CDATA[
<?php
try {
$swish = new Swish("index.swish-e");
$results = $swish->query("test OR text");
echo "Found ", $results->hits, " results\n";
while ($result = $results->nextResult()) {
var_dump($result);
break; //break después del primer resultado
}
} catch (SwishException $e) {
echo "Error: ", $e->getMessage(), "\n";
}
?>
]]>
</programlisting>
</example>
</para>
&example.outputs.similar;
<screen>
<![CDATA[
Found 9 results
object(SwishResult)#3 (8) {
["swishreccount"]=>
int(1)
["swishrank"]=>
int(1000)
["swishfilenum"]=>
int(10)
["swishdbfile"]=>
string(13) "index.swish-e"
["swishdocpath"]=>
string(23) "README.SUBMITTING_PATCH"
["swishtitle"]=>
NULL
["swishdocsize"]=>
int(4557)
["swishlastmodified"]=>
int(1072136752)
}
]]>
</screen>
</section>
</chapter>
<!-- 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
-->