Oracle Internet File System Setup and Administration Guide Release 9.0.1 Part Number A81197-06 |
|
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.
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.
Two options on the ALTER INDEX command are used for automated index maintenance: SYNC and OPTIMIZE.
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.
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.
The PL/SQL interface for index maintenance is preferable for a production system:
ctx_ddl.sync_index(indexname);
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.
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.
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:
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 Oracle9i Text Application Developer's Guide.
For detailed information on Oracle Text, consult http://technet.oracle.com/products/text/.
|
![]() Copyright © 2001 Oracle Corporation. All Rights Reserved. | | Ad Choices. |
|