Skip to content

Commit ccdea02

Browse files
committed
add pgroonga adapted docs
1 parent 95a776d commit ccdea02

4 files changed

Lines changed: 183 additions & 2 deletions

File tree

CN/modules/ROOT/nav.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
*** xref:master/5.4.adoc[pg_cron]
2020
*** xref:master/5.5.adoc[pgsql-http]
2121
*** xref:master/5.6.adoc[plpgsql_check]
22+
*** xref:master/5.7.adoc[pgroonga]
2223
** IvorySQL架构设计
2324
*** 查询处理
2425
**** xref:master/6.1.1.adoc[双parser]
@@ -34,7 +35,6 @@
3435
**** xref:master/6.3.7.adoc[嵌套子函数]
3536
**** xref:master/6.3.8.adoc[Force View]
3637
**** xref:master/6.3.9.adoc[大小写转换]
37-
*** xref:master/6.4.adoc[国标GB18030]
3838
*** 内置函数
3939
**** xref:master/6.4.1.adoc[sys_context]
4040
**** xref:master/6.4.2.adoc[userenv]
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
2+
:sectnums:
3+
:sectnumlevels: 5
4+
5+
= PGroonga
6+
7+
== 概述
8+
PostgreSQL 内置了全文搜索功能,但在处理​​大规模数据​​、​​复杂查询​​以及​​非英语语言(特别是中日韩等 CJK 语言)​​ 时,其功能和性能可能无法满足高性能应用的需求。
9+
10+
PGroonga 应运而生,它是一个 PostgreSQL 的扩展插件,将 ​​Groonga​​ 这款高性能的全功能全文搜索引擎与 PostgreSQL 数据库深度融合。Groonga 本身是一个优秀的开源搜索引擎,以其极致的速度和丰富的功能著称,尤其擅长处理多语言文本。PGroonga 的使命就是将 Groonga 的强大能力无缝地带入 PostgreSQL 的世界,为用户提供远超原生全文搜索的体验。
11+
12+
== 安装
13+
[NOTE]
14+
IvorySQL的安装包里已经集成了PGroonga插件,如果使用安装包安装的IvorySQL,通常不需要再手动安装PGroonga,直接跳过安装步骤即可。
15+
16+
用户可从 https://pgroonga.github.io/install[PGroonga package安装] 页面选择适合自己的方式进行PGroonga安装。
17+
18+
IvorySQL社区提供则补充源码安装步骤,以PGroonga v4.0.4为例。
19+
20+
=== 安装依赖
21+
22+
环境
23+
```
24+
操作系统:Ubuntu 24.04
25+
CPU架构:x86_64
26+
IvorySQL: v5.0
27+
```
28+
29+
==== 安装 msgpack-c
30+
31+
编译PGroonga,有个配置选项:HAVE_MSGPACK=1,它是用于支持WAL,使用这个选项需要安装msgpack-c 1.4.1或者更高版本。
32+
33+
```
34+
sudo apt install libmsgpack-dev
35+
```
36+
==== 安装 Groonga
37+
38+
确保Groonga >= 14.0.0
39+
40+
```
41+
sudo apt install groonga libgroonga-dev
42+
```
43+
验证Groonga安装成功
44+
```bash
45+
highgo@ubuntu:~/work/IvorySQL/inst$ groonga --version
46+
Groonga 15.1.7 [Linux,x86_64,utf8,match-escalation-threshold=0,nfkc,mecab,message-pack,mruby,onigmo,zlib,lz4,zstandard,epoll,apache-arrow,xxhash,blosc,h3,simdjson,llama.cpp]
47+
```
48+
49+
50+
=== 编译安装PGroonga
51+
52+
==== 下载解压源码
53+
54+
```bash
55+
wget https://packages.groonga.org/source/pgroonga/pgroonga-4.0.4.tar.gz
56+
tar xvf pgroonga-4.0.4.tar.gz
57+
cd pgroonga-4.0.4
58+
```
59+
==== 编译
60+
运行make前确保`pg_config`命令的路径在`PATH`环境变量里,例如IvorySQL安装的路径是`~/work/IvorySQL/inst`,则环境变量设置如下:
61+
62+
```bash
63+
export PGHOME=~/work/IvorySQL/inst
64+
export PGDATA=$PGHOME/data
65+
export PATH=$PGHOME/bin:$PATH
66+
```
67+
然后执行以下命令进行编译和安装:
68+
```bash
69+
make HAVE_MSGPACK=1
70+
make install
71+
```
72+
73+
== 创建Extension并确认PGroonga版本
74+
75+
76+
psql 连接到数据库的pg模式下,执行命令:
77+
```sql
78+
postgres=# CREATE extension pgroonga;
79+
CREATE EXTENSION
80+
postgres=# SELECT * FROM pg_available_extensions WHERE name = 'pgroonga';
81+
name | default_version | installed_version | comment
82+
----------+-----------------+-------------------+--------------------------------------------------------------------------------
83+
pgroonga | 4.0.4 | 4.0.4 | Super fast and all languages supported full text search index based on Groonga
84+
(1 row)
85+
86+
postgres=# select version();
87+
version
88+
--------------------------------------------------------------------------------
89+
PostgreSQL (IvorySQL 5.0) 18.0 on x86_64-linux, compiled by gcc-13.3.0, 64-bit
90+
(1 row)
91+
```
92+
93+
== 使用
94+
关于PGroonga的使用,请参阅 https://pgroonga.github.io/tutorial[PGroonga官方文档]

