Skip to content

pg_icu_parser

Full text search parser using ICU boundary analysis

pg_icu_parser · Full text search parser using ICU boundary analysis

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
2300pg_icu_parserpg_icu_parser1.0FTSMPL-2.0C
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--s-d-rNoYesNoYesyesno
ts_headline unsupported.

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXTPIGSTY1.019 18 17 16 15pg_icu_parser-
RPMPIGSTY1.0.019 18 17 16 15pg_icu_parser_$v-
DEBPIGSTY1.0.019 18 17 16 15postgresql-$v-pg-icu-parser-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0
el8.aarch64N/APIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0
el9.x86_64PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0
el9.aarch64PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0
el10.x86_64PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0
el10.aarch64PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0
d12.x86_64PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0
d12.aarch64PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0
d13.x86_64PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0
d13.aarch64PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0
u22.x86_64PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0
u22.aarch64PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0
u24.x86_64PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0
u24.aarch64PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0
u26.x86_64PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0
u26.aarch64PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0PIGSTY 1.0.0
PackageVersionOSORGSIZEFile URL
pg_icu_parser_191.0.0el9.x86_64pigsty29.0 KiBpg_icu_parser_19-1.0.0-1PGSTY.el9.x86_64.rpm
pg_icu_parser_191.0.0el9.aarch64pigsty28.8 KiBpg_icu_parser_19-1.0.0-1PGSTY.el9.aarch64.rpm
pg_icu_parser_191.0.0el10.x86_64pigsty28.6 KiBpg_icu_parser_19-1.0.0-1PGSTY.el10.x86_64.rpm
pg_icu_parser_191.0.0el10.aarch64pigsty28.9 KiBpg_icu_parser_19-1.0.0-1PGSTY.el10.aarch64.rpm
postgresql-19-pg-icu-parser1.0.0d12.x86_64pigsty20.0 KiBpostgresql-19-pg-icu-parser_1.0.0-1PGSTY~bookworm_amd64.deb
postgresql-19-pg-icu-parser1.0.0d12.aarch64pigsty19.8 KiBpostgresql-19-pg-icu-parser_1.0.0-1PGSTY~bookworm_arm64.deb
postgresql-19-pg-icu-parser1.0.0d13.x86_64pigsty20.0 KiBpostgresql-19-pg-icu-parser_1.0.0-1PGSTY~trixie_amd64.deb
postgresql-19-pg-icu-parser1.0.0d13.aarch64pigsty19.9 KiBpostgresql-19-pg-icu-parser_1.0.0-1PGSTY~trixie_arm64.deb
postgresql-19-pg-icu-parser1.0.0u22.x86_64pigsty20.8 KiBpostgresql-19-pg-icu-parser_1.0.0-1PGSTY~jammy_amd64.deb
postgresql-19-pg-icu-parser1.0.0u22.aarch64pigsty20.9 KiBpostgresql-19-pg-icu-parser_1.0.0-1PGSTY~jammy_arm64.deb
postgresql-19-pg-icu-parser1.0.0u24.x86_64pigsty21.0 KiBpostgresql-19-pg-icu-parser_1.0.0-1PGSTY~noble_amd64.deb
postgresql-19-pg-icu-parser1.0.0u24.aarch64pigsty20.5 KiBpostgresql-19-pg-icu-parser_1.0.0-1PGSTY~noble_arm64.deb
postgresql-19-pg-icu-parser1.0.0u26.x86_64pigsty20.7 KiBpostgresql-19-pg-icu-parser_1.0.0-1PGSTY~resolute_amd64.deb
postgresql-19-pg-icu-parser1.0.0u26.aarch64pigsty20.9 KiBpostgresql-19-pg-icu-parser_1.0.0-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_icu_parser_181.0.0el8.x86_64pigsty28.2 KiBpg_icu_parser_18-1.0.0-1PGSTY.el8.x86_64.rpm
pg_icu_parser_181.0.0el8.aarch64pigsty28.6 KiBpg_icu_parser_18-1.0.0-1PGSTY.el8.aarch64.rpm
pg_icu_parser_181.0.0el9.x86_64pigsty29.0 KiBpg_icu_parser_18-1.0.0-1PGSTY.el9.x86_64.rpm
pg_icu_parser_181.0.0el9.aarch64pigsty28.8 KiBpg_icu_parser_18-1.0.0-1PGSTY.el9.aarch64.rpm
pg_icu_parser_181.0.0el10.x86_64pigsty28.6 KiBpg_icu_parser_18-1.0.0-1PGSTY.el10.x86_64.rpm
pg_icu_parser_181.0.0el10.aarch64pigsty28.9 KiBpg_icu_parser_18-1.0.0-1PGSTY.el10.aarch64.rpm
postgresql-18-pg-icu-parser1.0.0d12.x86_64pigsty20.0 KiBpostgresql-18-pg-icu-parser_1.0.0-1PGSTY~bookworm_amd64.deb
postgresql-18-pg-icu-parser1.0.0d12.aarch64pigsty19.9 KiBpostgresql-18-pg-icu-parser_1.0.0-1PGSTY~bookworm_arm64.deb
postgresql-18-pg-icu-parser1.0.0d13.x86_64pigsty20.0 KiBpostgresql-18-pg-icu-parser_1.0.0-1PGSTY~trixie_amd64.deb
postgresql-18-pg-icu-parser1.0.0d13.aarch64pigsty19.9 KiBpostgresql-18-pg-icu-parser_1.0.0-1PGSTY~trixie_arm64.deb
postgresql-18-pg-icu-parser1.0.0u22.x86_64pigsty20.8 KiBpostgresql-18-pg-icu-parser_1.0.0-1PGSTY~jammy_amd64.deb
postgresql-18-pg-icu-parser1.0.0u22.aarch64pigsty20.9 KiBpostgresql-18-pg-icu-parser_1.0.0-1PGSTY~jammy_arm64.deb
postgresql-18-pg-icu-parser1.0.0u24.x86_64pigsty21.0 KiBpostgresql-18-pg-icu-parser_1.0.0-1PGSTY~noble_amd64.deb
postgresql-18-pg-icu-parser1.0.0u24.aarch64pigsty20.5 KiBpostgresql-18-pg-icu-parser_1.0.0-1PGSTY~noble_arm64.deb
postgresql-18-pg-icu-parser1.0.0u26.x86_64pigsty20.7 KiBpostgresql-18-pg-icu-parser_1.0.0-1PGSTY~resolute_amd64.deb
postgresql-18-pg-icu-parser1.0.0u26.aarch64pigsty20.9 KiBpostgresql-18-pg-icu-parser_1.0.0-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_icu_parser_171.0.0el8.x86_64pigsty28.2 KiBpg_icu_parser_17-1.0.0-1PGSTY.el8.x86_64.rpm
pg_icu_parser_171.0.0el8.aarch64pigsty28.5 KiBpg_icu_parser_17-1.0.0-1PGSTY.el8.aarch64.rpm
pg_icu_parser_171.0.0el9.x86_64pigsty29.0 KiBpg_icu_parser_17-1.0.0-1PGSTY.el9.x86_64.rpm
pg_icu_parser_171.0.0el9.aarch64pigsty28.8 KiBpg_icu_parser_17-1.0.0-1PGSTY.el9.aarch64.rpm
pg_icu_parser_171.0.0el10.x86_64pigsty28.6 KiBpg_icu_parser_17-1.0.0-1PGSTY.el10.x86_64.rpm
pg_icu_parser_171.0.0el10.aarch64pigsty28.8 KiBpg_icu_parser_17-1.0.0-1PGSTY.el10.aarch64.rpm
postgresql-17-pg-icu-parser1.0.0d12.x86_64pigsty19.9 KiBpostgresql-17-pg-icu-parser_1.0.0-1PGSTY~bookworm_amd64.deb
postgresql-17-pg-icu-parser1.0.0d12.aarch64pigsty19.8 KiBpostgresql-17-pg-icu-parser_1.0.0-1PGSTY~bookworm_arm64.deb
postgresql-17-pg-icu-parser1.0.0d13.x86_64pigsty19.9 KiBpostgresql-17-pg-icu-parser_1.0.0-1PGSTY~trixie_amd64.deb
postgresql-17-pg-icu-parser1.0.0d13.aarch64pigsty19.9 KiBpostgresql-17-pg-icu-parser_1.0.0-1PGSTY~trixie_arm64.deb
postgresql-17-pg-icu-parser1.0.0u22.x86_64pigsty21.5 KiBpostgresql-17-pg-icu-parser_1.0.0-1PGSTY~jammy_amd64.deb
postgresql-17-pg-icu-parser1.0.0u22.aarch64pigsty21.6 KiBpostgresql-17-pg-icu-parser_1.0.0-1PGSTY~jammy_arm64.deb
postgresql-17-pg-icu-parser1.0.0u24.x86_64pigsty21.0 KiBpostgresql-17-pg-icu-parser_1.0.0-1PGSTY~noble_amd64.deb
postgresql-17-pg-icu-parser1.0.0u24.aarch64pigsty20.4 KiBpostgresql-17-pg-icu-parser_1.0.0-1PGSTY~noble_arm64.deb
postgresql-17-pg-icu-parser1.0.0u26.x86_64pigsty20.7 KiBpostgresql-17-pg-icu-parser_1.0.0-1PGSTY~resolute_amd64.deb
postgresql-17-pg-icu-parser1.0.0u26.aarch64pigsty20.9 KiBpostgresql-17-pg-icu-parser_1.0.0-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_icu_parser_161.0.0el8.x86_64pigsty28.1 KiBpg_icu_parser_16-1.0.0-1PGSTY.el8.x86_64.rpm
pg_icu_parser_161.0.0el8.aarch64pigsty28.5 KiBpg_icu_parser_16-1.0.0-1PGSTY.el8.aarch64.rpm
pg_icu_parser_161.0.0el9.x86_64pigsty29.0 KiBpg_icu_parser_16-1.0.0-1PGSTY.el9.x86_64.rpm
pg_icu_parser_161.0.0el9.aarch64pigsty28.8 KiBpg_icu_parser_16-1.0.0-1PGSTY.el9.aarch64.rpm
pg_icu_parser_161.0.0el10.x86_64pigsty28.6 KiBpg_icu_parser_16-1.0.0-1PGSTY.el10.x86_64.rpm
pg_icu_parser_161.0.0el10.aarch64pigsty28.8 KiBpg_icu_parser_16-1.0.0-1PGSTY.el10.aarch64.rpm
postgresql-16-pg-icu-parser1.0.0d12.x86_64pigsty20.0 KiBpostgresql-16-pg-icu-parser_1.0.0-1PGSTY~bookworm_amd64.deb
postgresql-16-pg-icu-parser1.0.0d12.aarch64pigsty19.8 KiBpostgresql-16-pg-icu-parser_1.0.0-1PGSTY~bookworm_arm64.deb
postgresql-16-pg-icu-parser1.0.0d13.x86_64pigsty19.9 KiBpostgresql-16-pg-icu-parser_1.0.0-1PGSTY~trixie_amd64.deb
postgresql-16-pg-icu-parser1.0.0d13.aarch64pigsty19.9 KiBpostgresql-16-pg-icu-parser_1.0.0-1PGSTY~trixie_arm64.deb
postgresql-16-pg-icu-parser1.0.0u22.x86_64pigsty21.5 KiBpostgresql-16-pg-icu-parser_1.0.0-1PGSTY~jammy_amd64.deb
postgresql-16-pg-icu-parser1.0.0u22.aarch64pigsty21.6 KiBpostgresql-16-pg-icu-parser_1.0.0-1PGSTY~jammy_arm64.deb
postgresql-16-pg-icu-parser1.0.0u24.x86_64pigsty21.0 KiBpostgresql-16-pg-icu-parser_1.0.0-1PGSTY~noble_amd64.deb
postgresql-16-pg-icu-parser1.0.0u24.aarch64pigsty20.4 KiBpostgresql-16-pg-icu-parser_1.0.0-1PGSTY~noble_arm64.deb
postgresql-16-pg-icu-parser1.0.0u26.x86_64pigsty20.7 KiBpostgresql-16-pg-icu-parser_1.0.0-1PGSTY~resolute_amd64.deb
postgresql-16-pg-icu-parser1.0.0u26.aarch64pigsty20.9 KiBpostgresql-16-pg-icu-parser_1.0.0-1PGSTY~resolute_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_icu_parser_151.0.0el8.x86_64pigsty28.2 KiBpg_icu_parser_15-1.0.0-1PGSTY.el8.x86_64.rpm
pg_icu_parser_151.0.0el8.aarch64pigsty28.5 KiBpg_icu_parser_15-1.0.0-1PGSTY.el8.aarch64.rpm
pg_icu_parser_151.0.0el9.x86_64pigsty29.0 KiBpg_icu_parser_15-1.0.0-1PGSTY.el9.x86_64.rpm
pg_icu_parser_151.0.0el9.aarch64pigsty28.8 KiBpg_icu_parser_15-1.0.0-1PGSTY.el9.aarch64.rpm
pg_icu_parser_151.0.0el10.x86_64pigsty28.6 KiBpg_icu_parser_15-1.0.0-1PGSTY.el10.x86_64.rpm
pg_icu_parser_151.0.0el10.aarch64pigsty28.8 KiBpg_icu_parser_15-1.0.0-1PGSTY.el10.aarch64.rpm
postgresql-15-pg-icu-parser1.0.0d12.x86_64pigsty20.1 KiBpostgresql-15-pg-icu-parser_1.0.0-1PGSTY~bookworm_amd64.deb
postgresql-15-pg-icu-parser1.0.0d12.aarch64pigsty19.8 KiBpostgresql-15-pg-icu-parser_1.0.0-1PGSTY~bookworm_arm64.deb
postgresql-15-pg-icu-parser1.0.0d13.x86_64pigsty20.0 KiBpostgresql-15-pg-icu-parser_1.0.0-1PGSTY~trixie_amd64.deb
postgresql-15-pg-icu-parser1.0.0d13.aarch64pigsty19.9 KiBpostgresql-15-pg-icu-parser_1.0.0-1PGSTY~trixie_arm64.deb
postgresql-15-pg-icu-parser1.0.0u22.x86_64pigsty21.5 KiBpostgresql-15-pg-icu-parser_1.0.0-1PGSTY~jammy_amd64.deb
postgresql-15-pg-icu-parser1.0.0u22.aarch64pigsty21.6 KiBpostgresql-15-pg-icu-parser_1.0.0-1PGSTY~jammy_arm64.deb
postgresql-15-pg-icu-parser1.0.0u24.x86_64pigsty21.1 KiBpostgresql-15-pg-icu-parser_1.0.0-1PGSTY~noble_amd64.deb
postgresql-15-pg-icu-parser1.0.0u24.aarch64pigsty20.4 KiBpostgresql-15-pg-icu-parser_1.0.0-1PGSTY~noble_arm64.deb
postgresql-15-pg-icu-parser1.0.0u26.x86_64pigsty20.7 KiBpostgresql-15-pg-icu-parser_1.0.0-1PGSTY~resolute_amd64.deb
postgresql-15-pg-icu-parser1.0.0u26.aarch64pigsty20.9 KiBpostgresql-15-pg-icu-parser_1.0.0-1PGSTY~resolute_arm64.deb

