dict_xsyn
text search dictionary template for extended synonym processing
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
dict_xsyn | 1.0 | FUNC | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 4900 | dict_xsyn | No | Yes | No | Yes | No | No | - |
| Related | dict_int unaccent pg_similarity smlar pg_summarize pg_search pgroonga pg_bigm |
|---|
Version
| PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|
| 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
Install
Note: This is a built-in contrib extension of PostgreSQL
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 syn3
Lines 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;
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.