Deletes whole Solr index. Use with care.
963893
def deleteAll(self):
        
        for core in self.endpoints:
            self._send_solr_command(self.endpoints[core], "{\"delete\": { \"query\" : \"*:*\"}}")
281798
def delete_search_document(self, *, index):
        """"""
        cache.delete(self.search_document_cache_key)
        get_client().delete(index=index, doc_type=self.search_doc_type, id=self.pk)
657063
def cleanup(self):
        """"""
        for _id, shard in self._shards.items():
            if shard.get('isServer', False):
                Servers().remove(shard['_id'])
            if shard.get('isReplicaSet', False):
                ReplicaSets().remove(shard['_id'])

        for mongos in self._routers:
            Servers().remove(mongos)

        for config_id in self._configsvrs:
            self.configdb_singleton.remove(config_id)

        self._configsvrs = []
        self._routers = []
        self._shards = {}
594196
def delete_all_but_self(self):
        
        prefix = self.settings.alias
        name = self.settings.index

        if prefix == name:
            Log.note("{{index_name}} will not be deleted",  index_name= prefix)
        for a in self.cluster.get_aliases():
            # MATCH <prefix>YYMMDD_HHMMSS FORMAT
            if re.match(re.escape(prefix) + "\\d{8}_\\d{6}", a.index) and a.index != name:
                self.cluster.delete_index(a.index)
139309
def delete_index_files(self):
        
        self.clear_cache()
        db_path = self.db.local_db_path()
        if exists(db_path):
            remove(db_path)
69907
private void attemptDelete()
   {
      synchronized (deletable)
      {
         for (Iterator<String> it = deletable.iterator(); it.hasNext();)
         {
            String indexName = it.next();
            if (directoryManager.delete(indexName))
            {
               it.remove();
            }
            else
            {
               LOG.info("Unable to delete obsolete index: " + indexName);
            }
         }
      }
   }
247523
def delete_index(self,*fields):
        """"""
        for f in fields:
            if not f in self.indices:
                raise ValueError,"No index on field %s" %f
        for f in fields:
            del self.indices[f]
        self.commit()
651838
def destroy_index(self):
        
        self.close()
        logger.info("Destroying the index ...")
        rm_rf(self.indexdir)
        rm_rf(self.label_guesser_dir)
        logger.info("Done")
47870
public function emptyIndexAction()
    {
        $siteHash = $this->selectedSite->getSiteHash();

        try {
            $affectedCores = [];
            $solrServers = $this->solrConnectionManager->getConnectionsBySite($this->selectedSite);
            foreach ($solrServers as $solrServer) {
                $writeService = $solrServer->getWriteService();
                /* @var $solrServer SolrConnection */
                $writeService->deleteByQuery('siteHash:' . $siteHash);
                $writeService->commit(false, false, false);
                $affectedCores[] = $writeService->getPrimaryEndpoint()->getCore();
            }
            $message = LocalizationUtility::translate('solr.backend.index_administration.index_emptied_all', 'Solr', [$this->selectedSite->getLabel(), implode(', ', $affectedCores)]);
            $this->addFlashMessage($message);
        } catch (\Exception $e) {
            $this->addFlashMessage(LocalizationUtility::translate('solr.backend.index_administration.error.on_empty_index', 'Solr', [$e->__toString()]), '', FlashMessage::ERROR);
        }

        $this->redirect('index');
    }
1077420
def clear_es():
        """"""
        # TODO: should receive a catalog slug.
        ESHypermap.es.indices.delete(ESHypermap.index_name, ignore=[400, 404])
        LOGGER.debug('Elasticsearch: Index cleared')
421884
public function cleanup()
    {
        // Indexing is not implemented in eZ Publish 5 legacy search engine
        if ( $this->searchHandler instanceof LegacyHandler )
        {
            $db = eZDB::instance();
            $db->begin();
            $db->query( "DELETE FROM ezsearch_word" );
            $db->query( "DELETE FROM ezsearch_object_word_link" );
            $db->commit();
        }
        else if ( method_exists( $this->searchHandler, 'purgeIndex' ) )
        {
            $this->searchHandler->purgeIndex();
        }
    }
1327716
public void truncate() {
        Log.info("Truncating index");
        try {
            indexWriter.deleteAll();
        } catch (IOException e) {
            Log.error(e, "Error while truncating index");
            throw new RuntimeException(e);
        }
    }
534530
def delete_all(self):
        ''''''
        def delete_action_gen():
            scanner = scan(self.es,
                           index=self.index_name,
                           query={'query': {'match_all':{}}})
            for v in scanner:
                yield { '_op_type': 'delete',
                        '_index': self.index_name,
                        '_type': v['_type'],
                        '_id': v['_id'],
                      }
        bulk(self.es, delete_action_gen())
527745
def _flush_index(self):
        
        data = {'version': self.version, 'index': self._index}
        with open(self._get_path('index.json'), 'w') as f:
            json.dump(data, f)
        self.__index = None
1124115
def remove_index(self):
        """"""
        self.index_client.close(self.index_name)
        self.index_client.delete(self.index_name)
1306106
public function clearIndex()
    {
        $this->eventManager->dispatch(Events::PRE_CLEAR_INDEX, new Event($this->solrClientCore));

        try {
            $client = new SolariumMulticoreClient($this->solrClientCore);
            $client->clearCores();
        } catch (\Exception $e) {
            $errorEvent = new ErrorEvent(null, null, 'clear-index');
            $errorEvent->setException($e);

            $this->eventManager->dispatch(Events::ERROR, $errorEvent);

            throw new SolrException($e->getMessage(), $e->getCode(), $e);
        }

        $this->eventManager->dispatch(Events::POST_CLEAR_INDEX, new Event($this->solrClientCore));
    }
32856
public void clearIndex(Index index) {
    BulkIndexer.delete(esClient, IndexType.main(index, index.getName()), esClient.prepareSearch(index).setQuery(matchAllQuery()));
  }