作者:eygle |English Version 【转载时请以超链接形式标明文章出处和作者信息及本声明】
链接:http://www.eygle.com/archives/2005/06/ecieoaoracleeia.html本文简要说明全文检索功能的使用,不做太多的具体说明。
仅供参考使用方法。
1.授权
对具体使用全文检索的用户授权
$ sqlplus "/ as sysdba"
SQL*Plus: Release 9.2.0.4.0 - Production on Sun May 15 20:00:10 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
SQL> grant ctxapp to club;
Grant succeeded.
SQL> connect ctxsys/password
Connected.
SQL> grant execute on ctx_ddl to club;
Grant succeeded.
2.使用应用用户连接
创建域索引
SQL> connect club/password
Connected.
SQL> begin ctx_ddl.create_preference('club_lexer','chinese_vgram_lexer'); end;
2 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.03
SQL> create index id_cont_msg
2 on jivemessage ( SUBJECT ) indextype is ctxsys.context parameters('lexer club_lexer');
Index created.
Elapsed: 00:01:22.42
SQL> select count(*) from jivemessage where contains(subject,'幸福')>0;
COUNT(*)
----------
1847
Elapsed: 00:00:00.17
SQL> select count(*) from jivemessage where subject like '%幸福%';
COUNT(*)
----------
1841
Elapsed: 00:00:02.89