Try to find indexes that only changed their name, rename operations maybe cheaper than add/drop
however ambiguities between different possibilities should not lead to renaming at all.

@return void
356498
private function detectIndexRenamings(TableDiff $tableDifferences)
    {
        $renameCandidates = [];

        // Gather possible rename candidates by comparing each added and removed index based on semantics.
        foreach ($tableDifferences->addedIndexes as $addedIndexName => $addedIndex) {
            foreach ($tableDifferences->removedIndexes as $removedIndex) {
                if ($this->diffIndex($addedIndex, $removedIndex)) {
                    continue;
                }

                $renameCandidates[$addedIndex->getName()][] = [$removedIndex, $addedIndex, $addedIndexName];
            }
        }

        foreach ($renameCandidates as $candidateIndexes) {
            // If the current rename candidate contains exactly one semantically equal index,
            // we can safely rename it.
            // Otherwise it is unclear if a rename action is really intended,
            // therefore we let those ambiguous indexes be added/dropped.
            if (count($candidateIndexes) !== 1) {
                continue;
            }

            [$removedIndex, $addedIndex] = $candidateIndexes[0];

            $removedIndexName = strtolower($removedIndex->getName());
            $addedIndexName   = strtolower($addedIndex->getName());

            if (isset($tableDifferences->renamedIndexes[$removedIndexName])) {
                continue;
            }

            $tableDifferences->renamedIndexes[$removedIndexName] = $addedIndex;
            unset(
                $tableDifferences->addedIndexes[$addedIndexName],
                $tableDifferences->removedIndexes[$removedIndexName]
            );
        }
    }
206288
protected function checkIndex(Index $index, IgnoredChange $ignoredChange)
    {
        // Not needed to be implemented yet
        if ($ignoredChange->getPropertyName() !== $index->getName()) {
            return false;
        }

        return false;
    }
95794
protected function updateTargetIndex()
    {
        $targetIndex = $this->argument('target-index');

        $sourceIndexConfigurator = $this->getModel()
            ->getIndexConfigurator();

        $targetIndexPayload = (new RawPayload())
            ->set('index', $targetIndex)
            ->get();

        $indices = ElasticClient::indices();

        try {
            $indices->close($targetIndexPayload);

            if ($settings = $sourceIndexConfigurator->getSettings()) {
                $targetIndexSettingsPayload = (new RawPayload())
                    ->set('index', $targetIndex)
                    ->set('body.settings', $settings)
                    ->get();

                $indices->putSettings($targetIndexSettingsPayload);
            }

            if ($defaultMapping = $sourceIndexConfigurator->getDefaultMapping()) {
                $targetIndexMappingPayload = (new RawPayload())
                    ->set('index', $targetIndex)
                    ->set('type', '_default_')
                    ->set('body._default_', $defaultMapping)
                    ->get();

                $indices->putMapping($targetIndexMappingPayload);
            }

            $indices->open($targetIndexPayload);
        } catch (Exception $exception) {
            $indices->open($targetIndexPayload);

            throw $exception;
        }

        $this->info(sprintf(
            'The index %s was updated.',
            $targetIndex
        ));
    }
397673
protected function _createIndexIfNotExists() {
        $service        = $this->getService();
        $indexExists    = $service->doesIndexExist();

        if ($indexExists) {
            return self::MSG_INDEX_EXISTS;
        }

        return $service->createIndex()
            ? self::MSG_INDEX_CREATED
            : self::MSG_INDEX_CREATION_FAILURE;
    }
933888
def delete(index_name, force, verbose):
    """"""
    result = current_search_client.indices.delete(
        index=index_name,
        ignore=[400, 404] if force else None,
    )
    if verbose:
        click.echo(json.dumps(result))
1006339
def drop_index(index_name)
			transaction {
				ODBA.storage.drop_index(index_name)
				self.delete(self.indices[index_name]) 
			}
		end
