Elastica\Index::close PHP Method

close() public method

Closes the index.
public close ( ) : Response
return Response Response object
    public function close()
    {
        return $this->request('_close', Request::POST);
    }

Usage Example

 /**
  * Stores the settings in the index
  * This is needed for things like tokenizers and analyzers
  * @param array $settings
  */
 protected function applySettings(array $settings)
 {
     $this->index->close();
     sleep(2);
     try {
         $this->index->setSettings($settings);
     } catch (\Exception $e) {
         $this->outputLine($e->getMessage());
     }
     sleep(2);
     $this->index->open();
 }