Source

pig build pkg pg_icu_parser;		# 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 pg_icu_parser;		# install by package name

pig install pg_icu_parser -v 19;   # install for PG 19
pig install pg_icu_parser -v 18;   # install for PG 18
pig install pg_icu_parser -v 17;   # install for PG 17
pig install pg_icu_parser -v 16;   # install for PG 16
pig install pg_icu_parser -v 15;   # install for PG 15

Create this extension with:

CREATE EXTENSION pg_icu_parser;

Usage

Sources:

pg_icu_parser supplies the icu_parser full-text-search parser, which uses ICU Unicode word-boundary analysis. It is useful for languages such as Chinese, Japanese, Korean, and Hebrew where PostgreSQL’s whitespace- and pattern-oriented default parser may not produce suitable word boundaries.

Core Workflow

The server must be PostgreSQL 10 or later and must have been built with ICU support. Create the extension, then create a text-search configuration that selects its parser and maps the token types you need:

CREATE EXTENSION pg_icu_parser;

CREATE TEXT SEARCH CONFIGURATION sample (PARSER = icu_parser);
ALTER TEXT SEARCH CONFIGURATION sample
  ADD MAPPING FOR word WITH english_stem;
ALTER TEXT SEARCH CONFIGURATION sample
  ADD MAPPING FOR number, ideo, kana WITH simple;

SELECT to_tsvector('sample', '東京でPostgreSQLを使う');

Choose dictionaries for the actual language; english_stem above only demonstrates the mapping syntax.

Parser Surface

  • word, number, kana, ideo, and blank are the token types emitted by icu_parser.
  • pg_icu_parser.locale selects the ICU locale and defaults to en. Upstream notes that word-boundary rules are usually not locale-sensitive, so change it only after testing a concrete need.
  • Any PostgreSQL text-search dictionary can be mapped to the emitted token types.

Trade-offs

  • The parser requires ICU in the PostgreSQL build; creating the extension cannot add ICU to a server built without it.
  • It emits fewer and coarser token types than the default parser and does not recognize special patterns such as URLs or email addresses as distinct categories.
  • The reviewed release does not support ts_headline.
  • Upstream reports that it is slower than the default parser, with a lower conversion overhead when the database encoding is UTF-8. Benchmark representative documents and query shapes on the target system.
  • When parser mappings or locale behavior change, rebuild stored tsvector values and dependent indexes so old and new rows do not use different tokenization.

Table reader