Software: Apache/2.2.22 (Debian). PHP/5.6.36 uname -a: Linux h05.hvosting.ua 4.9.110-amd64 #3 SMP Sun Nov 4 16:27:09 UTC 2018 x86_64 uid=1389(h33678) gid=1099(h33678) groups=1099(h33678),502(mgrsecure) Safe-mode: OFF (not secure) /usr/share/doc/postgresql-doc-9.1/html/ drwxr-xr-x |
Viewing file: Select action/file-type:
F.11. dict_xsyndict_xsyn (Extended Synonym Dictionary) is an example of an add-on dictionary template for full-text search. This dictionary type replaces words with groups of their synonyms, and so makes it possible to search for a word using any of its synonyms. F.11.1. ConfigurationA dict_xsyn dictionary accepts the following options:
The rules file has the following format:
Look at xsyn_sample.rules, which is installed in $SHAREDIR/tsearch_data/, for an example. F.11.2. UsageInstalling the dict_xsyn extension creates a text search template xsyn_template and a dictionary xsyn based on it, with default parameters. You can alter the parameters, for example mydb# ALTER TEXT SEARCH DICTIONARY xsyn (RULES='my_rules', KEEPORIG=false); ALTER TEXT SEARCH DICTIONARY or create new dictionaries based on the template. To test the dictionary, you can try mydb=# SELECT ts_lexize('xsyn', 'word'); ts_lexize ----------------------- {syn1,syn2,syn3} mydb# ALTER TEXT SEARCH DICTIONARY xsyn (RULES='my_rules', KEEPORIG=true); ALTER TEXT SEARCH DICTIONARY mydb=# SELECT ts_lexize('xsyn', 'word'); ts_lexize ----------------------- {word,syn1,syn2,syn3} mydb# ALTER TEXT SEARCH DICTIONARY xsyn (RULES='my_rules', KEEPORIG=false, MATCHSYNONYMS=true); ALTER TEXT SEARCH DICTIONARY mydb=# SELECT ts_lexize('xsyn', 'syn1'); ts_lexize ----------------------- {syn1,syn2,syn3} mydb# ALTER TEXT SEARCH DICTIONARY xsyn (RULES='my_rules', KEEPORIG=true, MATCHORIG=false, KEEPSYNONYMS=false); ALTER TEXT SEARCH DICTIONARY mydb=# SELECT ts_lexize('xsyn', 'syn1'); ts_lexize ----------------------- {word} Real-world usage will involve including it in a text search configuration as described in Chapter 12. That might look like this: ALTER TEXT SEARCH CONFIGURATION english ALTER MAPPING FOR word, asciiword WITH xsyn, english_stem;
|
:: Command execute :: | |
--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by PinoyWH1Z | C99Shell Github | Generation time: 0.0404 ]-- |