我需要提供自定义的停用词列表。从字典手册部分来看,执行此操作的方法是将一个停用词文件放入$SHAREDIR/tsearch_data/
.
使用AWS时可以这样做吗?如果不是,是否可以通过命令行提供停用词文件?
我在 Postgres 9.3.3 中有一个大约 700k 行的表,它具有以下结构:
Columns:
content_body - text
publish_date - timestamp without time zone
published - boolean
Indexes:
"articles_pkey" PRIMARY KEY, btree (id)
"article_text_gin" gin (article_text)
"articles_publish_date_id_index" btree (publish_date DESC NULLS LAST, id DESC)
Run Code Online (Sandbox Code Playgroud)
我所做的查询有全文搜索查询和限制,如下所示:
当我在我的索引中搜索具有限制和顺序的字符串时,查询速度很快:
explain analyze select * from "articles" where article_text @@ plainto_tsquery('pg_catalog.simple', 'in_index') order by id limit 10;
QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------------------
Limit (cost=0.42..1293.88 rows=10 width=1298) (actual time=2.073..9.837 rows=10 loops=1)
-> Index Scan using articles_pkey on articles (cost=0.42..462150.49 rows=3573 width=1298) (actual time=2.055..9.711 rows=10 loops=1)
Filter: …
Run Code Online (Sandbox Code Playgroud)