pg_jieba
pg_jieba : Chinese full-text search parser based on cppjieba
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 2240 | pg_jieba | pg_jieba | 1.1.0 |
FTS | BSD-3-Clause | C++ |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-r | No | Yes | No | Yes | yes | no |
| Relationships | |
|---|---|
| See Also | pg_cjk_parser pgroonga pg_tokenizer zhparser pg_bigm pg_pinyin pg_tiktoken pg_tiktoken_c unaccent dict_xsyn |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.1.0 |
18 17 16 15 14 | pg_jieba |
- |
| RPM | PIGSTY | 2.0.1 |
18 17 16 15 14 | pg_jieba_$v |
- |
| DEB | PIGSTY | 2.0.1 |
18 17 16 15 14 | postgresql-$v-pg-jieba |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 |
| el8.aarch64 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 |
| el9.x86_64 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 |
| el9.aarch64 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 |
| el10.x86_64 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 |
| el10.aarch64 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 |
| d12.x86_64 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 |
| d12.aarch64 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 |
| d13.x86_64 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 |
| d13.aarch64 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 |
| u22.x86_64 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 |
| u22.aarch64 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 |
| u24.x86_64 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 |
| u24.aarch64 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 |
| u26.x86_64 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 |
| u26.aarch64 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 | PIGSTY 2.0.1 |
Source
github.com/jaiminpan/pg_jieba
pg_jieba-2.0.1.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
Sources:
pg_jieba adds Jieba-based Chinese word segmentation to PostgreSQL full-text search. The upstream v2.0.1 source release installs SQL extension version 1.1.0, as recorded by its control file. It provides separate document and query parsers plus ready-to-use text-search configurations.
Core Workflow
Use jiebacfg to build searchable document vectors and jiebaqry to segment user queries:
Object Index
jieba: document text-search parser.jiebaqry: query-oriented text-search parser.jiebacfg: document text-search configuration usingjiebaandjieba_stem.jiebaqry: text-search configuration of the same name using the query parser.jieba_stem: simple dictionary with Jieba stop words used for the parser’s token categories.
Custom Dictionary and Caveats
Upstream reads a custom dictionary named jieba.user.dict.utf8 from PostgreSQL’s tsearch_data directory. Entries may contain a word and optional part-of-speech tag:
- The v2.x source requires a C++11-capable compiler because of its bundled
cppjiebadependency. - Upstream’s published compatibility testing is old and limited. Build and regression-test the package against the exact PostgreSQL major version used in production.
- Changing dictionaries changes tokenization. Recompute stored
tsvectorvalues and rebuild dependent indexes when dictionary output changes.