A Oracle Text Result Tables
This appendix describes the structure of the result tables used to store the output generated by the procedures in the CTX_QUERY
, CTX_DOC
, and CTX_THES
packages.
The following topics are discussed in this appendix:
A.1 CTX_QUERY Result Tables
For the CTX_QUERY
procedures that return results, tables for storing the results must be created before the procedure is called. The tables can be named anything, but must include columns with specific names and data types.
This section describes the following types of result tables, and their required columns:
A.1.1 EXPLAIN Table
This section describes the EXPLAIN table.
A.1.1.1 EXPLAIN Table Structure
Table A-1 EXPLAIN Result Table
Column Name | Datatype | Description |
---|---|---|
|
|
The value of the |
|
|
A number assigned to each node in the query execution tree. The root operation node has ID =1. The nodes are numbered in a top-down, left-first manner as they appear in the parse tree. |
|
|
The ID of the execution step that operates on the output of the ID step. Graphically, this is the parent node in the query execution tree. The root operation node (ID =1) has |
|
|
Name of the internal operation performed. Refer to Table A-2 for possible values. |
|
|
Characters that describe a variation on the operation described in the |
|
|
Section name, wildcard term, weight, or threshold value or term to lookup in the index. |
|
|
The order of processing for nodes that all have the same |
|
|
Reserved for future use. You should create this column for forward compatibility. |
A.1.1.2 EXPLAIN Table Operation Column Values
Table A-2 shows the possible values for the OPERATION
column of the EXPLAIN
table.
Table A-2 EXPLAIN Table OPERATION Column
Operation Value | Query Operator | Equivalent Symbol |
---|---|---|
|
|
n/a |
|
|
, |
|
|
& |
|
(none) |
n/a |
|
|
= |
|
|
- |
|
|
; |
|
|
~ |
|
(no hits will result from this query) |
n/a |
|
|
| |
|
(a phrase term) |
n/a |
|
(section) |
n/a |
|
|
> |
|
|
* |
|
|
n/a |
|
(a single term) |
n/a |
A.1.1.3 EXPLAIN Table OPTIONS Column Values
Table A-3 lists the possible values for the OPTIONS
column of the EXPLAIN
table.
Table A-3 EXPLAIN Table OPTIONS Column
Options Value | Description |
---|---|
|
Stem |
|
Fuzzy |
|
Soundex |
|
Order for ordered Near. |
|
Order for unordered Near. |
|
A number associated with the max_span parameter for the Near operator. |
|
Indicates that |
A.1.2 HFEEDBACK Table
This section describes the HFEEDBACK table.
A.1.2.1 HFEEDBACK Table Structure
Table A-4 HFEEDBACK Results Table
Column Name | Datatype | Description |
---|---|---|
|
|
The value of the |
|
|
A number assigned to each node in the query execution tree. The root operation node has ID =1. The nodes are numbered in a top-down, left-first manner as they appear in the parse tree. |
|
|
The ID of the execution step that operates on the output of the ID step. Graphically, this is the parent node in the query execution tree. The root operation node (ID =1) has |
|
|
Name of the internal operation performed. Refer to Table A-5 for possible values. |
|
|
Characters that describe a variation on the operation described in the |
|
|
Section name, wildcard term, weight, threshold value or term to lookup in the index. |
|
|
The order of processing for nodes that all have the same |
|
Stores broader feedback terms. See Table A-7. |
|
|
Stores related feedback terms. See Table A-7. |
|
|
Stores narrower feedback terms. See Table A-7. |
A.1.2.2 HFEEDBACK Table Operation Column Values
Table A-5 shows the possible values for the OPERATION
column of the HFEEDBACK
table.
Table A-5 HFEEDBACK Results Table OPERATION Column
Operation Value | Query Operator | Equivalent Symbol |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(section) |
|
|
word or phrase of a text query |
|
|
word or phrase of an ABOUT query |
|
|
|
|
|
|
|
|
|
(none) |
A.1.2.3 HFEEDBACK Table OPTIONS Column Values
Table A-6 lists the values for the OPTIONS
column of the HFEEDBACK
table.
Table A-6 HFEEDBACK Results Table OPTIONS Column
Options Value | Description |
---|---|
(T) |
Order for ordered Near. |
(F) |
Order for unordered Near. |
(n) |
A number associated with the |
A.1.2.4 CTX_FEEDBACK_TYPE
The CTX_FEEDBACK_TYPE
is a nested table of objects. This datatype is predefined in the CTXSYS
schema. Use this type to define the columns BT_FEEDBACK
, RT_FEEDBACK
, and NT_FEEDBACK
.
The nested table CTX_FEEDBACK_TYPE
holds objects of type CTX_FEEDBACK_ITEM_TYPE
, which is also predefined in the CTXSYS
schema. This object is defined with three members and one method as follows:
Table A-7 CTX_FEEDBACK_ITEM_TYPE
CTX_FEEDBACK_ITEM_TYPE Members and Methods | Type | Description |
---|---|---|
text |
NUMBER |
Feedback term. |
cardinality |
NUMBER |
(reserved for future use.) |
score |
NUMBER |
(reserved for future use.) |
The SQL code that defines these objects is as follows:
CREATE OR REPLACE TYPE ctx_feedback_type AS TABLE OF ctx_feedback_item_type; CREATE OR REPLACE TYPE ctx_feedback_item_type AS OBJECT (text VARCHAR2(80), cardinality NUMBER, score NUMBER, MAP MEMBER FUNCTION rank RETURN REAL, PRAGMA RESTRICT_REFERENCES (rank, RNDS, WNDS, RNPS, WNPS) ); CREATE OR REPLACE TYPE BODY ctx_feedback_item_type AS MAP MEMBER FUNCTION rank RETURN REAL IS BEGIN RETURN score; END rank; END;
See Also:
For an example of how to select from the HFEEDBACK
table and its nested tables, refer to CTX_QUERY.HFEEDBACK in CTX_QUERY Package
A.2 CTX_DOC Result Tables
The CTX_DOC
procedures return results stored in a table. Before calling a procedure, you must create the table. The tables can be named anything, but must include columns with specific names and data types.
This section describes the following result tables and their required columns:
A.2.1 Filter Table
A filter table stores one row for each filtered document returned by CTX_DOC.FILTER . Filtered documents can be plain text or HTML.
When you call CTX_DOC.FILTER
for a document, the document is processed through the filter defined for the text column and the results are stored in the filter table you specify.
Filter tables can be named anything, but must include the following columns, with names and datatypes as specified:
Table A-8 FILTER Result Table
Column Name | Type | Description |
---|---|---|
|
|
The identifier for the results generated by a particular call to |
|
|
Text of the document, stored in plain text or HTML. |
A.2.2 Gist Table
A Gist table stores one row for each Gist/theme summary generated by CTX_DOC.GIST
.
Gist tables can be named anything, but must include the following columns, with names and data types as specified:
Table A-9 Gist Table
Column Name | Type | Description |
---|---|---|
|
|
Query ID. |
|
|
Document theme. Case depends of how themes were used in document or represented in the knowledge base.
|
|
|
Text of Gist or theme summary, stored as plain text |
A.2.3 Highlight Table
A highlight table stores offset and length information for highlighted terms in a document. This information is generated by CTX_DOC.HIGHLIGHT . Highlighted terms can be the words or phrases that satisfy a word or an ABOUT
query.
If a document is formatted, the text is filtered into either plain text or HTML and the offset information is generated for the filtered text. The offset information can be used to highlight query terms for the same document filtered with CTX_DOC.FILTER .
Highlight tables can be named anything, but must include the following columns, with names and datatypes as specified:
Table A-10 Highlight Table
Column Name | Type | Description |
---|---|---|
|
|
The identifier for the results generated by a particular call to CTX_DOC.HIGHLIGHT (only populated when table is used to store results from multiple |
|
|
The position of the highlight in the document, relative to the start of document which has a position of 1. |
|
|
The length of the highlight. |
A.2.4 Markup Table
A markup table stores documents in plain text or HTML format with the query terms in the documents highlighted by markup tags. This information is generated when you call CTX_DOC.MARKUP .
Markup tables can be named anything, but must include the following columns, with names and datatypes as specified:
Table A-11 Markup Table
Column Name | Type | Description |
---|---|---|
|
|
The identifier for the results generated by a particular call to |
|
|
Marked-up text of the document, stored in plain text or HTML format |
A.2.5 Theme Table
A theme table stores one row for each theme generated by CTX_DOC.THEMES. The value stored in the THEME
column is either a single theme phrase or a string of parent themes, separated by colons.
Theme tables can be named anything, but must include the following columns, with names and data types as specified:
Table A-12 Theme Table
Column Name | Type | Description |
---|---|---|
|
|
Query ID |
|
|
Theme phrase or string of parent themes separated by colons (:). |
|
|
Weight of theme phrase relative to other theme phrases for the document. |
A.2.6 Token Table
A token table stores the text tokens for a document as output by the CTX_DOC.TOKENS
procedure. Token tables can be named anything, but must include the following columns, with names and data types as specified.
Table A-13 Token Table
Column Name | Type | Description |
---|---|---|
|
|
The identifier for the results generated by a particular call to CTX_DOC.HIGHLIGHT (only populated when table is used to store results from multiple |
|
|
The token string in the text. |
|
|
The position of the token in the document, relative to the start of document which has a position of 1. |
|
|
The character length of the token. |
THES_TOKENS |
VARCHAR2(4000) |
Synonyms or broader terms generated using the thesaurus for the token in TOKEN column. These are separated using colons.
|
A.3 CTX_THES Result Tables and Data Types
The CTX_THES
expansion functions such as BT
, NT
, and SYN
can return the expansions in a table of type EXP_TAB
. Specify the name of your table with the restab argument.
A.3.1 EXP_TAB Table Type
The EXP_TAB
table type is a table of rows of type EXP_REC
.
The EXP_REC
and EXP_TAB
types are defined as follows in the CTXSYS
schema:
type exp_rec is record ( xrel varchar2(12), xlevel number, xphrase varchar2(256) ); type exp_tab is table of exp_rec index by binary_integer;
When you call a thesaurus expansion function and specify restab, the system returns the expansion as an EXP_TAB
table. Each row in this table is of type EXP_REC
and represents a word or phrase in the expansion. Table A-14 describes the fields in EXP_REC
:
Table A-14 EXP_TAB Table Type (EXP_REC)
EXP_REC Field | Description |
---|---|
|
The |
|
The The The The |
|
The |