1. 建立测试用表
[informix@vm84145 ~]$ dbaccess testdb3 -
Database selected.
> create table btstest(c1 int,c2 clob);
Table created.
2. 导入测试数据
> insert into btstest values(1,filetoclob('/home/informix/sinodb/etc/onconfig.std','server'));
1 row(s) inserted.
> insert into btstest values(1,filetoclob('/home/informix/sinodb/etc/sqlhosts.std','server'));
1 row(s) inserted.
3. 建立全文索引
> create index btsidx_bts on btstest(c2 bts_clob_ops) using bts (analyzer="cjk") in sbdbs1;
Index created.
4. 执行全文检索
> select c1 from btstest where bts_contains(c2,'BUFFERPOOL');
c1
1
1 row(s) retrieved.
>