pg_kaasearch 1.0.0

This Release
pg_kaasearch 1.0.0
Date
Status
Stable
Latest Stable
pg_kaasearch 1.0.1 —
Other Releases
Abstract
Full-text search for the Karakalpak language
Description
A text search configuration, dictionary and rule-based stemmer for Karakalpak. It finds every form of a word, searches Latin and Cyrillic text alike, reads the old apostrophe spelling and drops stop words.
Released By
turdibek
License
MIT
Resources
Special Files
Tags

Extensions

pg_kaasearch 1.0.0
Full-text search for the Karakalpak language

Documentation

kinship
kinship
numerals
numerals
function_words
function_words
elision
elision
README
kaastem — a stemmer for the Karakalpak language
voice_stop
voice_stop
bare_stems
bare_stems
protected
protected
gi_bases
gi_bases
idempotence_forms
idempotence_forms

README

pg_kaasearch

Full-text search for the Karakalpak language in PostgreSQL. It finds every form of a word, searches Latin and Cyrillic text alike, reads the apostrophe spelling and drops stop words.

Example

CREATE EXTENSION pg_kaasearch;

SELECT to_tsvector('kaasearch', 'Bizler mektebimizde jańa kitaplardı oqıdıq.');
-- 'jańa':3 'kitap':4 'mektep':2 'oqı':5

SELECT to_tsvector('kaasearch', 'Мектепке барған балалар китап оқыйды.')
    @@ to_tsquery('kaasearch', 'mektep & kitap');
-- true

Benchmarks

Measured on 262,582 Karakalpak documents (news, health and parallel texts, 13 million words); the numbers are in docs/bench/results.json.

Documents found

Search time

Stemmer accuracy

Indexing time

Install

Docker (PostgreSQL 15–18, the extension is already enabled):

docker run -e POSTGRES_PASSWORD=secret -p 5432:5432 ghcr.io/erinshek/pg_kaasearch:pg18

Ubuntu / Debian: download the package for your system and PostgreSQL version from Releases, then:

sudo apt install ./postgresql-18-kaasearch_1.0.0-1.noble_amd64.deb

From source (needs the PostgreSQL development files, a C compiler and make):

git clone https://github.com/erinshek/pg-kaasearch.git
cd pg-kaasearch
make && sudo make install

Then enable it in your database (it must use the UTF8 encoding):

CREATE EXTENSION pg_kaasearch;

Usage

-- index a text column once
CREATE INDEX ON articles USING gin (to_tsvector('kaasearch', body));

-- search it: finds mektebimizde, mektepke, Мектепке ...
SELECT title FROM articles
WHERE to_tsvector('kaasearch', body) @@ websearch_to_tsquery('kaasearch', 'mektep');

License

MIT License