pg_kazsearch

Kazakh full-text search extension for PostgreSQL

Overview

PackageVersionCategoryLicenseLanguage
pg_kazsearch0.1.0FTSLGPL-3.0Rust
IDExtensionBinLibLoadCreateTrustRelocSchema
2200pg_kazsearchNoYesNoYesNoNo-

Upstream release/package version is 2.0.0; extension control version is 0.1.0.

Version

TypeRepoVersionPG VerPackageDeps
EXTPIGSTY0.1.01817161514pg_kazsearch-
RPMPIGSTY2.0.01817161514pg_kazsearch_$v-
DEBPIGSTY2.0.01817161514postgresql-$v-pg-kazsearch-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64PIGSTY MISSPIGSTY MISS
el8.aarch64PIGSTY MISSPIGSTY MISS
el9.x86_64PIGSTY MISSPIGSTY MISS
el9.aarch64PIGSTY MISSPIGSTY MISS
el10.x86_64PIGSTY MISSPIGSTY MISS
el10.aarch64PIGSTY MISSPIGSTY MISS
d12.x86_64PIGSTY MISSPIGSTY MISS
d12.aarch64
PIGSTY 2.0.0
PIGSTY 2.0.0
PIGSTY 2.0.0
PIGSTY MISSPIGSTY MISS
d13.x86_64
PIGSTY 2.0.0
PIGSTY 2.0.0
PIGSTY 2.0.0
PIGSTY MISSPIGSTY MISS
d13.aarch64
PIGSTY 2.0.0
PIGSTY 2.0.0
PIGSTY 2.0.0
PIGSTY MISSPIGSTY MISS
u22.x86_64
PIGSTY 2.0.0
PIGSTY 2.0.0
PIGSTY 2.0.0
PIGSTY MISSPIGSTY MISS
u22.aarch64
PIGSTY 2.0.0
PIGSTY 2.0.0
PIGSTY 2.0.0
PIGSTY MISSPIGSTY MISS
u24.x86_64
PIGSTY 2.0.0
PIGSTY 2.0.0
PIGSTY 2.0.0
PIGSTY MISSPIGSTY MISS
u24.aarch64
PIGSTY 2.0.0
PIGSTY 2.0.0
PIGSTY 2.0.0
PIGSTY MISSPIGSTY MISS

Build

You can build the RPM / DEB packages for pg_kazsearch using pig build:

pig build pkg pg_kazsearch         # build RPM / DEB packages

Install

You can install pg_kazsearch directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:

pig repo add pgsql -u          # Add repo and update cache

Install the extension using pig or apt/yum/dnf:

pig install pg_kazsearch;          # Install for current active PG version
pig ext install -y pg_kazsearch -v 18  # PG 18
pig ext install -y pg_kazsearch -v 17  # PG 17
pig ext install -y pg_kazsearch -v 16  # PG 16
dnf install -y pg_kazsearch_18       # PG 18
dnf install -y pg_kazsearch_17       # PG 17
dnf install -y pg_kazsearch_16       # PG 16
apt install -y postgresql-18-pg-kazsearch   # PG 18
apt install -y postgresql-17-pg-kazsearch   # PG 17
apt install -y postgresql-16-pg-kazsearch   # PG 16

Create Extension:

CREATE EXTENSION pg_kazsearch;

Usage

Sources: README, releases

pg_kazsearch is a PostgreSQL full-text search extension for the Kazakh language. The README says it creates a ready-to-use text search configuration kazakh_cfg and dictionary pg_kazsearch_dict.

Quick start

CREATE EXTENSION pg_kazsearch;

SELECT ts_lexize('pg_kazsearch_dict', 'алмаларымыздағы');
-- {алма}

SELECT to_tsvector('kazakh_cfg', 'президенттің жарлығы');
-- 'жарлық':2 'президент':1

Add Kazakh FTS to a table

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 idx_fts 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
LIMIT 10;

Tuning

The README documents runtime dictionary tuning without restart:

ALTER TEXT SEARCH DICTIONARY pg_kazsearch_dict
  (w_deriv = 3.5, w_short_char = 100.0);

Release and packaging notes

  • Upstream release v2.0.0 introduced the current Rust / pgrx architecture.
  • Upstream release v2.1.0 adds an Elasticsearch plugin alongside the PostgreSQL extension; the PostgreSQL SQL usage in the README is unchanged.
  • The repository README publishes Debian packages as 2.x releases, while this project’s CSV note separately tracks the extension control version.

Caveat

The PostgreSQL-facing docs are concise and focused on stemming plus FTS usage. For this stub, avoid inferring extra SQL objects beyond kazakh_cfg, pg_kazsearch_dict, and the documented examples above.


Last Modified 2026-04-19: update extension stub docs (9f178c3)