5 Replies Latest reply on Sep 27, 2006 12:17 AM by Barbara Boehmer

    highlighting terms in document using ctx_doc.highlight procedure

      highlighting terms in document using ctx_doc.highlight procedure

      doing an example from Oracle Text Application Guide, i decided to build an
      application that first retrieves the list of documents satisfying the user query,
      satisfying the word search. then the user may wish to view the documents
      with the terms in the document being highlighted.
      so , i created a procedure:
      "DOC_ID" IN varchar2,"QUERY" IN VARCHAR2) IS

      v_clob_selected clob default empty_clob();
      BEGIN -- executable part starts here

      ctx_doc.markup (index_name =>'idxdocuments',
                          textkey => doc_id,
                          text_query => query,
                          restab => v_clob_selected,
                          starttag => '<i><font color=red>',
                          endtag => '</font></i>');
           INSERT INTO searchviewhtml VALUES (1, v_clob_selected);

      -- EXCEPTION -- exception-handling part starts here
      -- WHEN comm_missing THEN
      -- dbms_output.put_line('Commision is NULL');


      i didn't understand the parameter to the procedure text_query. should i pass
      the exact query that was used to list the documents according to user criteria.
      also in the text_key parameter, should i pass the primary key of the table containing documents.
      it is not clear because i used a number as the primary key whereas the 'textkey'
      parameter is a varchar data type.
      please help.

      Message was edited by: