API - Optimize a Solr Index

Index Management

Optimize Solr Index

Optimization merges all index segments into one, improving search performance and reclaiming disk space from deleted documents. This operation runs asynchronously in the background — the API returns immediately and the optimization continues on the server.

Important:
  • Your index may temporarily double in size on disk during optimization
  • This can take a long time for large indexes
  • Avoid writing to the index while optimization is running
  • The index remains fully searchable during optimization
  1. GET https://opensolr.com/solr_manager/api/optimize
  2. Parameters:
    1. email - your Opensolr registration email address
    2. api_key - your Opensolr API key
    3. core_name - the name of the index you wish to optimize
  3. Example: https://opensolr.com/solr_manager/api/optimize?email=PLEASE_LOG_IN&api_key=PLEASE_LOG_IN&core_name=my_solr_index
  4. Response:
    {"status":true,"msg":"Optimization started. This runs in the background and may take a while for large indexes."}

Use the Check Optimize Status endpoint to monitor progress.