需要对一些WORD文档进行全文检索,数据库版本oracle 9i R2,我是生手请多指教,谢谢。表:
create table textdemo(id number(3) primary key,content blob);
索引:
create index t_textdemo_idn on textdemo(content) indextype is ctxsys.content; 一、已经把word文档转化为二进制存入blob列(我是通过分段截取word文档转化为二进制存入blob,效率低),但是尝试过对blob型数据进行检索:
select id from textdemo where contains(content,'学员')>0;
检索结果为空,失败。二、把普通txt文档转化为二进制存入blob列,再次尝试检索:
select id from textdemo where contains(content,'data')>0;
检索成功。后查到资料,在创建索引前需要对word,excel文档进行过滤得到文本部分。如何实现?
create table textdemo(id number(3) primary key,content blob);
索引:
create index t_textdemo_idn on textdemo(content) indextype is ctxsys.content; 一、已经把word文档转化为二进制存入blob列(我是通过分段截取word文档转化为二进制存入blob,效率低),但是尝试过对blob型数据进行检索:
select id from textdemo where contains(content,'学员')>0;
检索结果为空,失败。二、把普通txt文档转化为二进制存入blob列,再次尝试检索:
select id from textdemo where contains(content,'data')>0;
检索成功。后查到资料,在创建索引前需要对word,excel文档进行过滤得到文本部分。如何实现?
解决方案 »
- sql優化
- 关于A ResourcePool could not acquire a resource from its primary factory or source
- oracle 9i 安装在2003上的小问题
- 来做题了。答的越多分越多,明天加分
- 海量数据加载,需要oracle10g数据库做怎么样的优化?
- 有long raw列的表为什么检索速度特别慢?
- 如何完全卸载oracle 9.2 for win2000
- 如何用命令同时删除某用户的所有TABLE呢?
- 数据库空间文件的移动--求救高手
- ORA-01033: ORACLE initialization or shutdown in progress
- 求助:查询同一个表某个字段的多条记录
- PL/SQL连接oracle报ORA-12560错误
begin
ctx_ddl.create_preference('mylex','BASIC_LEXER');
ctx_ddl.set_attribute('mylex','printjoins','_-');
ctx_ddl.create_preference('mywordlist', 'BASIC_WORDLIST');
ctx_ddl.set_attribute('mywordlist','PREFIX_INDEX','TRUE');
ctx_ddl.set_attribute('mywordlist','PREFIX_MIN_LENGTH',1);
ctx_ddl.set_attribute('mywordlist','PREFIX_MAX_LENGTH', 5);
ctx_ddl.set_attribute('mywordlist','SUBSTRING_INDEX', 'YES');
end;
/
begin
ctx_ddl.create_preference('cnlex','CHINESE_LEXER');
end;
/--选用参数创建索引
drop index i_docs_idx force;
create index i_docs_idx on docs(text)
indextype is ctxsys.context
parameters ('DATASTORE CTXSYS.DIRECT_DATASTORE FILTER CTXSYS.INSO_FILTER LEXER fmduser.CNLEX WORDLIST fmduser.MYWORDLIST');--这样就可以查询得到结果了。
http://epub.itpub.net/4/1.htm