看看这里D:/oracle/ora81/ctx/sample/api/index.html Oracle8i interMedia Text Code Samples 看看Quick Start部分 9i应该在对应的目录下
1。Create the table drop table quick;create table quick ( quick_id number constraint quick_pk primary key, text varchar(80) );insert into quick ( quick_id, text ) values ( 1, 'The cat sat on the mat' ); insert into quick ( quick_id, text ) values ( 2, 'The quick brown fox jumps over the lazy dog' ); insert into quick values (3, 'The dog barked like a dog' ); commit;
现在国内有很多专业的做全文检索软件的厂家,比较有名的比如百度、TRS等,不过这些软件价格都比较高,一般在几十万元左右。
Oracle8i interMedia Text Code Samples 看看Quick Start部分
9i应该在对应的目录下
(
quick_id number
constraint quick_pk primary key,
text varchar(80)
);insert into quick ( quick_id, text )
values ( 1, 'The cat sat on the mat' );
insert into quick ( quick_id, text )
values ( 2, 'The quick brown fox jumps over the lazy dog' );
insert into quick
values (3, 'The dog barked like a dog' );
commit;
http://www.pcdog.com/info/3617.htm
http://www.fixdown.com/article/article/1430.htm
Ctx_Ddl.Create_Preference ('chinese_lexer_pref','CHINESE_VGRAM_LEXER'); 建一个表t1,带clob字段或varchar字段的
然后给这个表检索引
create index idx_t1 on t1 ( content ) indextype is ctxsys.context parameters ( 'LEXER CHINESE_LEXER_PREF' ) ;
content 是clob类型的查询带“手机”的记录用
单一关键词:
select id,title,score(1) from t1 where contains ( content, '手机',1 ) >0
复杂查询如下:
多个关键词并
select id,title,score(1) from t1 where contains ( content, '<query><textquery grammar="CTXCAT">手机&电池</textquery><score datatype="integer"/></query>',1 ) >0
多个关键词或
select id,title,score(1) from t1 where contains ( content, '<query><textquery grammar="CTXCAT">手机|电池</textquery><score datatype="integer"/></query>',1 ) >0