tony2001 Fri Feb 9 16:57:06 2007 UTC Added files: /phpdoc/en/reference/swish/functions swish-getmetalist.xml swish-getpropertylist.xml swishresult-getmetalist.xml swishresults-getparsedwords.xml swishresults-getremovedstopwords.xml swishresults-nextresult.xml swishresults-seekresult.xml swishsearch-resetlimit.xml swishsearch-setlimit.xml swishsearch-setphrasedelimiter.xml swishsearch-setsort.xml swishsearch-setstructure.xml
Removed files: /phpdoc/en/reference/swish/functions swish-getMetaList.xml swish-getPropertyList.xml swishresult-getMetaList.xml swishresults-getParsedWords.xml swishresults-getRemovedStopwords.xml swishresults-nextResult.xml swishresults-seekResult.xml swishsearch-resetLimit.xml swishsearch-setLimit.xml swishsearch-setPhraseDelimiter.xml swishsearch-setSort.xml swishsearch-setStructure.xml Modified files: /phpdoc/en/reference/swish classes.xml Log: use lowercase IDs and filenames
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/swish/classes.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/swish/classes.xml diff -u phpdoc/en/reference/swish/classes.xml:1.1 phpdoc/en/reference/swish/classes.xml:1.2 --- phpdoc/en/reference/swish/classes.xml:1.1 Fri Feb 9 13:35:21 2007 +++ phpdoc/en/reference/swish/classes.xml Fri Feb 9 16:57:06 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <section id="swish.classes"> &reftitle.classes; <section> @@ -44,11 +44,11 @@ </para> </listitem> <listitem> - <para><xref linkend="function.swish-getMetaList" /> - returns an array + <para><xref linkend="function.swish-getmetalist" /> - returns an array of meta entries for the given index file.</para> </listitem> <listitem> - <para><xref linkend="function.swish-getPropertyList" /> - returns an array + <para><xref linkend="function.swish-getpropertylist" /> - returns an array of properties for the given index file.</para> </listitem> </itemizedlist> @@ -63,33 +63,33 @@ <itemizedlist> <listitem> <para> - <xref linkend="function.swishsearch-setStructure" /> - sets the + <xref linkend="function.swishsearch-setstructure" /> - sets the structure flag in the search object. This flag is used to limit search to certain parts of HTML documents. </para> </listitem> <listitem> <para> - <xref linkend="function.swishsearch-setPhraseDelimiter" /> - sets + <xref linkend="function.swishsearch-setphrasedelimiter" /> - sets the phrase delimiter character. The default delimiter is double-quotes. </para> </listitem> <listitem> <para> - <xref linkend="function.swishsearch-setSort" /> - sets the sort + <xref linkend="function.swishsearch-setsort" /> - sets the sort order of the results. </para> </listitem> <listitem> <para> - <xref linkend="function.swishsearch-setLimit" /> - sets the limits + <xref linkend="function.swishsearch-setlimit" /> - sets the limits for the search. Throws <classname>SwishException</classname> on error. </para> </listitem> <listitem> <para> - <xref linkend="function.swishsearch-resetLimit" /> - resets the + <xref linkend="function.swishsearch-resetlimit" /> - resets the limits. </para> </listitem> @@ -128,14 +128,14 @@ <itemizedlist> <listitem> <para> - <xref linkend="function.swishresults-nextResult" /> - returns + <xref linkend="function.swishresults-nextresult" /> - returns next <classname>SwishResult</classname> object or &false; if no more results are available. </para> </listitem> <listitem> <para> - <xref linkend="function.swishresults-seekResult" /> - sets the + <xref linkend="function.swishresults-seekresult" /> - sets the current seek position in the <classname>SwishResults</classname> object. Throws <classname>SwishException</classname> on error. @@ -143,13 +143,13 @@ </listitem> <listitem> <para> - <xref linkend="function.swishresults-getParsedWords" /> - + <xref linkend="function.swishresults-getparsedwords" /> - returns an array of words in the query with stopwords removed. </para> </listitem> <listitem> <para> - <xref linkend="function.swishresults-getRemovedStopwords" /> - + <xref linkend="function.swishresults-getremovedstopwords" /> - returns an array of removed stopwords. </para> </listitem> @@ -173,7 +173,7 @@ <itemizedlist> <listitem> <para> - <xref linkend="function.swishresult-getMetaList" /> - returns + <xref linkend="function.swishresult-getmetalist" /> - returns an array of meta entries for the index used in this result. </para> </listitem> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/swish/functions/swish-getmetalist.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/swish/functions/swish-getmetalist.xml +++ phpdoc/en/reference/swish/functions/swish-getmetalist.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.swish-getmetalist"> <refnamediv> <refname>Swish->getMetaList</refname> <refpurpose>Get the list of meta entries for the index</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>array</type><methodname>Swish->getMetaList</methodname> <methodparam><type>string</type><parameter>index_name</parameter></methodparam> </methodsynopsis> &warn.experimental.func; </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>index_name</parameter></term> <listitem> <para> The name of the index file. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns an array of meta entries for the given index. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Basic <function>Swish->getMetaList</function> example</title> <programlisting role="php"> <![CDATA[ <?php try { $swish = new Swish("index.swish-e"); var_dump($swish->getMetaList("index.swish-e")); } catch (SwishException $e) { echo $e->getMessage(), "\n"; } ?> ]]> </programlisting> <para>The above example will output something like this:</para> <screen> <![CDATA[ array(1) { [0]=> array(3) { ["Name"]=> string(12) "swishdefault" ["Type"]=> int(0) ["ID"]=> int(1) } } ]]> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/swish/functions/swish-getpropertylist.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/swish/functions/swish-getpropertylist.xml +++ phpdoc/en/reference/swish/functions/swish-getpropertylist.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.swish-getpropertylist"> <refnamediv> <refname>Swish->getPropertyList</refname> <refpurpose>Get the list of properties for the index</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>array</type><methodname>Swish->getPropertyList</methodname> <methodparam><type>string</type><parameter>index_name</parameter></methodparam> </methodsynopsis> &warn.experimental.func; </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>index_name</parameter></term> <listitem> <para> The name of the index file. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns an array of properties for the given index. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Basic <function>Swish->getPropertyList</function> example</title> <programlisting role="php"> <![CDATA[ <?php try { $swish = new Swish("index.swish-e"); $properties = $swish->getPropertyList("index.swish-e"); foreach ($properties as $prop) { echo $prop["Name"],"\n"; } } catch (SwishException $e) { echo $e->getMessage(), "\n"; } ?> ]]> </programlisting> <para>The above example will output something like this:</para> <screen> <![CDATA[ swishreccount swishrank swishfilenum swishdbfile swishdocpath swishtitle swishdocsize swishlastmodified ]]> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/swish/functions/swishresult-getmetalist.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/swish/functions/swishresult-getmetalist.xml +++ phpdoc/en/reference/swish/functions/swishresult-getmetalist.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.swishresult-getmetalist"> <refnamediv> <refname>SwishResult->getMetaList</refname> <refpurpose>Get a list of meta entries</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>array</type><methodname>SwishResult->getMetaList</methodname> <void/> </methodsynopsis> &warn.experimental.func; </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the same array as <link linkend="function.swish-getmetalist"><function>swish->getmetalist</function></link>, but uses the index file from the result handle. </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/swish/functions/swishresults-getparsedwords.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/swish/functions/swishresults-getparsedwords.xml +++ phpdoc/en/reference/swish/functions/swishresults-getparsedwords.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.swishresults-getparsedwords"> <refnamediv> <refname>SwishResults->getParsedWords</refname> <refpurpose>Get an array of parsed words</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>array</type><methodname>SwishResults->getParsedWords</methodname> <methodparam><type>string</type><parameter>index_name</parameter></methodparam> </methodsynopsis> &warn.experimental.func; </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>indexi_name</parameter></term> <listitem> <para> The name of the index used to initialize <classname>Swish</classname> object. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> An array of parsed words with stopwords removed. The list of parsed words may be useful for highlighting search terms in the results. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Basic <function>SwishResults->getParsedWords</function> example</title> <programlisting role="php"> <![CDATA[ <?php try { $swish = new Swish("index.swish-e"); $results = $swish->query("'some characters' and numbers"); var_dump($results->getParsedWords("index.swish-e")); var_dump($results->indexes[0]['parsed_words']); //same result in a different way } catch (SwishException $e) { echo "Error: ", $e->getMessage(), "\n"; } ?> ]]> </programlisting> <para>The above example will output something like this:</para> <screen> <![CDATA[ array(4) { [0]=> string(4) "some" [1]=> string(10) "characters" [2]=> string(3) "and" [3]=> string(7) "numbers" } array(4) { [0]=> string(4) "some" [1]=> string(10) "characters" [2]=> string(3) "and" [3]=> string(7) "numbers" } ]]> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/swish/functions/swishresults-getremovedstopwords.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/swish/functions/swishresults-getremovedstopwords.xml +++ phpdoc/en/reference/swish/functions/swishresults-getremovedstopwords.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.swishresults-getremovedstopwords"> <refnamediv> <refname>SwishResults->getRemovedStopwords</refname> <refpurpose>Get an array of stopwords removed from the query</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>array</type><methodname>SwishResults->getRemovedStopwords</methodname> <methodparam><type>string</type><parameter>index_name</parameter></methodparam> </methodsynopsis> &warn.experimental.func; </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>index_name</parameter></term> <listitem> <para> The name of the index used to initialize <classname>Swish</classname> object. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns array of stopwords removed from the query. </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/swish/functions/swishresults-nextresult.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/swish/functions/swishresults-nextresult.xml +++ phpdoc/en/reference/swish/functions/swishresults-nextresult.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.swishresults-nextresult"> <refnamediv> <refname>SwishResults->nextResult</refname> <refpurpose>Get the next search result</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>object</type><methodname>SwishResults->nextResult</methodname> <void/> </methodsynopsis> &warn.experimental.func; </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the next <classname>SwishResult</classname> object in the result set or &false; if there are no more results available. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Basic <function>SwishResults->nextResult</function> example</title> <programlisting role="php"> <![CDATA[ <?php try { $swish = new Swish("index.swish-e"); $search = $swish->prepare(); $results = $search->execute("lost"); while($result = $results->nextResult()) { /* do something with the result object */ } } catch (SwishException $e) { echo $e->getMessage(), "\n"; } ?> ]]> </programlisting> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/swish/functions/swishresults-seekresult.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/swish/functions/swishresults-seekresult.xml +++ phpdoc/en/reference/swish/functions/swishresults-seekresult.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.swishresults-seekresult"> <refnamediv> <refname>SwishResults->seekResult</refname> <refpurpose>Set current seek pointer to the given position</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>int</type><methodname>SwishResults->seekResult</methodname> <methodparam><type>int</type><parameter>position</parameter></methodparam> </methodsynopsis> &warn.experimental.func; </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>position</parameter></term> <listitem> <para> Zero-based position number. Cannot be less than zero. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns new position value on success. </para> </refsect1> <refsect1 role="errors"> &reftitle.errors; <para> Throws <classname>SwishException</classname> on error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Basic <function>SwishResults->seekResult</function> example</title> <programlisting role="php"> <![CDATA[ <?php try { $swish = new Swish("index.swish-e"); $search = $swish->prepare(); $results = $search->execute("lost"); var_dump($results->seekResult(0)); //this will succeed var_dump($results->seekResult(100)); //this will fail } catch (SwishException $e) { echo "Error: ", $e->getMessage(), "\n"; } ?> ]]> </programlisting> <para>The above example will output something like this:</para> <screen> <![CDATA[ int(0) Error: No more results ]]> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/swish/functions/swishsearch-resetlimit.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/swish/functions/swishsearch-resetlimit.xml +++ phpdoc/en/reference/swish/functions/swishsearch-resetlimit.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.swishsearch-resetlimit"> <refnamediv> <refname>SwishSearch->resetLimit</refname> <refpurpose>Reset the search limits</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>void</type><methodname>SwishSearch->resetLimit</methodname> <void /> </methodsynopsis> &warn.experimental.func; <para> Reset the search limits previous set by <xref linkend="function.swishsearch-setlimit" />. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Basic <function>SwishSearch->resetLimit</function> example</title> <programlisting role="php"> <![CDATA[ <?php try { $swish = new Swish("index.swish-e"); $search = $swish->prepare(); $results = $search->execute("time"); echo "First query found: ", $results->hits, " hits\n"; $search->setLimit("swishdocsize", "3000", "6000"); //limit by document size, from 3000 to 6000 bytes $results = $search->execute("time"); echo "Second query found: ", $results->hits, " hits\n"; $search->resetLimit(); $results = $search->execute("time"); echo "Third query found: ", $results->hits, " hits\n"; } catch (SwishException $e) { echo $e->getMessage(), "\n"; } ?> ]]> </programlisting> <para>The above example will output something like this:</para> <screen> <![CDATA[ First query found: 5 hits Second query found: 2 hits Third query found: 5 hits ]]> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/swish/functions/swishsearch-setlimit.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/swish/functions/swishsearch-setlimit.xml +++ phpdoc/en/reference/swish/functions/swishsearch-setlimit.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.swishsearch-setlimit"> <refnamediv> <refname>SwishSearch->setLimit</refname> <refpurpose>Set the search limits</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>void</type><methodname>SwishSearch->setLimit</methodname> <methodparam><type>string</type><parameter>property</parameter></methodparam> <methodparam><type>string</type><parameter>low</parameter></methodparam> <methodparam><type>string</type><parameter>high</parameter></methodparam> </methodsynopsis> &warn.experimental.func; </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>property</parameter></term> <listitem> <para> Search result property name. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>low</parameter></term> <listitem> <para> The lowest value of the property. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>high</parameter></term> <listitem> <para> The highest value of the property. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="errors"> &reftitle.errors; <para> Throws <classname>SwishException</classname> on error. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Basic <function>SwishSearch->setLimit</function> example</title> <programlisting role="php"> <![CDATA[ <?php try { $swish = new Swish("index.swish-e"); $search = $swish->prepare(); $results = $search->execute("time"); echo "First query found: ", $results->hits, " hits\n"; $i = 0; while($result = $results->nextResult()) { echo "Hit #", ++$i, " - ", $result->swishdocsize, " bytes\n"; } $search->setLimit("swishdocsize", "3000", "6000"); //limit by document size, from 3000 to 6000 bytes $results = $search->execute("time"); echo "Second query found: ", $results->hits, " hits\n"; $i = 0; while($result = $results->nextResult()) { echo "Hit #", ++$i, " - ", $result->swishdocsize, " bytes\n"; } } catch (SwishException $e) { echo $e->getMessage(), "\n"; } ?> ]]> </programlisting> <para>The above example will output something like this:</para> <screen> <![CDATA[ First query found: 5 hits Hit #1 - 4261 bytes Hit #2 - 37937 bytes Hit #3 - 7126 bytes Hit #4 - 15427 bytes Hit #5 - 4768 bytes Second query found: 2 hits Hit #1 - 4261 bytes Hit #2 - 4768 bytes ]]> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/swish/functions/swishsearch-setphrasedelimiter.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/swish/functions/swishsearch-setphrasedelimiter.xml +++ phpdoc/en/reference/swish/functions/swishsearch-setphrasedelimiter.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.swishsearch-setphrasedelimiter"> <refnamediv> <refname>SwishSearch->setPhraseDelimiter</refname> <refpurpose>Set the phrase delimiter</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>void</type><methodname>SwishSearch->setPhraseDelimiter</methodname> <methodparam><type>string</type><parameter>delimiter</parameter></methodparam> </methodsynopsis> &warn.experimental.func; </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>delimiter</parameter></term> <listitem> <para> Phrase delimiter character. The default delimiter is double-quotes. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Basic <function>SwishSearch->setPhraseDelimiter</function> example</title> <programlisting role="php"> <![CDATA[ <?php try { $swish = new Swish("index.swish-e"); $search = $swish->prepare(); $results = $search->execute('"every time"'); //looking for "every time" echo "First query found: ", $results->hits, " hits\n"; $search->setPhraseDelimiter("'"); $results = $search->execute("'every time'"); //the same query, but using different delimiter echo "Second query found: ", $results->hits, " hits\n"; $search->setPhraseDelimiter('"'); $results = $search->execute("'every time'"); //looking for "every" and "time" echo "Third query found: ", $results->hits, " hits\n"; //let's look at parsed words var_dump($results->getParsedWords("index.swish-e")); } catch (SwishException $e) { echo $e->getMessage(), "\n"; } ?> ]]> </programlisting> <para>The above example will output something like this:</para> <screen> <![CDATA[ First query found: 1 hits Second query found: 1 hits Third query found: 2 hits array(2) { [0]=> string(5) "every" [1]=> string(4) "time" } ]]> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/swish/functions/swishsearch-setsort.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/swish/functions/swishsearch-setsort.xml +++ phpdoc/en/reference/swish/functions/swishsearch-setsort.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.swishsearch-setsort"> <refnamediv> <refname>SwishSearch->setSort</refname> <refpurpose>Set the sort order</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>void</type><methodname>SwishSearch->setSort</methodname> <methodparam><type>string</type><parameter>sort</parameter></methodparam> </methodsynopsis> &warn.experimental.func; </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>sort</parameter></term> <listitem> <para> Sort order of the results is a string containing name of a result property combined with sort direction ("asc" or "desc"). Examples: "swishrank desc", "swishdocpath asc", "swishtitle asc", "swishdocsize desc", "swishlastmodified desc" etc. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Basic <function>SwishSearch->setSort</function> example</title> <programlisting role="php"> <![CDATA[ <?php try { $swish = new Swish("index.swish-e"); $search = $swish->prepare(); $results = $search->execute("time"); echo "First query found: ", $results->hits, " hits\n"; $i = 0; while($result = $results->nextResult()) { echo "Hit #", ++$i, " - ", $result->swishdocsize, " bytes\n"; } $search->setSort("swishdocsize desc"); //sort by document size $results = $search->execute("time"); echo "Second query found: ", $results->hits, " hits\n"; $i = 0; while($result = $results->nextResult()) { echo "Hit #", ++$i, " - ", $result->swishdocsize, " bytes\n"; } } catch (SwishException $e) { echo $e->getMessage(), "\n"; } ?> ]]> </programlisting> <para>The above example will output something like this:</para> <screen> <![CDATA[ First query found: 5 hits Hit #1 - 4261 bytes Hit #2 - 37937 bytes Hit #3 - 7126 bytes Hit #4 - 15427 bytes Hit #5 - 4768 bytes Second query found: 5 hits Hit #1 - 37937 bytes Hit #2 - 15427 bytes Hit #3 - 7126 bytes Hit #4 - 4768 bytes Hit #5 - 4261 bytes ]]> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/swish/functions/swishsearch-setstructure.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/swish/functions/swishsearch-setstructure.xml +++ phpdoc/en/reference/swish/functions/swishsearch-setstructure.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.swishsearch-setstructure"> <refnamediv> <refname>SwishSearch->setStructure</refname> <refpurpose>Set the structure flag in the search object</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>void</type><methodname>SwishSearch->setStructure</methodname> <methodparam><type>int</type><parameter>structure</parameter></methodparam> </methodsynopsis> &warn.experimental.func; </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>structure</parameter></term> <listitem> <para> The structure flag a bitmask is used to limit search to certain parts of HTML documents (like title, meta, body etc.). Its possible values are listed below. To combine several values use bitwise AND operator, see example below. </para> </listitem> </varlistentry> </variablelist> </para> <para> <itemizedlist> <listitem> <para> <constant>SWISH_IN_FILE</constant> </para> </listitem> <listitem> <para> <constant>SWISH_IN_TITLE</constant> </para> </listitem> <listitem> <para> <constant>SWISH_IN_HEAD</constant> </para> </listitem> <listitem> <para> <constant>SWISH_IN_BODY</constant> </para> </listitem> <listitem> <para> <constant>SWISH_IN_COMMENTS</constant> </para> </listitem> <listitem> <para> <constant>SWISH_IN_HEADER</constant> </para> </listitem> <listitem> <para> <constant>SWISH_IN_EMPHASIZED</constant> </para> </listitem> <listitem> <para> <constant>SWISH_IN_META</constant> </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Basic <function>SwishSearch->setStructure</function> example</title> <programlisting role="php"> <![CDATA[ <?php try { $swish = new Swish("index.swish-e"); $search = $swish->prepare(); $results = $search->execute("time"); echo "First query found: ", $results->hits, " hits\n"; $search->setStructure(SWISH_IN_TITLE|SWISH_IN_HEAD); //search in title and head $results = $search->execute("time"); echo "Second query found: ", $results->hits, " hits\n"; $search->setStructure(SWISH_IN_ALL); //search in whole document, the default value $results = $search->execute("time"); echo "Third query found: ", $results->hits, " hits\n"; } catch (SwishException $e) { echo $e->getMessage(), "\n"; } ?> ]]> </programlisting> <para>The above example will output something like this:</para> <screen> <![CDATA[ First query found: 5 hits Second query found: 0 hits Third query found: 5 hits ]]> </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 -->