Skip Headers

Oracle Internet File System Setup and Administration Guide
Release 9.0.1

Part Number A81197-06
Go To Table Of Contents
Contents
Go To Index
Index

Go to previous page Go to next page

E
Working with Oracle Text

This appendix provides detailed information on how Oracle Internet File System (Oracle 9iFS) leverages the indexing done by Oracle Text (formerly called interMedia Text). This section is meant to explain strategies for maintaining the Oracle Text index used by Oracle 9iFS. It also provides experienced DBAs with the information necessary to enable developers to access advanced Oracle Text features using the Oracle 9iFS Java API. This is not meant as a complete reference, but it should save you some time while developing Oracle 9iFS applications. Topics include:

The Oracle Text Index

Immediately following the Oracle Internet File System (Oracle 9iFS) installation process, the Configuration Assistant runs and populates the database schema used by Oracle 9iFS. Oracle 9iFS creates an Oracle Text index named IFS_TEXT.

SQL Scripts for Creating IFS_TEXT Index

The Oracle 9iFS Configuration Assistant uses the following SQL scripts to create the IFS_TEXT index:

Maintaining the IFS_TEXT Index

Oracle Text relies on the quality of its index for fast and accurate searches. Anyone seeking to improve performance can start with index issues first. If no further improvements can be made to your indexing scheme, the next step is to reevaluate your queries.

When content changes, the index may need to be updated to reflect these changes. Recreating the index from scratch is expensive, and document repositories tend to grow rather than shrink. As it happens, there are ways to balance the need for a fresh index with the need to minimize processing expense during peak periods. Please refer to the Oracle Text documentation for detailed information.

Index Maintenance

Indexes for Oracle Text can be created using a number of SQL and PL/SQL procedures. Before the Oracle9i database, Oracle Text was an optional feature, and required a process called CTXSRV to be running for any indexes to be updated. This process is still used, but it is deprecated in the Oracle9i database.

Using SQL ALTER INDEX

Two options on the ALTER INDEX command are used for automated index maintenance: SYNC and OPTIMIZE.

Update Index Using SYNC Option

The following SQL command causes an immediate update of the index:


ALTER INDEX IFS_TEXT REBUILD ONLINE PARAMETERS ('sync');

This option can be used to force manual re-indexing, but since it is designed for minimal impact on real-time performance, no attempt is made to prevent redundancy. A frequently changing corpus whose index is frequently synchronized will become fragmented, affecting performance negatively.

When a document to which the index refers is deleted, its corresponding token entries become unavailable immediately. Inserts and updates are different. Tokens within new documents are not visible to text searches until the next index sync has occurred. Any alteration to a document also invalidates any token entries referring to that document. That document effectively becomes invisible to content searches until the next index sync occurs.

Defragment Existing Index with OPTIMIZE Option

The Optimize option causes ALTER INDEX to rebuild the existing index, eliminating redundant token entries, and removing entries that reference removed content:

ALTER INDEX indexname REBUILD ONLINE PARAMETERS ('optimize fast|full');

The SQL interface will not allow two ALTER INDEX statements to run at the same time.

Using the PL/SQL Package

The PL/SQL interface for index maintenance is preferable for a production system:

Sync Existing IFS_TEXT Index

ctx_ddl.sync_index(indexname);

Optimize IFS_TEXT Index

ctx_ddl.optimize_index(indexname, 'FAST'|'FULL', maxtime );

These two commands can run simultaneously. You can run these commands using the Oracle9i Enterprise Manager job system. Another option is the DBMS_JOB package, which is described in the Oracle9i Database Administrator's Guide.

Using the Oracle9i Enterprise Manager Job System to Schedule Oracle Text Jobs

To use the Oracle9i Enterprise Manager job system, you need to make sure it has been configured correctly. Refer to "Enabling the Job System" in the Oracle9i Enterprise Manager Configuration Guide.

  1. To display the Create Job property sheet, select Create Job from the Job menu.

Figure 9-1 Create Job Property Sheet


