IBM Books
(C) IBM Corp. 2000

DB2 Net Search Extender Administration and User's Guide

UPDATE INDEX

This command immediately starts the indexing process by bringing the index up to date to reflect the current contents of the text columns with which the index is associated.

While the update is being performed, search using the CONTAINS predicate is possible. For an index with an activated cached result table, search by stored procedure is also possible during update. However, columns in the cached table may show new values, even though the changed text is not yet committed to the full-text index.

Using the RECREATE INDEX ON UPDATE option in the CREATE INDEX command will clear the index before recreation. Until completion of the update, empty results will be returned.

Authorization

According to the DB2 catalog views, the user ID in this command must have the CONTROL privilege on the table the full-text index was created for.

Command syntax

>>-UPDATE-INDEX--+------------------+--index-name--FOR-TEXT----->
                 '-index-schema-"."-'
 
>--+------------+--+--------------------+----------------------->
   '-REORGANIZE-'  '-COMMITCOUNT--count-'
 
>--+----------------------+--+----------------------+----------><
   '-USING-UPDATE-MINIMUM-'  '-|connection-options|-'
 
connection-options
 
|--+--------------------------------------------------------------+--|
   '-CONNECT-TO--database-name--+-------------------------------+-'
                                '-USER--userid--USING--password-'
 
 

Command parameters

index-schema
The schema of the text index. This is specified in the CREATE INDEX command. If no schema is specified, the user ID of the DB2 connection is used.

index-name
The name of the text index. This is specified in the CREATE INDEX command.

REORGANIZE
If a text column is frequently updated, then subsequent updates to the index can become inefficient. To make the update process efficient again, reorganize the index. Use the DB2EXT.TEXTINDEXES view to determine if an index needs to be reorganized.

Use the REORGANIZE AUTOMATIC option of the CREATE INDEX command to avoid manually checking and reorganizing the index.

Note

The reorganization process takes place after a regular update.

USING UPDATE MINIMUM
Uses the UPDATE MINIMUM settings from the CREATE INDEX command and starts an incremental update only if the specified number of changes was reached. The default is to unconditionally start the update.

For distributed databases, the UPDATE MINIMUM is checked on every node.

See CREATE INDEX for additional information.

COMMITCOUNT count
An INTEGER value >=0 displays the number of documents processed in one transaction by the search engine and by DB2 for incremental index updates.

However, for initial updates, such as the first update after the CREATE INDEX command, or any update with RECREATE INDEX ON UPDATE option, there is only one logical transaction which ignores COMMITCOUNT. This may be changed using the ALTER INDEX command.

CONNECT TO database-name
The name of the database that is target for this command. You can omit this parameter, if DB2DBDFT is set and the user is running the command on the server. Note that the user ID must have the required DB2 authorizations.

USER userid USING password
Use a password and userid to connect to the database. If not specified, a connection is attempted from the current user ID without a password.

Usage

This command runs synchronously. It starts the update processing on all required DB2 logical/physical nodes in a distributed DB2 environment. The duration depends on the number of files to be indexed and the number of documents already indexed. The status of the update can be seen through a view that is created for each index. The name of this view can be retrieved from DB2EXT.TEXTINDEXES in column EVENTVIEWNAME. For further information, refer to Appendix C, Net Search Extender information catalogs.

There are two options to view the number of commited documents that have been processed. To determine if an update is still running and how many documents have been committed to the index, use the DB2EXT.TEXTINDEXES (NUMBER_DOCS) view. Use the event view associated with the index for information on starting, committing changes, and finishing update processing.

To view the number of uncommited documents that are to be processed, use the CONTROL LIST ALL LOCKS FOR INDEX command.

Note

The views only display information from the connected node.

For incremental updates on a base table with physical nodes, the time on each node must be synchronized. If the times are not synchronized, updates maybe lost or may not occur at all.

You cannot issue the command if one of the following commands is running on the index:

After updating an index with a deactivated persistent cached result table, the persistent cache is deleted, such that the next ACTIVATE CACHE command recreates it based on the database content.

If the user interrupts this command, all processes involved in the update function will stop. If a commitcount was used in an incremental update, some updates may be visible in the index, while others may require a new update command.

To stop the automatic updating of an index, look for the DB2 instance owner process running the update index command on the partition used for update services. Stop this process and the update processing on all the partitions.

Note

As the command works in two separate phases for index creation on all partitions and initial index updates, issue a db2text drop index command to ensure that the index is not partly available. If this command is not issued, the next update, which can be triggered by update command or the update frequency option, would perform a complete re-indexing to ensure a consistent state.

Changes to the database

When using the replication capture tables, the following changes are made to the database.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]