9340
private function detectRenamedColumns(array &$createdColumns, array &$droppedColumns, array &$alteredColumns)
    {
        foreach ($createdColumns as $createdIndex => $createdColumn) {
            foreach ($droppedColumns as $droppedIndex => $droppedColumn) {
                $columnDiff = $this->columnComparator->compare($droppedColumn, $createdColumn);

                if ($columnDiff->hasNameDifferenceOnly()) {
                    $alteredColumns[] = $columnDiff;

                    unset($createdColumns[$createdIndex]);
                    unset($droppedColumns[$droppedIndex]);

                    break;
                }
            }
        }
    }
64677
def delete_index(es, index_name: str):
    """"""

    if not index_name:
        log.warn("No index name given to delete")
        return None

    result = es.indices.delete(index=index_name)
    return result
1041315
public function deleteIndex()
    {
        foreach ($this->locales as $locale) {
            $this->searchProvider->deleteIndex($this->indexName . '_' . $locale);
        }
    }
690775
public function removeIndex($name)
    {
        //check if we have a index with this name already, then delete it
        foreach ($this->indices as $n => $idx) {
            if ($idx->getName() == $name) {
                unset($this->indices[$n]);

                return;
            }
        }
    }
90977
def _purge_index(self, database_name,
                     collection_name=None, index_name=None):
        
        with self.__index_cache_lock:
            if not database_name in self.__index_cache:
                return

            if collection_name is None:
                del self.__index_cache[database_name]
                return

            if not collection_name in self.__index_cache[database_name]:
                return

            if index_name is None:
                del self.__index_cache[database_name][collection_name]
                return

            if index_name in self.__index_cache[database_name][collection_name]:
                del self.__index_cache[database_name][collection_name][index_name]
906545
private static function lookupRequestedChange()
    {
        // Only run if the query param is present
        if (!$change_id = request(Change::QUERY_KEY)) {
            return;
        }

        // Don't execute for classes that result in recusirve queries when the
        // Change model gets built below
        $class = get_called_class();
        if (in_array($class, [Change::class, Admin::class, Image::class])) {
            return;
        }

        // Check whether the referenced Change is for this class
        $change = Change::find($change_id);
        if ($class == $change->model) {
            return $change;
        }
    }
720085
public function dropIndexes($indexes)
    {
        $result = $this->database->createCommand()->dropIndexes($this->name, $indexes);
        return $result['nIndexesWas'];
    }
1339533
private function getChangedIndexes($tableName, TableDiff $diff)
    {
        /** @var $index \Doctrine\DBAL\Schema\Index */
        foreach ($diff->changedIndexes as $index) {
            $this->addMessage($tableName, sprintf('invalid index on `%s`', implode(', ', $index->getUnquotedColumns())));
        }
    }
53705
public boolean dropSingleIndex(String indexName) throws
            ElasticsearchException {
        DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest(indexName);
        DeleteIndexResponse res = this.client.admin().indices().delete(deleteIndexRequest).actionGet();
        return indexExists(indexName);
    }
1010073
protected function remakeAutoIncrementIndex() : void
    {
        $nCollection = [];

        $c = 0;
        foreach ($this->collection as $val) {
            $nCollection[(string)$c] = $val;
            $c++;
        }

        $this->collection = $nCollection;
    }
1372273
public function actionFillIndex()
    {
        try {
            $this->client->ping();
        } catch (NoNodesAvailableException $e) {
            $this->stderr($e->getMessage() . ', maybe you first need to configure and run elasticsearch' . PHP_EOL);
            return;
        }
        /** @var HasProperties | PropertiesTrait $model */
        foreach ($this->applicables as $indexName => $model) {
            if (true === $this->client->indices()->exists(['index' => $indexName])) {
                $this->client->indices()->delete(['index' => $indexName]);
            }
            $config = self::prepareIndexConfig();
            $config['index'] = $indexName;
            $response = $this->client->indices()->create($config);
            if (true === isset($response['acknowledged']) && $response['acknowledged'] == 1) {
                foreach (self::$storage as $className => $id) {
                    $indexData = self::prepareIndexData($model, $indexName, $className, $id);
                    if (false === empty($indexData['body'])) {
                        $this->client->bulk($indexData);
                    }
                }
            }
        }
    }