The SYSTS_UPDATE procedure updates the text search index to reflect the current contents of the text column with which the index is associated.
While the update is being done, a search is possible. Until completion of the update, the search operates on a partially updated index.
The procedure issues an UPDATE INDEX text search administration command on the database server.
None
>>-SYSTS_UPDATE--(--index_schema--,--index_name--,--------------> >--update_options--,--message_locale--,--message--)------------><
The schema is SYSPROC.
UPDATE OPTIONS value | Description |
---|---|
USING UPDATE MINIMUM | This option enforces the use of the UPDATE MINIMUM value that is defined for the text search index and processes updates if the specified minimum number of changes occurred. |
FOR DATA REDISTRIBUTION | This option specifies that a text search index in a partitioned database must be refreshed after data partitions are added or removed and a subsequent data redistribution operation must be completed. Search results might be inconsistent until the text search index is updated with the FOR DATA REDISTRIBUTION option. |
ALLROWS | This option specifies that an initial update must be attempted unconditionally. |
UPDATEAUTOCOMMIT commitsize | Specifies the number of rows or number of hours after which a commit is run to automatically preserve the previous work for either initial or incremental updates. If you specify the number of rows:
If
you specify the number of hours:
For initial updates, the index update processes batches of documents from the base table. After the commitsize value is reached, update processing completes a COMMIT operation and the last processed key is saved in the staging table with operational identifier '4'. This key is used to restart update processing either after a failure or after the number of specified commitcycles are completed. If a commitcycles is specified, the update mode is modified to incremental to initiate capturing changes by using the LOGTYPE BASIC option to create triggers on the text table. However, until the initial update is complete, log entries that are generated by documents that have not been processed in a previous cycle are removed from the staging table. Using the UPDATEAUTOCOMMIT option for an initial text index update leads to a significant increase of execution time. For incremental updates, log entries that are processed are removed correspondingly from the staging table with each interim commit. |
COMMITTYPE | Specifies rows or hours for the UPDATEAUTOCOMMIT index configuration option. The default is rows. |
COMMITCYCLES | Specifies the number of commit cycles. The default is 0 for unlimited cycles. If cycles are not explicitly specified, the update operation uses as many cycles as required based on the batch size that is specified with the UPDATEAUTOCOMMIT option to finish the update processing. You can use this option with the UPDATEAUTOCOMMIT setting with a committype. |
CALL SYSPROC.SYSTS_UPDATE
('db2ts', 'myTextIndex', '', 'en_US', ?)
Value of output parameters
--------------------------
Parameter Name : MESSAGE
Parameter Value : Operation completed successfully.
CALL SYSPROC.SYSTS_UPDATE
('db2ts', 'myTextIndex2', 'FOR DATA REDISTRIBUTION', 'en_US', ?)
Value of output parameters
--------------------------
Parameter Name : MESSAGE
Parameter Value : Operation completed successfully.
Return Status = 0
Example 3: In the following example, SYSTS_UPDATE is called to update a text search index with index_schema 'db2ts' and index_name 'myTextIndex3'. In this example, the index does not exist and results in an error.
CALL SYSPROC.SYSTS_UPDATE('db2ts', 'myTextIndex3', 'USING UPDATE MINIMUM',
'en_US', ?)
SQL20427N An error occurred during a text search administration
procedure or command. The error message is "CIE00316 Text search
index "db2ts"."myTextIndex3" does not exist. ". SQLSTATE 38H14