Documentation Center

optimize

Triggers an optimization pass over the full-text search index, which reduces fragmentation, can increase speed of queries, and memory used during searching. This operation may require an extended amount of time, depending on the size of your database.

Description

Executing a optimize event defragments the Lucene full-text search index. Optimization is most useful after a large set of changes to the content loaded within the system (multiple larger Prepare or delete opeartions). During an optimize event, the Lucene full-text search index becomes read-only, which will delay other Prepare events from completing until this opration has completed.

Parameters

action
optimize

Example URL

http://<host>:<port>/<context>/web/search.xql?action=optimize

Successful Result

This function returns a standard API result element (<result status='SUCCESS' statusCode='0' message='Localized Message' messageKey='message.key'/>). A statusCode of 0 indicates a successful execution. Any other statusCode indicates a failure.

Failed Result

Accessing this API feature requires the "Manage application" permission, and the function will throw a permission exception if the permission is not available.