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:
PROCEDURE "STARDOC"."SEARCHHIGHLIGHT" (
"DOC_ID" IN varchar2,"QUERY" IN VARCHAR2) IS
v_clob_selected clob default empty_clob();
BEGIN -- executable part starts here
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.
For the text_query parameter, use the same thing that you put in a contains query, like 'word1 and word2' or whatever words you searched for, not the whole select statement. For the textkey parmeter, you can use either the primary key or the rowid, depending on how ctx_doc.set_key_type is set. If you search this forum, I have posted a few ctx_doc.markup examples.