dict_int

text search dictionary template for integers

Overview

PackageVersionCategoryLicenseLanguage
dict_int1.0FUNCPostgreSQLC
IDExtensionBinLibLoadCreateTrustRelocSchema
4980dict_intNoYesNoYesYesNo-
Relateddict_xsyn unaccent pg_tokenizer pgroonga pg_kazsearch pg_jieba pg_cjk_parser zhparser

Version

PG18PG17PG16PG15PG14
1.01.01.01.01.0

Install

Note: This is a built-in contrib extension of PostgreSQL

CREATE EXTENSION dict_int;

Usage

dict_int: integer text search dictionary

Controls the indexing of integers in full-text search to prevent excessive unique-word growth that degrades search performance.

CREATE EXTENSION dict_int;

Configuration Parameters

ParameterDescriptionDefault
maxlenMaximum number of digits allowed6
rejectlongIf true, reject overlength integers (stop word). If false, truncate.false
absvalIf true, strip leading +/- before applying maxlenfalse

Examples

-- Test the default dictionary
SELECT ts_lexize('intdict', '12345678');
-- {123456}  (truncated to 6 digits by default)

-- Configure to reject long integers
ALTER TEXT SEARCH DICTIONARY intdict (MAXLEN = 4, REJECTLONG = true);
SELECT ts_lexize('intdict', '12345');
-- {}  (rejected as stop word)

SELECT ts_lexize('intdict', '1234');
-- {1234}  (accepted)

-- Apply to a text search configuration
ALTER TEXT SEARCH CONFIGURATION english
  ALTER MAPPING FOR int, uint WITH intdict;

Last Modified: 2026-07-30: extension update 2026-07-30 (7219c44)