php-doc-en/reference/swish/functions/swish-construct.xml

102 lines
2.2 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<refentry xml:id="function.swish-construct" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>Swish::__construct</refname>
<refpurpose>Construct a Swish object</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>Swish::__construct</methodname>
<methodparam><type>string</type><parameter>index_names</parameter></methodparam>
</methodsynopsis>
&warn.experimental.func;
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>index_names</parameter></term>
<listitem>
<para>
The list of index files separated by spaces.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Throws <classname>SwishException</classname> on error.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>A <function>Swish::__construct</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
try {
$swish = new Swish("index1 index2");
} catch (SwishException $e) {
echo $e->getMessage(), "\n";
}
foreach ($swish->indexes as $index) {
var_dump($index["name"]);
var_dump($index["headers"]["Total Words"]);
}
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
string(6) "index1"
int(1888)
string(6) "index2"
int(2429)
]]>
</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:"../../../../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
-->