需要对一些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;
检索结果为空,失败,是不是不能直接用string对blob进行匹配检索?如果有其他方法,也请一并告知,再谢,50分送上。

解决方案 »

  1.   

    where dbms_lob.instr(textdemo.content, utl_raw.cast_to_raw(convert('学员','utf8')), 1, 1) > 0
      

  2.   

    word是经过编码转换的,存进去的不是纯文本的东西,可能
      

  3.   


    先谢谢Denonly,那如何对word文档全文检索?把word文档导入数据库也成,做外部OS文件也可以,目的是能对word文档进行全文检索。
      

  4.   


    刚使用了一个log文档转化为二进制存入blob,再使用
    select id from textdemo where contains(content,'data')>0; 
    查询成功。看来确实是word文档问题,又查找了一些资料,发现在创建索引之前需要使用过滤器对word文档过滤,得到纯文本部分。
      

  5.   

    谢谢Denonly,是你帮我找到问题所在。分给你啦