Skip to main content

Module search

Module search 

Source
Expand description

文章全文搜索接口。

通过 ILIKE 对 search_text 做子串模糊匹配(两侧 %),由 posts.search_text 上的 trigram GIN 索引(gin_trgm_ops,见 migrations/019)加速;<3 字符的查询 trigram 不足, 可能退回顺序扫,靠 LIMIT 50 与搜索限流兜底。结果按 pg_trgm 的 word_similarity 相似度与发布时间降序返回最多 50 篇已发布文章。 Dioxus server function,注册在 /api 路径下。 仅在 feature = "server" 启用的服务端构建中查询数据库。

Functions§

search_posts
搜索已发布文章。