A Dijous 22 Novembre 2007, Bruce Momjian va escriure:
> [EMAIL PROTECTED] wrote:
> > I'm sorry I haven't said anything yet. I've got no Internet connection at
> > home. I'll work on the remaining work on contrib docs as soon as my
> > Internet connection is restablished.
>
> Thanks. We probably have 1-2 weeks left to get it into 8.3 final.
Attached, the dict_int and dict_xsyn SGML docs.
Now I'll work on the lost changes of the already SGML'ed docs.
--
Albert Cervera i Areny
http://www.NaN-tic.com
Index: contrib.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/contrib.sgml,v
retrieving revision 1.4
diff -c -r1.4 contrib.sgml
*** contrib.sgml 14 Nov 2007 02:36:43 -0000 1.4
--- contrib.sgml 2 Dec 2007 17:32:09 -0000
***************
*** 82,87 ****
--- 82,89 ----
&chkpass;
&cube;
&dblink;
+ &dict-int;
+ &dict-xsyn;
&earthdistance;
&fuzzystrmatch;
&hstore;
Index: filelist.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/filelist.sgml,v
retrieving revision 1.53
diff -c -r1.53 filelist.sgml
*** filelist.sgml 14 Nov 2007 01:09:50 -0000 1.53
--- filelist.sgml 2 Dec 2007 17:32:10 -0000
***************
*** 96,101 ****
--- 96,103 ----
<!entity chkpass SYSTEM "chkpass.sgml">
<!entity cube SYSTEM "cube.sgml">
<!entity dblink SYSTEM "dblink.sgml">
+ <!entity dict-int SYSTEM "dict-int.sgml">
+ <!entity dict-xsyn SYSTEM "dict-xsyn.sgml">
<!entity earthdistance SYSTEM "earthdistance.sgml">
<!entity fuzzystrmatch SYSTEM "fuzzystrmatch.sgml">
<!entity hstore SYSTEM "hstore.sgml">
<sect1>
<title>dict_int</title>
<para>
The motivation for this example dictionary is to control the indexing of
integers (signed and unsigned), and, consequently, to minimize the number of
unique words which greatly affect the performance of searching.
</para>
<sect2>
<title>Configuration</title>
<para>
The dictionary accepts two options:
</para>
<itemizedlist>
<listitem>
<para>
The MAXLEN parameter specifies the maximum length (number of digits)
allowed in an integer word. The default value is 6.
</para>
</listitem>
<listitem>
<para>
The REJECTLONG parameter specifies if an overlength integer should be
truncated or ignored. If REJECTLONG=FALSE (default), the dictionary returns
the first MAXLEN digits of the integer. If REJECTLONG=TRUE, the
dictionary treats an overlength integer as a stop word, so that it will
not be indexed.
</para>
</listitem>
</itemizedlist>
</sect2>
<sect2>
<title>Usage</title>
<programlisting>
mydb# select ts_lexize('intdict', '12345678');
ts_lexize
-----------
{123456}
</programlisting>
<para>
Change dictionary options:
</para>
<programlisting>
mydb# ALTER TEXT SEARCH DICTIONARY intdict (MAXLEN = 4, REJECTLONG = true);
ALTER TEXT SEARCH DICTIONARY
</programlisting>
</sect2>
</sect1>
<sect1>
<title>dict_xsyn</title>
<para>
The Extended Synonym Dictionary module replaces words with groups of their
synonyms, and so makes it possible to search for a word using any of its
synonyms.
</para>
<sect2>
<title>Configuration</title>
<para>
It accepts the following options:
</para>
<itemizedlist>
<listitem>
<para>
KEEPORIG controls whether the original word is included, or only its
synonyms. Default is 'true'.
</para>
</listitem>
<listitem>
<para>
RULES is the base name of the file containing the list of synonyms.
This file must be in $(prefix)/share/tsearch_data/, and its name must
end in ".rules" (which is not included in the RULES parameter).
</para>
</listitem>
</itemizedlist>
<para>
The rules file has the following format:
</para>
<itemizedlist>
<listitem>
<para>
Each line represents a group of synonyms for a single word, which is
given first on the line. Synonyms are separated by whitespace:
</para>
<programlisting>
word syn1 syn2 syn3
</programlisting>
</listitem>
<listitem>
<para>
Sharp ('#') sign is a comment delimiter. It may appear at any position
inside the line. The rest of the line will be skipped.
</para>
</listitem>
</itemizedlist>
<para>
Look at xsyn_sample.rules, which is installed in $(prefix)/share/tsearch_data/,
for an example.
</para>
</sect2>
<sect2>
<title>Usage</title>
<programlisting>
mydb=# SELECT ts_lexize('xsyn','word');
ts_lexize
----------------
{word,syn1,syn2,syn3)
</programlisting>
<para>
Change dictionary options:
</para>
<programlisting>
mydb# ALTER TEXT SEARCH DICTIONARY xsyn (KEEPORIG=false);
ALTER TEXT SEARCH DICTIONARY
</programlisting>
</sect2>
</sect1>
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend