From: Tom Lane Date: Sun, 2 Dec 2007 21:13:34 +0000 (+0000) Subject: Add SGML docs for contrib/dict_int and contrib/dict_xsyn. X-Git-Tag: REL8_3_BETA4~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ec2ff52045bca49cd6d141ce70959d2c4065192d;p=postgresql Add SGML docs for contrib/dict_int and contrib/dict_xsyn. Albert Cervera i Areny --- diff --git a/doc/src/sgml/contrib.sgml b/doc/src/sgml/contrib.sgml index 0ee4be87f0..cf4495e3b8 100644 --- a/doc/src/sgml/contrib.sgml +++ b/doc/src/sgml/contrib.sgml @@ -1,4 +1,4 @@ - + Additional Supplied Modules @@ -82,6 +82,8 @@ psql -d dbname -f SHAREDIR/contrib/module.sql &chkpass; &cube; &dblink; + &dict-int; + &dict-xsyn; &earthdistance; &fuzzystrmatch; &hstore; diff --git a/doc/src/sgml/dict-int.sgml b/doc/src/sgml/dict-int.sgml new file mode 100644 index 0000000000..4da62710fa --- /dev/null +++ b/doc/src/sgml/dict-int.sgml @@ -0,0 +1,78 @@ + + dict_int + + + dict_int + + + + 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. + + + + Configuration + + The dictionary accepts two options: + + + + + + The MAXLEN parameter specifies the maximum length (number of digits) + allowed in an integer word. The default value is 6. + + + + + 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. + + + + + + + Usage + + + Running the installation script creates a text search template + intdict_template and a dictionary intdict + based on it, with the default parameters. You can alter the + parameters, for example + + +mydb# ALTER TEXT SEARCH DICTIONARY intdict (MAXLEN = 4, REJECTLONG = true); +ALTER TEXT SEARCH DICTIONARY + + + or create new dictionaries based on the template. + + + + To test the dictionary, you can try + + +mydb# select ts_lexize('intdict', '12345678'); + ts_lexize +----------- + {123456} + + + but real-world usage will involve including it in a text search + configuration as described in . + That might look like this: + + +ALTER TEXT SEARCH CONFIGURATION english + ALTER MAPPING FOR int, uint WITH intdict; + + + + + + diff --git a/doc/src/sgml/dict-xsyn.sgml b/doc/src/sgml/dict-xsyn.sgml new file mode 100644 index 0000000000..8126075ed6 --- /dev/null +++ b/doc/src/sgml/dict-xsyn.sgml @@ -0,0 +1,78 @@ + + dict_xsyn + + + dict_xsyn + + + + 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. + + + + Configuration + + A dict_xsyn dictionary accepts the following options: + + + + + KEEPORIG controls whether the original word is included, or only its + synonyms. Default is 'true'. + + + + + 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). + + + + + The rules file has the following format: + + + + + Each line represents a group of synonyms for a single word, which is + given first on the line. Synonyms are separated by whitespace: + + +word syn1 syn2 syn3 + + + + + Sharp ('#') sign is a comment delimiter. It may appear at any position + inside the line. The rest of the line will be skipped. + + + + + + Look at xsyn_sample.rules, which is installed in $(prefix)/share/tsearch_data/, + for an example. + + + + + Usage + +mydb=# SELECT ts_lexize('xsyn','word'); +ts_lexize +---------------- +{word,syn1,syn2,syn3) + + + Change dictionary options: + + +mydb# ALTER TEXT SEARCH DICTIONARY xsyn (KEEPORIG=false); +ALTER TEXT SEARCH DICTIONARY + + + + diff --git a/doc/src/sgml/filelist.sgml b/doc/src/sgml/filelist.sgml index 6857e8dda7..1a5064660b 100644 --- a/doc/src/sgml/filelist.sgml +++ b/doc/src/sgml/filelist.sgml @@ -1,4 +1,4 @@ - + @@ -96,6 +96,8 @@ + +