全文检索

来源:互联网 发布:数据泄露调查报告 编辑:程序博客网 时间:2024/03/28 16:55

SQL> select file_path from url_search where contains(file_path,'中中')>0;
我的应用和数据库有以下的特点
1.我的Doc文档是通过Delphi的OLEContainer加进去的,所以不是单纯的Doc文档而是加了个OLE的头
2.我的数据库的字符集是16GBK
问题是这样解决的
通过查看ctxsys.ctx_parameters发现其中的default_filter_file和default_filter_binary都是inso_filter,所以要修改
execute ctxsys.ctx_adm('default_filter_file','null_filter');
execute ctxsys.ctx_adm('default_filter_binary','null_filter');
选择语言解析器
execute ctxsys.ctx_ddl.create_preference('mylexer','chinese_vgram_lexer');
创建索引
create index myindex on testtable(column2) indextype is ctxsys.context parameters('lexer mylexer Filter ctxsys.inso_filter'');

--注意选择合适的lexer和inso_filter。

这样就可以了

 

 

==================

全文检索的问题

当我用下面的语句建立一个全文检索的索引时
=================================================
create index test_fulltext on testfulltext(bb)
indextype is ctxsys.context;
================================================

出了这个错误:
===============================================
ERROR 位于第 1 行:
ORA-29855: 执行 ODCIINDEXCREATE 例行程序时出错
ORA-20000: interMedia Text 错误:
DRG-11422: 语言初始化失败
DRG-00100: internal error, arguments : [52100],[drxs.c],[553],[gxtopen],[1]
DRG-11208: 未设置 ORACLE_HOME
ORA-06512: 在"CTXSYS.DRUE", line 126
ORA-06512: 在"CTXSYS.TEXTINDEXMETHODS", line 78
ORA-06512: 在line 1
=======================================================
解决方法:init.ora中的text_enable注释

原创粉丝点击