Oracle8i interMedia Text Reference
Release 8.1.5

A67843-01

Library

Product

Contents

Index

Prev Next

B
Result Tables

This appendix describes the structure of the result tables used to store the output generated by the procedures in CTX_QUERY and CTX_DOC.

The following topics are discussed in this appendix:

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 datatypes.

This section describes the following types of result tables, and their required columns:

EXPLAIN Table

Table B-1 describes the structure of the table to which CTX_QUERY.EXPLAIN writes its results.

.
Table B-1
Column Name  Datatype  Description 

EXPLAIN_ID  

VARCHAR2(30)  

The value of the explain_id argument specified in the FEEDBACK call.  

ID  

NUMBER  

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.  

PARENT_ID  

NUMBER  

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 PARENT_ID = 0.  

OPERATION  

VARCHAR2(30)  

Name of the internal operation performed. Refer to Table B-2 for possible values.  

OPTIONS  

VARCHAR2(30)  

Characters that describe a variation on the operation described in the OPERATION column. When an OPERATION has more than one OPTIONS associated with it, OPTIONS values are concatenated in the order of processing. See Table B-3 for possible values.  

OBJECT_NAME  

VARCHAR2(80)  

Section name, wildcard term, weight, or threshold value or term to lookup in the index.  

POSITION  

NUMBER  

The order of processing for nodes that all have the same PARENT_ID.The positions are numbered in ascending order starting at 1.  

CARDINALITY  

NUMBER  

Reserved for future use. You should create this column for forward compatibility.  

Operation Column Values

Table B-2 shows the possible values for the OPERATION column of the explain and hfeedback tables.

Table B-2
Operation Value  Query Operator  Equivalent Symbol 

ABOUT  

ABOUT  

(none)  

ACCUMULATE  

ACCUM  

,  

AND  

AND  

&  

COMPOSITE  

(none)  

(none)  

EQUIVALENCE  

EQUIV  

=  

MINUS  

MINUS  

-  

NEAR  

NEAR  

;  

NOT  

NOT  

~  

NO_HITS  

(no hits will result from this query)  

 

OR  

OR  

|  

PHRASE  

(a phrase term)  

 

SECTION  

(section)  

 

THRESHOLD  

>  

>  

WEIGHT  

*  

*  

WITHIN  

within  

(none)  

WORD  

(a single term)  

 

OPTIONS Column Values

The following table list the possible values for the OPTION column of the explain table.

Table B-3
Options Value  Description 

($)  

Stem  

(?)  

Fuzzy  

(!)  

Soundex  

(T)  

Order for ordered Near.  

(F)  

Order for unordered Near.  

(n)  

A number associated with the max_span parameter for the Near operator.  

HFEEDBACK Table

Table B-4 describes the table to which CTX_QUERY.HFEEDBACK writes its results.

Table B-4
Column Name  Datatype  Description 

FEEDBACK_ID  

VARCHAR2(30)  

The value of the feedback_id argument specified in the HFEEDBACK call.  

ID  

NUMBER  

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.  

PARENT_ID  

NUMBER  

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 PARENT_ID = 0.  

OPERATION  

VARCHAR2(30)  

Name of the internal operation performed. Refer to Table B-2 for possible values.  

OPTIONS  

VARCHAR2(30)  

Characters that describe a variation on the operation described in the OPERATION column. When an OPERATION has more than one OPTIONS associated with it, OPTIONS values are concatenated in the order of processing. See Table B-5 for possible values.  

OBJECT_NAME  

VARCHAR2(80)  

Section name, wildcard term, weight, threshold value or term to lookup in the index.  

POSITION  

NUMBER  

The order of processing for nodes that all have the same PARENT_ID.The positions are numbered in ascending order starting at 1.  

BT_FEEDBACK  

CTX_FEEDBACK_TYPE  

Stores broader feedback terms. See Table B-6.  

PT_FEEDBACK  

CTX_FEEDBACK_TYPE  

Stores related feedback terms. See Table B-6.  

NT_FEEDBACK  

CTX_FEEDBACK_TYPE  

Stores narrower feedback terms. See Table B-6.  

OPTIONS Column Values

The following table list the values for the OPTIONS column of the feedback table.

Table B-5
Options Value  Description 

(T)  

Order for ordered Near.  

(F)  

Order for unordered Near.  

(n)  

A number associated with the max_span parameter for the Near operator.  

CTX_FEEDBACK_TYPE

The CTX_FEEDBACK_TYPE is a nested table of objects. This datatype is pre-defined 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 pre-defined in the ctxsys schema. This object is defined with three members and one method as follows:

Table B-6
CTX_FEEDBACK_ITEM_TYPE Members and Methods  Type  Description 

text  

member  

Feedback term.  

cardinality  

member  

(reserved for future use.)  

score  

member  

(reserved for future use.)  

rank  

method  

(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 Chapter 9.  

CTX_DOC Result Tables

For the CTX_DOC 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 datatypes.

This section describes the following types of result tables, and their required columns:

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 B-7
Column Name  Type  Description 

QUERY_ID  

NUMBER  

The identifier for the results generated by a particular call to CTX_DOC.FILTER (only populated when table is used to store results from multiple FILTER calls)  

DOCUMENT  

CLOB  

Text of the document, stored in plain text or HTML.  

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 B-8
Column Name  Type  Description 

QUERY_ID  

NUMBER  

Query ID.  

POV  

VARCHAR2(80)  

Document theme. Case depends of how themes were used in document or represented in the knowledge base.

POV has the value of GENERIC for the document GIST.  

GIST  

CLOB  

Text of Gist or theme summary, stored as plain text  

Highlight Table

A highlight table stores offset and length information for highlighted terms in document 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 B-9
Column Name  Type  Description 

QUERY_ID  

NUMBER  

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 HIGHLIGHT calls)  

OFFSET  

NUMBER  

The position of the highlight in the document, relative to the start of document which has a position of 1.  

LENGTH  

NUMBER  

The length of the highlight.  

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 B-10
Column Name  Type  Description 

QUERY_ID  

NUMBER  

The identifier for the results generated by a particular call to CTX_DOC.MARKUP (only populated when table is used to store results from multiple MARKUP calls)  

DOCUMENT  

CLOB  

Marked-up text of the document, stored in plain text or HTML format  

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 datatypes as specified:

Table B-11
Column Name  Type  Description 

QUERY_ID  

NUMBER  

Query ID  

THEME  

VARCHAR2(2000)  

Theme phrase or string of parent themes separated by colons (:).  

WEIGHT  

NUMBER  

Weight of theme phrase relative to other theme phrases for the document.  




Prev

Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index