EN/modules/ROOT/nav.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
** xref:master/5.4.adoc[pg_cron]
1919
** xref:master/5.5.adoc[pgsql-http]
2020
** xref:master/5.6.adoc[plpgsql_check]
21+
** xref:master/5.7.adoc[pgroonga]
2122
* IvorySQL Architecture Design
2223
** Query Processing
2324
*** xref:master/6.1.1.adoc[Dual Parser]
@@ -33,7 +34,6 @@
3334
*** xref:master/6.3.7.adoc[Nested Subfunctions]
3435
*** xref:master/6.3.8.adoc[Force View]
3536
*** xref:master/6.3.9.adoc[Case Conversion]
36-
** xref:master/6.4.adoc[GB18030 Character Set]
3737
** Built-in Functions
3838
*** xref:master/6.4.1.adoc[sys_context]
3939
*** xref:master/6.4.2.adoc[userenv]
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
:sectnums:
2+
:sectnumlevels: 5
3+
4+
= PGroonga
5+
6+
== Overview
7+
PostgreSQL has built-in full-text search functionality, but when dealing with large-scale data, complex queries, and non-English languages (especially CJK languages like Chinese, Japanese, and Korean), its functionality and performance may not meet the requirements of high-performance applications.
8+
9+
PGroonga was created to address this need. It is a PostgreSQL extension that deeply integrates Groonga, a high-performance full-featured full-text search engine, with the PostgreSQL database. Groonga itself is an excellent open-source search engine, renowned for its extreme speed and rich functionality, particularly excelling at handling multilingual text. PGroonga's mission is to seamlessly bring Groonga's powerful capabilities into the PostgreSQL world, providing users with an experience that far exceeds native full-text search.
10+
11+
== Installation
12+
[NOTE]
13+
The PGroonga plugin is already included in the IvorySQL installation package. If you installed IvorySQL using the official released package, you typically do not need to manually install PGroonga and can skip the installation steps.
14+
15+
You can choose their preferred installation method for PGroonga from the https://pgroonga.github.io/install[PGroonga package installation] page.
16+
17+
The IvorySQL community also provides supplementary source code installation steps, using PGroonga v4.0.4 as an example.
18+
19+
=== Dependencies
20+
21+
Setup Environment
22+
```
23+
Operating System: Ubuntu 24.04
24+
CPU Architecture: x86_64
25+
IvorySQL: v5.0
26+
```
27+
==== Install msgpack-c
28+
29+
When compiling PGroonga with `HAVE_MSGPACK=1`, which is used to support WAL. Enabling this option requires installing msgpack-c 1.4.1 or later.
30+
```bash
31+
sudo apt install libmsgpack-dev
32+
```
33+
==== Install Groonga
34+
35+
Ensure Groonga >= 14.0.0 is installed.
36+
```bash
37+
sudo apt install groonga libgroonga-dev
38+
```
39+
Verify Groonga installation:
40+
41+
```bash
42+
highgo@ubuntu:~/work/IvorySQL/inst$ groonga --version
43+
Groonga 15.1.7 [Linux,x86_64,utf8,match-escalation-threshold=0,nfkc,mecab,message-pack,mruby,onigmo,zlib,lz4,zstandard,epoll,apache-arrow,xxhash,blosc,h3,simdjson,llama.cpp]
44+
```
45+
46+
=== Compile and Install PGroonga
47+
48+
==== Download and Extract the PGroonga Source Code
49+
50+
```bash
51+
wget https://packages.groonga.org/source/pgroonga/pgroonga-4.0.4.tar.gz
52+
tar xvf pgroonga-4.0.4.tar.gz
53+
cd pgroonga-4.0.4
54+
```
55+
==== Compile
56+
57+
Before running make , ensure that the `pg_config` command is in the `PATH` environment variable. For example, if IvorySQL is installed at `~/work/IvorySQL/inst` , set the environment variables as follows:
58+
59+
```bash
60+
export PGHOME=~/work/IvorySQL/inst
61+
export PGDATA=$PGHOME/data
62+
export PATH=$PGHOME/bin:$PATH
63+
```
64+
Then execute the following commands to compile and install:
65+
66+
```bash
67+
make HAVE_MSGPACK=1
68+
make install
69+
```
70+
71+
== Create Extension PGroonga and Confirm the version
72+
73+
Connect to the database with `psql` in `pg` mode and execute the following commands:
74+
```sql
75+
postgres=# CREATE extension pgroonga;
76+
CREATE EXTENSION
77+
postgres=# SELECT * FROM pg_available_extensions WHERE name = 'pgroonga';
78+
name | default_version | installed_version | comment
79+
----------+-----------------+-------------------+--------------------------------------------------------------------------------
80+
pgroonga | 4.0.4 | 4.0.4 | Super fast and all languages supported full text search index based on Groonga
81+
(1 row)
82+
83+
postgres=# select version();
84+
```
85+
86+
== Usage
87+
For PGroonga usage, please refer to the https://pgroonga.github.io/tutorial[PGroonga Official Documentation]

0 commit comments

Comments
 (0)