dict_xsyn
dict_xsyn
dict_xsyn : text search dictionary template for extended synonym processing
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 4900 | dict_xsyn
|
dict_xsyn
|
1.0 |
FUNC
|
PostgreSQL
|
C
|
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
--s-d--
|
No
|
Yes
|
No
|
Yes
|
no
|
no
|
| Relationships | |
|---|---|
| See Also | dict_int
unaccent
pg_similarity
smlar
pg_summarize
pg_search
pgroonga
pg_bigm
|
Packages
| PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|
1.0
|
1.0
|
1.0
|
1.0
|
1.0
|
This is a built-in contrib extension ship with the PostgreSQL kernel
Install
Create this extension with:
CREATE EXTENSION dict_xsyn;Usage
Provides an extended synonym dictionary template for text search, replacing words with groups of synonyms.
CREATE EXTENSION dict_xsyn;Configuration Parameters
| Parameter | Description | Default |
|---|---|---|
matchorig |
Accept original word | true |
matchsynonyms |
Accept synonyms as input | false |
keeporig |
Include original in output | true |
keepsynonyms |
Include synonyms in output | true |
rules |
Base name of synonym file in $SHAREDIR/tsearch_data/ (.rules extension) |
– |
Rules File Format
word syn1 syn2 syn3Lines starting with # are comments.
Examples
-- Configure the dictionary
ALTER TEXT SEARCH DICTIONARY xsyn (RULES='my_rules', KEEPORIG=true);
-- Test the dictionary
SELECT ts_lexize('xsyn', 'word');
-- {word,syn1,syn2,syn3}
-- Match synonyms as input too
ALTER TEXT SEARCH DICTIONARY xsyn (RULES='my_rules', MATCHSYNONYMS=true);
SELECT ts_lexize('xsyn', 'syn1');
-- {syn1,syn2,syn3}
-- Use in a text search configuration
ALTER TEXT SEARCH CONFIGURATION english
ALTER MAPPING FOR word, asciiword WITH xsyn, english_stem;Last updated on