--1.建立全文索引测试数据
create table lxs as
select * from dba_tables;
--删除测试数据 drop table lxs;
--2.创建词法分析
BEGIN
ctx_ddl.create_preference ('test_lexer', 'chinese_vgram_lexer');
end;
--删除词法分析 BEGIN ctx_ddl.drop_preference ('test_lexer'); end;
--3.创建全文索引
CREATE INDEX ind_lxs ON lxs(TABLE_NAME)
indextype is ctxsys.context parameters('lexer test_lexer');
--删除全文索引 drop index ind_lxs force ;
--4.测试全文索引能不能用
select * from lxs where contains(TABLE_NAME,'s')>0 ;
--5.附录,可以看到创建一个全文索引,要创建以下4张表
select * from user_tables t where t.TABLE_NAME like '%$%'
--6.同步维护
exec ctx_ddl.sync_index('ind_lxs ');
--7.优化
exec ctx_ddl.optimize_index('ind_lxs ','FULL');
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29821588/viewspace-1754505/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29821588/viewspace-1754505/