dict_xsyn

dict_xsyn

dict_xsyn : text search dictionary template for extended synonym processing

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
4900
dict_xsyn
dict_xsyn
1.0
FUNC
PostgreSQL
C
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--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

PG18PG17PG16PG15PG14
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

dict_xsyn: extended synonym dictionary for text search

Provides an extended synonym dictionary template for text search, replacing words with groups of synonyms.

CREATE EXTENSION dict_xsyn;

Configuration Parameters

ParameterDescriptionDefault
matchorigAccept original wordtrue
matchsynonymsAccept synonyms as inputfalse
keeporigInclude original in outputtrue
keepsynonymsInclude synonyms in outputtrue
rulesBase 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;
Last updated on