易截截图软件、单文件、免安装、纯绿色、仅160KB

oracle全文索引之WORDLIST PREFERENCE

Oracle全文索引的WORDLIST属性用来设置模糊查询和同词根查询,另外WORDLIST属性还支持通配符查询。
Oracle的WORDLIST属性只有BASIC_WORDLIST一种,下面看一个BASIC_WORDLIST的例子:
1.Stemmer attribute是用来查询用词根的数据
SQL> create table stemmer_tbl(id number primary key,docs clob);
Table created.
SQL> insert into stemmer_tbl values(111,'We are testing the Stemmer attribute option');
1 row created.
SQL> insert into stemmer_tbl values(112,'The girl sang like a frog');
1 row created.
SQL> insert into stemmer_tbl values(113,'My import is committing too often');
1 row created.
SQL> commit;
Commit complete.
--
-- Basic WordList Stemmer attribute
-- This example uses English for Stemming.
-- Language choices are: NULL,ENGLISH,DERIVATIONAL,DUTCH,FRENCH,GERMAN,ITALIAN
-- and SPANISH. By default we use the language of the database. If the
-- database is not one of the listed languages then we choose NULL for stemmer
-- and default for fuzzy
--
SQL> begin
2 Ctx_Ddl.Create_Preference('STEMMER_PREF', 'BASIC_WORDLIST');
3 ctx_ddl.set_attribute('STEMMER_PREF','STEMMER','ENGLISH');
4 end;
5 /
PL/SQL procedure successfully completed.
SQL> create index stemmer_idx on stemmer_tbl ( docs )
2 indextype is ctxsys.context
3 parameters ('Wordlist STEMMER_PREF');
Index created.
SQL> column docs format a20
SQL> select id,docs,score(1) from stemmer_tbl
2 where contains ( docs, '$test',1 ) > 0;
ID DOCS SCORE(1)
---------- -------------------- ----------
111 We are testing the S 4
temmer attribute opt
ion
SQL> select id,docs,score(1) from stemmer_tbl
2 where contains ( docs, '$sing',1) >0;
ID DOCS SCORE(1)
---------- -------------------- ----------
112 The girl sang like a 4
frog
第一个查询是查test的找出testing,这个不太明显;第二个是找词根是sing的数据,找到了sang的这一行数据。


相关文档:

Oracle 10g 特性: 通过备份实现可传输表空间

Oracle 10g 特性: 通过备份实现可传输表空间
Oracle8i 中引入的可传输表空间为实现更快的跨数据库数据传输提供了迫切需要的支持。使用此特性,您可以只导出表空间的元数据、传输数据文件并将转储文件导出到目标数据库主机以及导入元数据以将表空间“插入”到目标数据库中。该表空间中的数据在目标数据库中随即可 ......

在oracle利用游标取数据库的结果集应用实例:

SQL> create table test2(s1 varchar(10),s2 varchar2(10));
表已创建。
SQL> insert into test2 values('11','111');
已创建 1 行。
SQL> insert into test2 values('22','222');
已创建 1 行。
SQL> CREATE OR REPLACE PACKAGE test222 AS
2 TYPE t_cursor IS REF CURSOR;
3 procedure p_tes ......

oracle全文索引之LEXER


介绍完Oracle全文索引的FILTER属性,继续介绍Oracle的LEXER属性。

Oracle全文索引的LEXER属性用于处理各种不同的语言。最基本的英文使用BASE_FILTER,而如果需要使用中文则可以使用CHINESE_VGRAM_LEXER或CHINESE_LEXER。
这篇文章简单说明BASIC_LEXER属性。BASIC_LEXER属性支持多种语言,比如英语、德语、荷兰语、挪 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号