码迷,mamicode.com
首页 > 数据库 > 详细

PostgreSQL 全文索引

时间:2018-05-29 17:11:33      阅读:220      评论:0      收藏:0      [点我收藏+]

标签:code   ges   https   添加   ica   tab   using   pos   end   

-- 添加全文索引字段并且建立触发器
-- alter table keyword add COLUMN tsv tsvector;

-- create or replace function keyword_ts_trigger_function() returns trigger as $$
-- begin
--     new.keyword_participle := to_tsvector(english_nostop,COALESCE(new.keyword,‘‘) );
--     return new;
--    end
--    $$ language plpgsql;
-- 
--     create trigger messages_ts_trigger
--         before insert 
--         on keyword
--         for each row
--         execute procedure keyword_ts_trigger_function();
-- 创建索引
-- CREATE INDEX keyword_full_text_index on keyword 
-- using gin(to_tsvector(english_nostop,keyword));
-- 更新刚刚创建的字段
--

参考文章:

https://stackoverflow.com/questions/1497895/can-i-configure-stop-words-programmatically-with-postgresql-full-text-search

https://www.youtube.com/watch?v=LS6kF43DEt8

 

PostgreSQL 全文索引

标签:code   ges   https   添加   ica   tab   using   pos   end   

原文地址:https://www.cnblogs.com/ryanzheng/p/9105773.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!