Oracle8i interMedia Text Reference
Release 2 (8.1.6)

Part Number A77063-01

Library

Product

Contents

Index

Go to previous page Go to beginning of chapter Go to next page

CTX_DOC Package , 8 of 8


THEMES

Use the CTX_DOC.THEMES procedure to generate a list of up to fifty themes for a document. Each theme is stored as a row in either a result table or in-memory PL/SQL table you specify.

Syntax 1: In-Memory Table Storage

CTX_DOC.THEMES(index_name      IN VARCHAR2,
               textkey         IN VARCHAR2,
               restab          IN OUT THEME_TAB,
               query_id        IN NUMBER DEFAULT 0,
               full_themes     IN BOOLEAN DEFAULT FALSE);

Syntax 2: Result Table Storage

CTX_DOC.THEMES(index_name      IN VARCHAR2,
               textkey         IN VARCHAR2,
               restab          IN VARCHAR2,
               query_id        IN NUMBER DEFAULT 0,
               full_themes     IN BOOLEAN DEFAULT FALSE);
index_name

Specify the name of the index for the column in which the document for the list of themes is stored.

textkey

Specify the unique identifier (usually the primary key) for the document.

The textkey parameter can be one of the following:

You toggle between primary key and rowid identification using CTX_DOC.SET_KEY_TYPE.

restab

You can specify that this procedure store results to either a table or to an in-memory PL/SQL table.

To store results to a table specify the name of the table.

See Also:

For more information about the structure of the theme result table, see "Theme Table" in Appendix B

To store results to an in-memory table, specify the name of the in-memory table of type THEME_TAB. The THEME_TAB datatype is defined as follows:

type theme_rec is record (
   theme varchar2(2000);
   weight number;
);

type theme_tab is table of theme_rec index by binary_integer;

CTX_DOC.THEMES clears the THEME_TAB you specify before the operation.

query_id

Specify the identifier used to identify the row(s) inserted into restab.

full_themes

Specify whether this procedure generates a single theme or a hierarchical list of parent themes (full themes) for each document theme.

Specify TRUE for this procedure to write full themes to the THEME column of the result table.

Specify FALSE for this procedure to write single theme information to the THEME column of the result table. This is the default.

Examples

In-Memory Themes

The following example generates the themes for document 1 and stores them in an in-memory table, declared as the_themes. The example then loops through the table to display the document themes.

declare
the_themes ctx_doc.theme_tab;

begin
 ctx_doc.themes('myindex','1',the_themes);
 for i in 1..the_themes.count loop
 dbms_output.put_line(the_themes(i).theme||':'||the_themes(i).weight);
 end loop;
end;

Theme Table

The following example creates a theme table called CTX_THEMES:

create table CTX_THEMES (query_id number, 
                         theme varchar2(2000), 
                         weight number);

Single Themes

To obtain a list of themes where each element in the list is a single theme, issue:

begin
ctx_doc.themes('newsindex','34','CTX_THEMES',1,full_themes => FALSE);
end;

Full Themes

To obtain a list of themes where each element in the list is a hierarchical list of parent themes, issue:

begin
ctx_doc.themes('newsindex','34','CTX_THEMES',1,full_themes => TRUE);
end;

Notes

When textkey is a composite key, you must encode the composite textkey string using the CTX_DOC.PKENCODE procedure.


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2000, Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index