AlgoliaSearch\Index::clearIndex PHP Méthode

clearIndex() public méthode

This function deletes the index content. Settings and index specific API keys are kept untouched.
public clearIndex ( ) : mixed
Résultat mixed
    public function clearIndex()
    {
        return $this->client->request($this->context, 'POST', '/1/indexes/' . $this->urlIndexName . '/clear', null, null, $this->context->writeHostsArray, $this->context->connectTimeout, $this->context->readTimeout);
    }

Usage Example

 /**
  * {@inheritDoc}
  */
 public function synchronize(array $documents)
 {
     if ($this->clearOnSync) {
         $this->index->clearIndex();
     }
     $this->index->addObjects($documents);
 }
All Usage Examples Of AlgoliaSearch\Index::clearIndex