dict_int
text search dictionary template for integers
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
dict_int | 1.0 | FUNC | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 4980 | dict_int | No | Yes | No | Yes | Yes | No | - |
| Related | dict_xsyn 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_int;
Usage
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
| Parameter | Description | Default |
|---|---|---|
maxlen | Maximum number of digits allowed | 6 |
rejectlong | If true, reject overlength integers (stop word). If false, truncate. | false |
absval | If true, strip leading +/- before applying maxlen | false |
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;
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.