From 461961778119e7d0b488d1f23baf494adde34dde Mon Sep 17 00:00:00 2001 From: 8ga Date: Mon, 2 Mar 2026 14:04:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E9=83=A8=E7=BD=B2PostGIS.?= =?UTF-8?q?md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 部署PostGIS.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/部署PostGIS.md b/部署PostGIS.md index b83c25a..a32a582 100644 --- a/部署PostGIS.md +++ b/部署PostGIS.md @@ -151,22 +151,30 @@ INSERT INTO articles (title, content) VALUES ('AI 技术展望', '人工智能 (AI) 正在改变世界,PostgreSQL 是存储这些数据的首选数据库。'), ('PostgreSQL 16 新特性', 'PostgreSQL 16 带来了更好的性能,支持 JSON 增强和中文分词优化。'), ('日常开发笔记', 'Today I learned about zhparser. 它让中文搜索变得很简单。'); +``` +```sql -- 搜索包含 "人工智能" 的文章 SELECT title, content FROM articles WHERE content_tsvector @@ to_tsquery('chinese_mix', '人工智能'); +``` +```sql -- 搜索包含 "PostgreSQL" 的文章 SELECT title, content FROM articles WHERE content_tsvector @@ to_tsquery('chinese_mix', 'PostgreSQL'); +``` +```sql -- 搜索既包含 "数据库" 又包含 "PostgreSQL" 的文章 SELECT title, content FROM articles WHERE content_tsvector @@ to_tsquery('chinese_mix', '数据库 & PostgreSQL'); +``` +```sql -- 搜索包含 "AI" 或者 "改变" 的文章 SELECT title, content FROM articles