请教下。我配置了全文检索.索引建立成功。
然后我用 
select t.*, t.rowid from table t where contains(txt,'检索',1)>0 和
select t.*, t.rowid from table t where contains(txt,'test',1)>0 
都能搜索出结果.

select t.*, t.rowid from table t where contains(txt,'%test%',1)>0 
也能搜索出结果.
但是用
select t.*, t.rowid from table t where contains(txt,'%检索%',1)>0
就出错了.
ORA-29902:error in executing ODCIIndexStart() roitine
ORA-20000:Oracle Text error;
DRG-51030:wildcard query expansion resulted in too many terms.
我以为是搜索结果过多导致的错误. 于是增加条件 
select t.*, t.rowid from table t where contains(txt,'%检索% and 结果',1)>0
这样的结果 肯定不会多的..但是还是出 刚才的错.
谁能帮我解决下问题.谢谢

解决方案 »

  1.   

    黄日华(beckhambobo) 2月前 
    最后次出现是2个月前,很有可能今年不会出现了
      

  2.   

    那为什么select t.*, t.rowid from table t where contains(txt,'检索',1)>0 能查出结果呢?
    用通配符就出错?
      

  3.   

    引用:1.全文索引的条件contains(全文索引字段,查询内容)中,查询内容有时候使用%%括起来,查询时会出错,如下例:
            select count(*) from DCDB.T_NEWS_200606 where contains(news_content,'%中国%')>0
            ORA-29902: error in executing ODCIIndexStart() routine
            ORA-20000: Oracle Text error:
            DRG-51030: wildcard query expansion resulted in too many terms
            但查询内容不使用%%括起来,则查询没问题2全文索引的条件contains(全文索引字段,查询内容)中,查询内容使用与不使用%%括起来,查到的记录差别很大。
     若使用查询内容使用%%括起来,与like查询时使用%%括起来的结果一般一样,但也可能一样。
     若不使用查询内容使用%%括起来,则查到的记录差别很大
     select count(*) from DCDB.T_NEWS_200606 where contains(news_title,'中国')>0;      --找到19条记录
     select count(*) from DCDB.T_NEWS_200606 where contains(news_title,'%中国%')>0;     --找到1527条记录
      select count(*) from DCDB.T_NEWS_200606 where news_title like '%中国%';            --找到1527条记录
      select count(*) from DCDB.T_FORUM_TODAY where contains(Message_content, '%战争%')>0;  --找到49条记录
      select count(*) from DCDB.T_FORUM_TODAY where Message_content like '%战争%';          --找到51条记录
      select count(*) from DCDB.T_FORUM_TODAY where contains(Message_content, '战争')>0;    --找到0条记录