Oracle8i Application Developer's Guide - XML
Release 3 (8.1.7)

Part Number A86030-01

Library

Solution Area

Contents

Index

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

Using interMedia Text to Search and Retrieve Data from XML Documents, 16 of 22


Procedure for Building a Query Application with interMedia Text

To build the query application with interMedia Text carry out the following indexing steps first. These steps are described in a previous section, "interMedia Text Indexes".

  1. Grant ctxapp permission to the user

  2. Create a parameterized Text index.

  3. Index the documents

  4. Present the documents that satisfy the query

The next step is to build your query application. To do so follow these steps:

  1. Create a preference using the procedure, CTX_DDL.create_preference. See "1 Create a Preference"

  2. Set preference's attributes using CTX_DDL.Add_Attr_Section and so on. See "2 Set the Preference's Attributes".

  3. Create your query syntax

You can query within attribute sections when you index with either XML_SECTION_GROUP or AUTOMATIC_SECTION_GROUP as your section group type.


Note:

  • Not everything in your document may be searchable. You must first state what is searchable using the.......add_....._section

  • The more sections you add to your index the longer the search will take!

 

Nested tag searching is supported in interMedia Text.

Using Table CTX_OBJECTS and CTX_OBJECT_ATTRIBUTES View

The CTX_OBJECT_ATTRIBUTES view displays attributes that can be assigned to preferences of each object. It can be queried by all users.

Check out the structure of CTX_OBJECTS and CTX_OBJECT_ATTRIBUTE view, with the following DESCRIBE commands. Because we are only interested in querying XML documents in this chapter, we focus on XML_SECTION_GROUP and AUTO_SECTION_GROUP.

Describe ctx_objects
  SELECT obj_class, obj_name FROM ctx_objects
  ORDRR BY obj_class, obj_name;

The result is:

...
SECTION_GROUP                  AUTO_SECTION_GROUP    <<==
SECTION_GROUP                  BASIC_SECTION_GROUP
SECTION_GROUP                  HTML_SECTION_GROUP
SECTION_GROUP                  NEWS_SECTION_GROUP
SECTION_GROUP                  NULL_SECTION_GROUP
SECTION_GROUP                  XML_SECTION_GROUP     <<==

...

Describe ctx_object_attributes
SELECT oat_attribute FROM ctx_object_attributes
  WHERE oat_object = 'XML_SECTION_GROUP';

The result is:

OAT_ATTRIBUTE
-------------
ATTR
FIELD
SPECIAL
ZONE

SELECT oat_attribute FROM ctx_object_attributes
  WHERE oat_object = 'AUTO_SECTION_GROUP';

The result is:

OAT_ATTRIBUTE
-------------
STOP

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

All Rights Reserved.

Library

Solution Area

Contents

Index