-
Notifications
You must be signed in to change notification settings - Fork 23
add pgroonga adaption docs #183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ccdea02
add pgroonga adapted docs
OreoYang 8bff1da
add pgroonga to the support list in the overview file
OreoYang 6ef89df
fix some tiny display issue
OreoYang 266e495
Merge branch 'master' into pgroonga
OreoYang 97845bf
fix review comments
OreoYang c882f07
fix review comments
OreoYang 45782a4
Merge branch 'master' into pgroonga
OreoYang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
|
|
||
| :sectnums: | ||
| :sectnumlevels: 5 | ||
|
|
||
| = PGroonga | ||
|
|
||
| == 概述 | ||
| PostgreSQL 内置了全文搜索功能,但在处理大规模数据、复杂查询以及非英语语言(特别是中日韩等 CJK 语言) 时,其功能和性能可能无法满足高性能应用的需求。 | ||
|
|
||
| PGroonga 应运而生,它是一个 PostgreSQL 的扩展插件,将 Groonga 这款高性能的全功能全文搜索引擎与 PostgreSQL 数据库深度融合。Groonga 本身是一个优秀的开源搜索引擎,以其极致的速度和丰富的功能著称,尤其擅长处理多语言文本。PGroonga 的使命就是将 Groonga 的强大能力无缝地带入 PostgreSQL 的世界,为用户提供远超原生全文搜索的体验。 | ||
|
|
||
| == 安装 | ||
| [NOTE] | ||
| IvorySQL的安装包里已经集成了PGroonga插件,如果使用安装包安装的IvorySQL,通常不需要再手动安装PGroonga,直接跳过安装步骤即可。 | ||
|
|
||
| 用户可从 https://pgroonga.github.io/install[PGroonga package安装] 页面选择适合自己的方式进行PGroonga安装。 | ||
|
|
||
| IvorySQL社区提供了源码安装步骤,下面以PGroonga v4.0.4为例进行演示。 | ||
|
|
||
| === 安装依赖 | ||
|
|
||
| 环境 | ||
| ``` | ||
| 操作系统:Ubuntu 24.04 | ||
| CPU架构:x86_64 | ||
| IvorySQL: v5.0 | ||
| ``` | ||
|
|
||
| ==== 安装 msgpack-c | ||
|
|
||
| 编译PGroonga,有个配置选项:HAVE_MSGPACK=1,它是用于支持WAL,使用这个选项需要安装msgpack-c 1.4.1或者更高版本。 | ||
|
|
||
| ``` | ||
| sudo apt install libmsgpack-dev | ||
| ``` | ||
| ==== 安装 Groonga | ||
|
|
||
| 确保Groonga >= 14.0.0 | ||
|
|
||
| ``` | ||
| sudo apt install groonga libgroonga-dev | ||
| ``` | ||
| 验证Groonga安装成功 | ||
| ```bash | ||
| highgo@ubuntu:~/work/IvorySQL/inst$ groonga --version | ||
| 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] | ||
| ``` | ||
|
|
||
|
|
||
| === 编译安装PGroonga | ||
|
|
||
| ==== 下载解压源码 | ||
|
|
||
| ```bash | ||
| wget https://packages.groonga.org/source/pgroonga/pgroonga-4.0.4.tar.gz | ||
| tar xvf pgroonga-4.0.4.tar.gz | ||
| cd pgroonga-4.0.4 | ||
| ``` | ||
| ==== 编译 | ||
| 运行make前确保`pg_config`命令的路径在`PATH`环境变量里,例如IvorySQL安装的路径是`~/work/IvorySQL/inst`,则环境变量设置如下: | ||
|
|
||
| ```bash | ||
| export PGHOME=~/work/IvorySQL/inst | ||
| export PGDATA=$PGHOME/data | ||
| export PATH=$PGHOME/bin:$PATH | ||
| ``` | ||
| 然后执行以下命令进行编译和安装: | ||
| ```bash | ||
| make HAVE_MSGPACK=1 | ||
| make install | ||
| ``` | ||
|
|
||
| == 创建Extension并确认PGroonga版本 | ||
|
|
||
|
|
||
| psql 连接到数据库的pg模式下,执行命令: | ||
| ```sql | ||
| postgres=# CREATE extension pgroonga; | ||
| CREATE EXTENSION | ||
| postgres=# SELECT * FROM pg_available_extensions WHERE name = 'pgroonga'; | ||
| name | default_version | installed_version | comment | ||
| ----------+-----------------+-------------------+-------------------------------------------------------------------------------- | ||
| pgroonga | 4.0.4 | 4.0.4 | Super fast and all languages supported full text search index based on Groonga | ||
| (1 row) | ||
|
|
||
| postgres=# select version(); | ||
| version | ||
| -------------------------------------------------------------------------------- | ||
| PostgreSQL (IvorySQL 5.0) 18.0 on x86_64-linux, compiled by gcc-13.3.0, 64-bit | ||
| (1 row) | ||
| ``` | ||
|
|
||
| == 使用 | ||
| 关于PGroonga的使用,请参阅 https://pgroonga.github.io/tutorial[PGroonga官方文档] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| :sectnums: | ||
| :sectnumlevels: 5 | ||
|
|
||
| = PGroonga | ||
|
|
||
| == Overview | ||
| 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. | ||
|
|
||
| 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. | ||
|
|
||
| == Installation | ||
| [NOTE] | ||
| 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. | ||
|
|
||
| You can choose their preferred installation method for PGroonga from the https://pgroonga.github.io/install[PGroonga package installation] page. | ||
|
|
||
| The IvorySQL community provides source code installation steps, demonstrated below using PGroonga v4.0.4 as an example. | ||
|
|
||
| === Dependencies | ||
|
|
||
| Setup Environment | ||
| ``` | ||
| Operating System: Ubuntu 24.04 | ||
| CPU Architecture: x86_64 | ||
| IvorySQL: v5.0 | ||
| ``` | ||
| ==== Install msgpack-c | ||
|
|
||
| When compile PGroonga, there is an option: `HAVE_MSGPACK=1`, which is used to support WAL. Enabling this option requires installing msgpack-c 1.4.1 or newer version. | ||
| ```bash | ||
| sudo apt install libmsgpack-dev | ||
| ``` | ||
| ==== Install Groonga | ||
|
|
||
| Ensure Groonga >= 14.0.0 is installed. | ||
| ```bash | ||
| sudo apt install groonga libgroonga-dev | ||
| ``` | ||
| Verify Groonga installation: | ||
|
|
||
| ```bash | ||
| highgo@ubuntu:~/work/IvorySQL/inst$ groonga --version | ||
| 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] | ||
| ``` | ||
|
|
||
| === Compile and Install PGroonga | ||
|
|
||
| ==== Download and Extract the PGroonga Source Code | ||
|
|
||
| ```bash | ||
| wget https://packages.groonga.org/source/pgroonga/pgroonga-4.0.4.tar.gz | ||
| tar xvf pgroonga-4.0.4.tar.gz | ||
| cd pgroonga-4.0.4 | ||
| ``` | ||
| ==== Compile | ||
|
|
||
| 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: | ||
|
|
||
| ```bash | ||
| export PGHOME=~/work/IvorySQL/inst | ||
| export PGDATA=$PGHOME/data | ||
| export PATH=$PGHOME/bin:$PATH | ||
| ``` | ||
| Then execute the following commands to compile and install: | ||
|
|
||
| ```bash | ||
| make HAVE_MSGPACK=1 | ||
| make install | ||
| ``` | ||
|
|
||
| == Create Extension PGroonga and Confirm the version | ||
|
|
||
| Connect to the database with `psql` in `pg` mode and execute the following commands: | ||
| ```sql | ||
| postgres=# CREATE extension pgroonga; | ||
| CREATE EXTENSION | ||
| postgres=# SELECT * FROM pg_available_extensions WHERE name = 'pgroonga'; | ||
| name | default_version | installed_version | comment | ||
| ----------+-----------------+-------------------+-------------------------------------------------------------------------------- | ||
| pgroonga | 4.0.4 | 4.0.4 | Super fast and all languages supported full text search index based on Groonga | ||
| (1 row) | ||
|
|
||
| postgres=# select version(); | ||
| version | ||
| -------------------------------------------------------------------------------- | ||
| PostgreSQL (IvorySQL 5.0) 18.0 on x86_64-linux, compiled by gcc-13.3.0, 64-bit | ||
| (1 row) | ||
| ``` | ||
|
|
||
| == Usage | ||
| For PGroonga usage, please refer to the https://pgroonga.github.io/tutorial[PGroonga Official Documentation] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Chinese version, there is output of "select version()".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done