Oracle Internet File System Setup and Administration Guide Release 9.0.2 Part Number A95995-01 |
|
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:
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.
The Oracle 9iFS Configuration Assistant uses the following SQL scripts to create the IFS_TEXT index:
CreateContextFunnelProcedure.sql: Creates the procedure used by USER DATASTORE.
GrantContextToIFS.sql
: Grants access to some Oracle Text-specific commands to the Oracle 9iFS user.
CreateContextPreferences.sql
: Tablespace and other text preferences are created by the Oracle 9iFS user.
CreateContextIndex.sql
: Based on these text preferences, IFS_TEXT index is created.
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.
The Oracle Text index is not like a regular index in that updating does not happen within the insert/update transaction. A separate "index refresh" must take place. The refresh is accomplished with the ctx_ddl.sync_index
procedure. It can be easily set up as a dbms_job to run at any frequency. This procedure does not rebuild the entire index. It only adds the records that have been inserted or changed (or deleted) since the last sync. Therefore the more frequently it runs, the faster it goes.
The downside to running this frequently is that the index becomes fragmented with eventual performance implications. This can be rectified by occasionally optimizing the index.
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.
The PL/SQL interface for index maintenance is preferable for a production system:
These two commands can run simultaneously. You can run these commands using the Oracle Enterprise Manager Java Console job system. Another option is the DBMS_JOB package, which is described in the Oracle9i Database Administrator's Guide.
To use the Oracle Enterprise Manager Java Console job system, you need to make sure it has been configured correctly. Refer to "Enabling the Job System" in the Oracle Enterprise Manager Configuration Guide.
For more information about creating and monitoring jobs refer to the Oracle9i Enterprise Manager Administrator's Guide.
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:
You can view which documents generated errors when they were indexed by Oracle Text by examining $ORACLE_ HOME/9ifs/admin/sql/ViewContextErrors.sql
.
If you want to monitor each document as it is indexed by Oracle Text, you can use the procedure ctx_output.add_event()
prior to synchronizing the Oracle Text index. See the example, $ORACLE_ HOME/9ifs/admin/sql/SyncContextIndex.sql.
For an example of viewing more information about the documents that have just been indexed by Oracle Text, see $ORACLE_ HOME/9ifs/admin/sql/ViewDocumentByRowID.sql
.
The following additional features of Oracle Text provide users viewing options, additional search operators and functions, and a variety of other queries.
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.
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.
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.
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');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');For more information on themes, see Oracle Text Application Developer's Guide.
For detailed information on Oracle Text, see http://technet.oracle.com/products/text/.
|
Copyright © 1999, 2002 Oracle Corporation. All Rights Reserved. |
|