POLICY_MARKUP
Generates plain text or HTML version of a document with query terms highlighted. With this procedure, no CONTEXT index is required.
The CTX_DOC.POLICY_MARKUP procedure takes a query specification and a document and returns a version of the document in which the query terms are marked up. These marked-up terms are either the words that satisfy a word query or the themes that satisfy an ABOUT query.
You can set the marked-up output to be either plaintext or HTML.
You can use one of the predefined tag sets for marking highlighted terms, including a tag sequence that enables HTML navigation.
Syntax
ctx_doc.policy_markup(policy_name in VARCHAR2,
document in [VARCHAR2|CLOB|BLOB|BFILE],
text_query in VARCHAR2,
restab in out nocopy CLOB,
plaintext in BOOLEAN default FALSE,
tagset in VARCHAR2 default 'TEXT_DEFAULT',
starttag in VARCHAR2 default NULL,
endtag in VARCHAR2 default NULL,
prevtag in VARCHAR2 default NULL,
nexttag in VARCHAR2 default NULL
language in VARCHAR2 default NULL,
format in VARCHAR2 default NULL,
charset in VARCHAR2 default NULL
);
ctx_doc.policy_markup_clob_query(
policy_name in VARCHAR2,
document in [VARCHAR2|CLOB|BLOB|BFILE],
text_query in CLOB,
restab in out nocopy CLOB,
plaintext in BOOLEAN default FALSE,
tagset in VARCHAR2 default 'TEXT_DEFAULT',
starttag in VARCHAR2 default NULL,
endtag in VARCHAR2 default NULL,
prevtag in VARCHAR2 default NULL,
nexttag in VARCHAR2 default NULL
language in VARCHAR2 default NULL,
format in VARCHAR2 default NULL,
charset in VARCHAR2 default NULL
);
policy_name
Specify the policy name created with CTX_DDL.CREATE_POLICY.
document
Specify the document to generate highlighting offset information.
text_query
Specify the original query expression used to retrieve the document.
If text_query includes a NULL, then this procedure will fail and generate errors.
If text_query includes wildcards, stemming, or fuzzy matching which result in stopwords being returned, then this procedure does not highlight the stopwords.
If text_query contains the threshold operator, the operator is ignored. This procedure always returns highlight information for the entire result set.
restab
Specify the name of the CLOB locator.
plaintext
Specify TRUE to generate a plaintext marked-up document. Specify FALSE to generate a marked-up HTML version of the document if you are using the AUTO_FILTER filter or indexing HTML documents.
tagset
Specify one of the following predefined tag sets. The second and third columns show how the different tags are defined for each tagset:
| Tagset | Tag | Tag Value |
|---|---|---|
TEXT_DEFAULT |
starttag | <<< |
TEXT_DEFAULT |
endtag | >>> |
HTML_DEFAULT |
starttag | <B> |
HTML_DEFAULT |
endtag | </B> |
HTML_NAVIGATE |
starttag | <A NAME=ctx%CURNUM><B> |
HTML_NAVIGATE |
endtag | </B></A> |
HTML_NAVIGATE |
prevtag | <A HREF=#ctx%PREVNUM><</A> |
HTML_NAVIGATE |
nexttag | <A HREF=#ctx%NEXTNUM>></A> |
starttag
Specify the character(s) inserted by MARKUP to indicate the start of a highlighted term.
The sequence of starttag, endtag, prevtag and nexttag with regard to the highlighted word is as follows:
... prevtag starttag word endtag nexttag...
endtag
Specify the character(s) inserted by MARKUP to indicate the end of a highlighted term.
prevtag
Specify the markup sequence that defines the tag that navigates the user to the previous highlight.
In the markup sequences prevtag and nexttag, you can specify the following offset variables which are set dynamically:
| Offset Variable | Value |
|---|---|
%CURNUM |
the current offset number |
%PREVNUM |
the previous offset number |
%NEXTNUM |
the next offset number |
See the description of the HTML_NAVIGATE tagset for an example ““tagset””.
nexttag
Specify the markup sequence that defines the tag that navigates the user to the next highlight tag.
Within the markup sequence, you can use the same offset variables you use for prevtag. See the explanation for prevtag and the HTML_NAVIGATE ““tagset”” for an example.
language
Specify the language of the document. Use an Oracle Text supported language value as you would in the language column of the base table. See “MULTI_LEXER” in Oracle Text Indexing Elements.
format
Specify the format of the document. Use an Oracle Text supported format value, either TEXT, BINARY or IGNORE as you would specify in the format column of the base table. For more information, see the format column description in “CREATE INDEX”.
charset
Specify the character set of the document. Use an Oracle Text supported value as you would specify in the charset column of the base table. See “Filter Types”.
Restrictions
CTX_DOC.POLICY_MARKUP does not support the use of query templates.