跳转到主要内容

textsearch_intl

Multilingual full text search with ICU segmentation, normalization and n-gram matching

textsearch_intl : Multilingual full text search with ICU segmentation, normalization and n-gram matching

Overview

ID Extension Package Version Category License Language
2290 textsearch_intl textsearch_intl 1.0 FTS PostgreSQL C
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
--s-d-r No Yes No Yes yes no
Relationships
Requires unaccent
Renamed from icu_parser on 2026-10-09; version reset to SQL/control 1.0 (META 1.0.0). Current name is unreleased; latest GitHub/PGXN release remains icu_parser 1.1.0 (SQL 1.1). PostgreSQL 14-18, UTF8 and unaccent required; REINDEX affected indexes after an ICU major-version change. PIGSTY PG14-18 packages verified across EL8/9/10, Debian 12/13 and Ubuntu 22.04/24.04/26.04 on x86_64/amd64 and aarch64/arm64; all 16 platforms imported into the local PIGSTY repository.

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT PIGSTY 1.0 18 17 16 15 14 textsearch_intl unaccent
RPM PIGSTY 1.0.0 18 17 16 15 14 textsearch_intl_$v -
DEB PIGSTY 1.0.0 18 17 16 15 14 postgresql-$v-textsearch-intl -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64 MISS MISS MISS MISS MISS
el8.aarch64 MISS MISS MISS MISS MISS
el9.x86_64 MISS MISS MISS MISS MISS
el9.aarch64 MISS MISS MISS MISS MISS
el10.x86_64 MISS MISS MISS MISS MISS
el10.aarch64 MISS MISS MISS MISS MISS
d12.x86_64 MISS MISS MISS MISS MISS
d12.aarch64 MISS MISS MISS MISS MISS
d13.x86_64 MISS MISS MISS MISS MISS
d13.aarch64 MISS MISS MISS MISS MISS
u22.x86_64 MISS MISS MISS MISS MISS
u22.aarch64 MISS MISS MISS MISS MISS
u24.x86_64 MISS MISS MISS MISS MISS
u24.aarch64 MISS MISS MISS MISS MISS
u26.x86_64 MISS MISS MISS MISS MISS
u26.aarch64 MISS MISS MISS MISS MISS

Source

github.com/benjaminsanborn/textsearch_intl

pig build pkg textsearch_intl;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

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

Install this extension with pig:

pig install textsearch_intl;		# install via package name, for the active PG version

pig install textsearch_intl -v 18;   # install for PG 18
pig install textsearch_intl -v 17;   # install for PG 17
pig install textsearch_intl -v 16;   # install for PG 16
pig install textsearch_intl -v 15;   # install for PG 15
pig install textsearch_intl -v 14;   # install for PG 14

Create this extension with:

CREATE EXTENSION textsearch_intl CASCADE; -- requires unaccent

Usage

Sources:

textsearch_intl combines ICU word segmentation, normalization and n-gram matching for multilingual text search. It requires PostgreSQL 14 or later, a UTF8 database, ICU and unaccent; upstream CI covers PostgreSQL 14–18.

Name and Version

The project renamed icu_parser to textsearch_intl on 2026-10-09 and restarted versioning: the current source has SQL/control version 1.0 and META version 1.0.0. The latest published GitHub/PGXN release is still the old icu_parser distribution 1.1.0, with SQL version 1.1. The renamed source has no release tag or SQL upgrade script from the old name.

Core Workflow

CREATE EXTENSION textsearch_intl CASCADE;
SELECT alias, token FROM ts_debug('intl_simple', '東京駅前ラーメン店 ร้านกาแฟ Café');
SELECT to_tsvector('intl_search', 'Café') @@ phraseto_tsquery('intl_search', 'cafe');
SELECT to_tsvector('intl_search_ngram', '행복한편의점')
       @@ phraseto_tsquery('intl_search_ngram', '편의점');
SELECT intl_icu_version();

Search Configurations

  • intl_simple uses the intl parser and preserves accents and character widths.
  • intl_search combines intl_normalize, unaccent and intl_join for normalized whole-word search. Word joining is off by default.
  • intl_search_ngram uses intl_runs and intl_ngram to match inside Korean/CJK tokens and unspaced Thai, Lao, Khmer and Burmese runs. N-grams can overmatch and increase index size.

Operational Boundaries

Install with a superuser; the extension is relocatable, is not marked trusted and needs no preload. Prefer phraseto_tsquery() when word order matters. intl_icu_version() reports the loaded ICU version; rebuild affected indexes after an ICU major-version change. ICU segmentation is not Japanese morphological analysis, and partial CJK prefix queries remain unreliable.