我配置完成全文检索后 可以检索出来记录 但是检索出来的记录数和我库里满足检索条件的记录数差的太多了 我给出某条件只检索出来了十几条记录 但我库里符合条件的可能有几百条 请问个位是我配置的问题 还是怎么回事 望指教!

解决方案 »

  1.   

    如何对CLOB行字段执行全文检索大家知道,超过4000字的文本一般存储在CLOB中(MSQL、Sysbase是存放在Text中),在目前的Oracle版本(Oracle8i)中,对大字段CLOB仍然不支持在where子句直接的like操作,如何实现对存储在CLOB字段中的内容进行like查找呢?下面的文章或则能给你帮助。虽然在SQL*PLUS中能实现用select直接看到CLOB的内容,但是如何通过DBMS_LOB包实现对中文环境下的CLOB内容的读取我一直没有找到好的方法(使用Documents中提到的Samples只适用英文字符集),这极大的限制了使用第3方软件开发工作的自由度。如果那位仁兄有高招希望Email给我。 表结构:
    create table products( 
    productid number(10) not null ,
    name varchar2(255) ,
    description CLOB) ;方法:
    SELECT productid, name FROM products 
    WHERE dbms_lob.instr(products.description,'some text',1,1) > 0; 
     下面列出了DBMS_LOB包中的过程函数:APPEND procedure Appends the contents of the source LOB to the destination LOB. CLOSE procedure Closes a previously opened internal or external LOB. COMPARE function Compares two entire LOBs or parts of two LOBs. COPY procedure Copies all, or part, of the source LOB to the destination LOB. CREATETEMPORARY procedure Creates a temporary BLOB or CLOB and its corresponding index in the user's default temporary tablespace. ERASE procedure Erases all or part of a LOB. FILECLOSE procedure Closes the file. FILECLOSEALL procedure Closes all previously opened files. FILEEXISTS function Checks if the file exists on the server. FILEGETNAME procedure Gets the directory alias and file name. FILEISOPEN function Checks if the file was opened using the input BFILE locators. FILEOPEN procedure Opens a file. FREETEMPORARY procedure Frees the temporary BLOB or CLOB in the user's default temporary tablespace. GETCHUNKSIZE function Returns the amount of space used in the LOB chunk to store the LOB value.GETLENGTH function Gets the length of the LOB value. INSTR function Returns the matching position of the nth occurrence of the pattern in the LOB. ISOPEN function Checks to see if the LOB was already opened using the input locator. ISTEMPORARY function Checks if the locator is pointing to a temporary LOB. LOADFROMFILE procedure Loads BFILE data into an internal LOB. OPEN procedure Opens a LOB (internal, external, or temporary) in the indicated mode. READ procedure Reads data from the LOB starting at the specified offset.SUBSTR function Returns part of the LOB value starting at the specified offset. TRIM procedure Trims the LOB value to the specified shorter length. WRITE procedure Writes data to the LOB from a specified offset. WRITEAPPEND procedure Writes a buffer to the end of a LOB. 
      

  2.   

    我也发现类似的问题。就是对仅有5条的数据一个表,select不出东西。不知道是什么问题
    up一下,共同学习
      

  3.   

    不知道是不是lexer的问题,或是stoplist
      

  4.   

    问题的解决方法:在配置索引时首选项里有个词法分析器选成中文的(chinese)
      

  5.   

    baojianjun(包子) ( ) 信誉:106 :你也看看问的是什么嘛!随便粘一段来对问题没有任何帮助!这种人太不负责任了
      

  6.   

    楼主,是对BLOB类型配的全文检索吗,希望公布方法哦,我也配置了,但是对中文不好使啊,词法分析器我也选的 chinese_lexer , filter  不管我选 NULL_FILTER 还是 inso_filter 都不行,后来我实在没办法,才转BLOB为 CLOB 类型!
      

  7.   

    建立全文检索索引的方法:
    以system给用户(user)授权GRANT "CTXAPP" TO "USER";
    ALTER USER "USER" DEFAULT ROLE ALL;
    GRANT EXECUTE ON "CTXSYS"."CTX_ADM" TO "USER";
    GRANT EXECUTE ON "CTXSYS"."CTX_CATSEARCH" TO "USER";
    GRANT EXECUTE ON "CTXSYS"."CTX_CONTAINS" TO "USER";
    GRANT EXECUTE ON "CTXSYS"."CTX_DDL" TO "USER";
    GRANT EXECUTE ON "CTXSYS"."CTX_DOC" TO "USER";
    GRANT EXECUTE ON "CTXSYS"."CTX_QUERY" TO "USER";
    GRANT EXECUTE ON "CTXSYS"."CTX_ULEXER" TO "USER";
    GRANT EXECUTE ON "CTXSYS"."CTX_XPCONTAINS" TO "USER";如果system用户执行时提示权限不足则用ctxsys用户来做;
    创建索引:
    CREATE INDEX USER.I_INDEX 
        ON USER.TABLENAME(CONTENT) INDEXTYPE IS 
        CTXSYS.CONTEXT PARAMETERS (' LEXER WKSYS.WK_CHINESE_LEXER')可以用以下的job来完成同步和优化(该job要建在和表同一个用户下): 
    create or replace procedure sync
    is
    begin
      execute immediate
        'alter index I_INDEX rebuild online'       ||
        '  parameters ( ''sync'' )'                          ;
      execute immediate
        'alter index I_INDEX rebuild online'       ||
        '  parameters ( ''optimize full maxtime unlimited'' )' ;
    end sync;
    /Set ServerOutput on
    declare
      v_job number;
    begin
      Dbms_Job.Submit
        (
          job       => v_job,
          what      => 'sync;',
          next_date => sysdate, /* default */
          interval  => 'sysdate + 1/720' /* = 1 day / ( 24 hrs * 30 min) = 2 mins */
        );
      Dbms_Job.Run ( v_job );
      Dbms_Output.Put_Line ( 'Submitted as job # ' || to_char ( v_job ) );
    end;
    /