Action API

This API is deprecated, please refer to the new RESTFul API instead.


The action API performs actions such as:

  • optimize: optimizes the index.
  • reload: reloads the index.
  • deleteAll: truncates the index.
  • online: sets the index online.
  • offline: sets the index offline.
  • readonly: sets the index to read only mode.
  • readwrite: sets the index to read/write mode.


  • use (required): The name of the index.
  • login (optional): The login parameter. This becomes required once you create a user.
  • key (optional): The key parameter related to the login (api key). This becomes required once you create a user.
  • action (required): The action to perform: optimize, reload, deleteAll, online, offline, readonly, readwrite.


Optimize an index.


Truncate an index. This example call includes authentication parameters.



$ossapi = new OssApi('http://localhost:9090', 'index1');
$ossapi->credential('admin', '584207379c568c724de883717be8');

HTTP response

The following indicates that the index was optimized.

    <entry key="Status">OK</entry>

View/edit on GitHub

comments powered by Disqus