Optimize an Opensolr Index

Merge segments, drop deleted documents

Optimize

Over time an Opensolr Index is split into many small pieces, called segments, and keeps deleted documents on disk. Optimize merges the segments and drops the deleted documents for good.

01 · When to use it

  • After deleting or updating many documents, to free their disk space.
  • When the Deleted Docs count is high compared to Documents.

02 · Steps

  1. Open the control panel of the index and click Tools.
  2. Under Utilities, click Optimize. Opensolr first checks the index and shows Segments, Index Size, Documents and Deleted Docs.
  3. If it says “No optimization running”, click Start Optimization. If one is already running, Check Again later.
  4. It runs in the background: the window shows “Optimization Started” and a Check Status button. Check later: while it runs you see “Optimization Running”; when “No optimization running” is back, it is over and the numbers are the new ones.
Before you start

The index may double in size on disk while it runs, so keep room under your disk space limit. Avoid writing to the index meanwhile. Searches keep working.

To run it on its own every few days: Schedule Optimize. By API: API: Optimize a Solr Index and API: Check Optimize Status.

Index Tools