feat(search): 装 zhparser 中文分词 + 0010 迁移修正

- Dockerfile.postgres: 从 alpine 切到 debian bookworm,apt 装 postgresql-16-zhparser
- docker-compose.yml: postgres 改用 build 指向 Dockerfile.postgres
- 0010 迁移: CREATE EXTENSION zhparser + 建 chinese_zh text search config +
  重建 articles.title_zh_tsv 用 chinese_zh + 重写 refresh_search_keywords()
This commit is contained in:
mavis
2026-06-15 18:46:09 +08:00
parent 2b94be2048
commit 557b7a708e
3 changed files with 216 additions and 1 deletions

View File

@@ -2,7 +2,12 @@ name: news-aggregator
services:
postgres:
image: postgres:16-alpine
# 从 alpine 切到自建镜像(Debian bookworm + zhparser 中文分词扩展)
# alpine 仓库没打包 zhparser,Debian 仓库有现成 apt 包 postgresql-16-zhparser
build:
context: ./backend
dockerfile: Dockerfile.postgres
image: diary-postgres:zh # 自定义 tag,方便 docker images 识别
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER}