From: Albert Cervera i Areny <albert@nan-tic.com>
To: Bruce Momjian <bruce@momjian.us>
Cc: pgsql-docs@postgresql.org
Subject: Re: About contrib modules
Date: Sun, 2 Dec 2007 18:34:17 +0100
Message-ID: <200712021834.18556.albert@nan-tic.com> (raw)
In-Reply-To: <200711221623.lAMGNEX03651@momjian.us>
References: <200711221623.lAMGNEX03651@momjian.us>
A Dijous 22 Novembre 2007, Bruce Momjian va escriure:
> albert@nan-tic.com 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.comAttachments:dicts.diff (text/x-diff, 1.2K) download
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">
dict-int.sgml (text/sgml, 1.3K) download
<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>
dict-xsyn.sgml (text/sgml, 1.8K) download
<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>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: albert@nan-tic.com, bruce@momjian.us
Subject: Re: About contrib modules
In-Reply-To: <200712021834.18556.albert@nan-tic.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox