转:http://hi.baidu.com/lostdays/blog/item/bcbd6d3e2428343e70cf6cab.html
建立测试表
create table ftstest(id integer, url text, url_ftx tsvector);
插入数据
insert into ftstest (id, url, url_ftx) values (1, 'www.sina.com.cn', 'www sina com cn'::tsvector);
这里说明 url_ftx 是 url 字段经过分词以后的结果 我这里是将“.”换为“ ”
如‘www.sina.com.cn
’ 转化为 'www sina com cn'
添加全文索引
create INDEX ftstest_url_ftx_idx on ftstest using gist (url_ftx);
测试查询
select * from ftstest where url_ftx @@ 'sina'::tsquery;
select * from ftstest where url_ftx @@to_tsquery('sina com cn')
分享到:
相关推荐
PostgresSQL是一个很优秀的开源数据库,并提供了针对空间数据的存扩展;这个PPT介绍了PostgresSQL数据库的基本情况
pgadmin管理工具,支持对postgresqlV11.1以上的版本进行管理。包括存储过程 表分区
postgressql 连接数据库 和关闭数据库
PostgresSQL的简明教程,里面包含了使用方法
主要讲解PostgreSql 10.7 数据库的安装流程,包括系统的优化,环境准备,每一步安装的命令。
数据库备份相关的。
SQL必知必会PostgresSQL数据导入脚本 SQL必知必会PostgresSQL数据导入脚本 SQL必知必会PostgresSQL数据导入脚本
postgressql和postgis安装
PowerDesigner16.5+PostgresSQL
Dexter一个Postgres的自动索引器
Postgres数据库SQL注入手册1
PostgresSQL优化
postgres sql psycopg2最新版本,外面的资源部豪侠
postgressql-ver-11-win64
ArcEngine开发连接PostgresSQL空间库Cannot connect to database because the database client software failed to
PostgresSQL创建数据库和对应用户(附管理工具),文件中包含了数据库管理工具安装包
利用sqoop导出PostgresSQL的数据时所需的驱动包,只需要将该包放到hive或sqoop的lib目录下即可。
16新特性: 1.权限管理 2.逻辑复制增强功能 3.性能提升:并行查询方面的性能提升,比如允许FULL和RIGHT JION在并行模式下执行,支持SIMD 4.全面的监控功能
PostGresSQL数据库 window64位 版本是15.4-1
sqoop连接Postgres SQL 的驱动包postgresql-9.3-1102-jdbc41.jar。 利用sqoop导出PostgresSQL的数据时所需的驱动包,只需要将该包放到hive或sqoop的lib目录下即可。