pg_tokenizer
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_tokenizer | 0.1.1 | FTS | Apache-2.0 | Rust |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 2160 | pg_tokenizer | No | Yes | Yes | Yes | No | No | tokenizer_catalog |
| Related | pgroonga pg_jieba pg_cjk_parser zhparser pg_bigm pg_tiktoken pg_tiktoken_c unaccent dict_xsyn dict_int hunspell_cs_cz pg_kazsearch |
|---|
PG18 fix by Vonng.
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.1.1 | 1817161514 | pg_tokenizer | - |
| RPM | PIGSTY | 0.1.1 | 1817161514 | pg_tokenizer_$v | - |
| DEB | PIGSTY | 0.1.1 | 1817161514 | postgresql-$v-pg-tokenizer | - |
Build
You can build the RPM / DEB packages for pg_tokenizer using pig build:
Install
You can install pg_tokenizer directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Preload:
Create Extension:
Usage
pg_tokenizer is a PostgreSQL extension that provides tokenizers for full-text search. It is designed to work with VectorChord-bm25 for native BM25 ranking index support.
Quick Start
Tokenizer Models
pg_tokenizer supports multiple tokenizer models for different languages and use cases:
| Model | Language | Description |
|---|---|---|
llmlingua2 | English | BERT-based tokenizer from LLMLingua2 |
jieba | Chinese | Jieba Chinese text segmentation |
lindera/ipadic | Japanese | Lindera tokenizer with IPADIC dictionary |
| Custom models | Any | User-trained models for domain-specific text |
Creating Tokenizers
Tokenizing Text
Text Analyzer
pg_tokenizer also provides text analyzer functionality that combines tokenization with additional text processing steps. For detailed text analyzer usage, refer to the Text Analyzer documentation.
Integration with VectorChord-BM25
pg_tokenizer is typically used together with VectorChord-BM25 for full BM25 ranking support:
Documentation
For more details, see the full documentation:
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)