pg_kazsearch
pg_kazsearch : Kazakh full-text search extension for PostgreSQL
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 2200 | pg_kazsearch
|
pg_kazsearch
|
2.3.0 |
FTS
|
LGPL-3.0
|
Rust
|
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
--s-d--
|
No
|
Yes
|
No
|
Yes
|
no
|
no
|
Upstream 2.3.0 uses pgrx 0.17.0; PIGSTY packaging builds with pgrx 0.19.1 for PostgreSQL 16 through 18.
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY
|
2.3.0 |
18
17
16
15
14
|
pg_kazsearch |
- |
| RPM | PIGSTY
|
2.3.0 |
18
17
16
15
14
|
pg_kazsearch_$v |
- |
| DEB | PIGSTY
|
2.3.0 |
18
17
16
15
14
|
postgresql-$v-pg-kazsearch |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
el8.x86_64
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
N/A
|
N/A
|
el8.aarch64
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
N/A
|
N/A
|
el9.x86_64
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
N/A
|
N/A
|
el9.aarch64
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
N/A
|
N/A
|
el10.x86_64
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
N/A
|
N/A
|
el10.aarch64
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
N/A
|
N/A
|
d12.x86_64
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
N/A
|
N/A
|
d12.aarch64
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
N/A
|
N/A
|
d13.x86_64
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
N/A
|
N/A
|
d13.aarch64
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
N/A
|
N/A
|
u22.x86_64
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
N/A
|
N/A
|
u22.aarch64
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
N/A
|
N/A
|
u24.x86_64
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
N/A
|
N/A
|
u24.aarch64
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
N/A
|
N/A
|
u26.x86_64
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
N/A
|
N/A
|
u26.aarch64
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
PIGSTY 2.3.0
|
N/A
|
N/A
|
Source
pig build pkg pg_kazsearch; # build rpm/debInstall
Make sure PGDG and PIGSTY repo available:
pig repo add pgsql -u # add both repo and update cacheInstall this extension with pig:
pig install pg_kazsearch; # install via package name, for the active PG version
pig install pg_kazsearch -v 18; # install for PG 18
pig install pg_kazsearch -v 17; # install for PG 17
pig install pg_kazsearch -v 16; # install for PG 16Create this extension with:
CREATE EXTENSION pg_kazsearch;Usage
Sources:
- Official v2.3.0 README
- v2.3.0 release
- PostgreSQL extension control file
- v2.2.0 to v2.3.0 upgrade SQL
pg_kazsearch provides Kazakh full-text stemming for PostgreSQL 16 through 18. It installs a ready-to-use kazakh_cfg configuration and pg_kazsearch_dict dictionary. Cyrillic and supported modern Latin-script Kazakh converge to canonical Cyrillic stems so documents and queries can match across scripts.
Core Workflow
CREATE EXTENSION pg_kazsearch;
SELECT ts_lexize('pg_kazsearch_dict', 'алмаларымыздағы');
-- {алма}
SELECT to_tsvector('kazakh_cfg', 'мектептеріміздегі оқушылардың');
-- 'мектеп':1 'оқушы':2Add a weighted stored vector and GIN index:
ALTER TABLE articles ADD COLUMN fts tsvector
GENERATED ALWAYS AS (
setweight(to_tsvector('kazakh_cfg', title), 'A') ||
setweight(to_tsvector('kazakh_cfg', body), 'B')
) STORED;
CREATE INDEX articles_fts_idx ON articles USING GIN (fts);
SELECT title
FROM articles
WHERE fts @@ websearch_to_tsquery('kazakh_cfg', 'президенттің жарлығы')
ORDER BY ts_rank_cd(
fts,
websearch_to_tsquery('kazakh_cfg', 'президенттің жарлығы')
) DESC;Dictionary Tuning
Penalty weights can be changed at runtime:
ALTER TEXT SEARCH DICTIONARY pg_kazsearch_dict
(w_deriv = 3.5, w_short_char = 100.0);The default script_mode = auto detects supported modern Kazakh Latin orthography and returns Cyrillic stems. Disable Latin handling when strict Cyrillic-only behavior is required:
ALTER TEXT SEARCH DICTIONARY pg_kazsearch_dict
(script_mode = cyrillic_only);Upgrade and Search Caveats
- Stemmer upgrades change index terms. After upgrading to
2.3.0, recompute storedtsvectorcolumns or repopulate trigger-maintained vectors, thenVACUUM (ANALYZE)the table.
ALTER EXTENSION pg_kazsearch UPDATE;
UPDATE articles SET title = title;
VACUUM (ANALYZE) articles;- Long-lived sessions opened before an upgrade should reconnect so they load the new dictionary.
- Latin support targets the modern orthography. Mixed-script input, legacy apostrophe/acute/digraph spellings, and low-confidence ASCII tokens may remain unchanged.
websearch_to_tsqueryuses strict AND semantics for ordinary terms. Applications that need broader recall should deliberately implement and measure a fallback query rather than silently changing all searches to OR.