From 404846e15d152969f2016c4832a7b5035f37a52b Mon Sep 17 00:00:00 2001 From: 8ga Date: Mon, 2 Mar 2026 13:55:40 +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 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/部署PostGIS.md b/部署PostGIS.md index b0e84eb..4b89f4e 100644 --- a/部署PostGIS.md +++ b/部署PostGIS.md @@ -130,7 +130,7 @@ CREATE TEXT SEARCH CONFIGURATION chinese_mix (PARSER = zhparser); -- DROP TEXT SEARCH CONFIGURATION IF EXISTS chinese_mix; ALTER TEXT SEARCH CONFIGURATION chinese_mix - ADD MAPPING FOR n,v,a,i,e,l,d,j,m,q,r,t,u,w,x,z WITH zhparser; + ADD MAPPING FOR n,v,a,i,e,l,d,j,m,q,r,t,u,w,x,z WITH simple; SELECT to_tsvector('chinese_mix', 'Hello world, 你好世界,PostgreSQL 很棒'); ``` @@ -155,7 +155,6 @@ INSERT INTO articles (title, content) VALUES -- 创建 GIN 索引 (加速检索的关键) CREATE INDEX idx_articles_content ON articles USING GIN (to_tsvector('chinese_mix', content)); --- 执行搜索查询 -- 搜索 "人工智能" SELECT title FROM articles WHERE to_tsvector('chinese_mix', content) @@ to_tsquery('chinese_mix', '人工智能');