易截截图软件、单文件、免安装、纯绿色、仅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 权限


--使用DBA创建两个用户
create user gubo identified by gubo;
create user gubo2 identified by gubo;
--给两个用户连接权限
grant create session to gubo;
grant create session to gubo2;
--给其中一个用户访问表空间的权限
grant unlimited tablespace to gubo; 
--连接其中用户,创建表
--conn gubo ......

oracle基本操作

describe  TABLE_NAME;   --描述
----------------------------------------------------------------
create table as select XXXXXX
insert into TABLE_NAME (reac_1,reac_2.....) values(v1,v2)
insert into TABLE_NAME (select * from ..........)
update TABLE_NAME set reac_1=v1,.............. ......

创建oracle dblink&sql操作不同数据库的表

 
  两台不同的数据库服务器,从一台数据库服务器的一个用户读取另一台数据库服务器下的某个用户的数据,这个时候可以使用dblink。
  其实dblink和数据库中的view差不多,建dblink的时候需要知道待读取数据库的ip地址,ssid以及数据库用户名和密码。
  创建可以采用两种方式:
  1、已经配置本地服务
以� ......

oracle全文索引之datastore_2_MULTI_COLUMN_DATASTORE



继续讨论全文索引的DATASTORE属性,介绍MULTI_COLUMN_DATASTORE。
如果被索引的文章是保存在数据库中,但是内容分布在多个列中,那么可以通过建立一个MULTI_COLUMN_DATASTORE来索引完整的文章:
SQL> CREATE TABLE T (ID NUMBER, DOC1 VARCHAR2(4000), DOC2 VARCHAR2(4000), DOC3 VARCHAR2(4000));
表已创� ......

oracle全文索引之FILTER


介绍完Oracle全文索引的DATASTORE属性,继续介绍Oracle的FILTER属性。
Oracle全文索引的FILTER属性主要是针对具有一定格式的文档,Oracle根据FILTER的设定来过滤那些不属于文章内容的部分。
FILTER属性包含的属性有:CHARSET_FILTER、INSO_FILTER、NULL_FILTER、USER_FILTER、PROCEDURE_FILTER几种。
这里仍然从FILTER ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号