Text description of ejob1.gif follows.
Text description of the illustration ejob1.gif
  • On the General tab, enter a job name and select the target database.

  • On the Tasks tab, select the task: Run SQL*Plus Script.

    Figure 9-2 Tasks Tab


    Text description of ejob2.gif follows.
    Text description of the illustration ejob2.gif
  • On the Parameters tab in the Script Text box, enter the SQL syntax or SQL script for the job. Make sure you use the preferred credentials for your IFSSYS schema.

    Figure 9-3 Parameters Tab


    Text description of ejob3.gif follows.
    Text description of the illustration ejob3.gif
  • On the Schedule tab, enter how frequently you want the job to run and its execution start date and time.

    Figure 9-4 Schedule Tab


    Text description of ejob4.gif follows.
    Text description of the illustration ejob4.gif
  • Select the Submit and Add to Library option and click Save to save the job to the job library and to send the job to the Intelligent Agents at the selected destinations. The job appears in the Active page and the job library. You can modify or submit a saved job at a later time.

    Figure 9-5 Job Library


    Text description of ejoblibl.gif follows.
    Text description of the illustration ejoblibl.gif

    For more information about creating and monitoring jobs refer to the Oracle9i Enterprise Manager Administrator's Guide.

    Using Oracle 9iFS Manager to Designate Indexing

    To illustrate the way Oracle 9iFS works with Oracle Text, consider this example: Imagine you want to index the content of some .java source files. Before placing them into the repository, you notice that, by default, Oracle 9iFS does not consider these files candidates for indexing.

    If your goal is to provide content searching on these files, you need them to be indexed by Oracle Text. The most straightforward way would be as follows:

    1. Use the Oracle 9iFS Manager tool to add the .java mimetype and designate it as To Be Indexed, using the Create Format dialog.

    Figure 9-6 Create Format Dialog


    Text description of ecreatef.gif follows.
    Text description of the illustration ecreatef.gif
  • Insert the files into the repository.

  • Sync the index.

    Additional Features of Oracle Text

    The following additional features of Oracle Text provide users viewing options, additional search operators and functions, and a variety of other queries.

    Document Services

    Oracle Text includes a set of features referred to as Document Services, which grant users the ability to view results in unformatted text, the original document format, or in HTML.

    XML Indexing

    Metadata formatted in XML is easily indexed and queried using the Oracle Text syntax. Special components called Sectioners are used to limit the scope of a query according to XML tags, with the Autosectioner indiscriminately indexing every XML tag it encounters, and the XML Sectioner requiring more input in return for greater power and flexibility.

    For more information about defining sections in XML and news group formatted documents, consult the Oracle9i Text Reference.

    Theme Indexing

    Oracle Text supports the ability to generate themes based on the file's content. By default, Oracle 9iFS has turned off theme indexing since it takes longer to index the content. To use themes, custom application development is also required because the Oracle 9iFS clients do not expose themes in the user interfaces. See "Document" in the Javadoc for more information regarding custom application development using themes.

    Turning On Theme Indexing

    In SQL*PLUS, connect as the Oracle 9iFS schema user, and enter:

    exec ctx_ddl.set_attribute('ifs_default_lexer', 'index_themes', 'yes');
    exec ctx_ddl.set_attribute('ifs_default_lexer', 'theme_language','english');
    alter index ifs_text rebuild parameters('replace lexer ifs_global_lexer');
    
    
    


    Warning:

    This operation may take a long time, since it must re-index all the document content, including themes. 


    Turning Off Theme Indexing

    In SQL*PLUS, connect as the Oracle 9iFS schema user, and enter:

    exec ctx_ddl.set_attribute('ifs_default_lexer', 'index_themes', 'no');
    alter index ifs_text rebuild parameters('replace lexer ifs_global_lexer');
    
    
    
    


    Warning:

    This will rebuild the entire index, without theme indexing. 


    For more information on themes, see Oracle9i Text Application Developer's Guide.

    See Also

    For detailed information on Oracle Text, consult http://technet.oracle.com/products/text/.


  • Go to previous page Go to next page
    Oracle
    Copyright © 2001 Oracle Corporation.

    All Rights Reserved.
    Go To Table Of Contents
    Contents
    Go To Index
    Index