Handle index deletion command

@param Client $client
@param string $index

@throws IndexNotFoundException
359311
public function handle(Client $client, $index)
    {
        $index = $client->getIndex($index);

        if (!$index->exists()) {
            throw new IndexNotFoundException($index);
        }

        $index->delete();
    }
930672
@Deprecated
	public static boolean isIndexExist(Client client, String index) {
		return client.admin().indices().prepareExists(index).get().isExists();
	}
817735
private function deleteFieldAce($property, $index, $field)
    {
        $aces = &$this->$property;
        if (!isset($aces[$field][$index])) {
            throw new \OutOfBoundsException(sprintf('The index "%d" does not exist.', $index));
        }

        $oldValue = $this->$property;
        unset($aces[$field][$index]);
        $aces[$field] = array_values($aces[$field]);
        $this->onPropertyChanged($property, $oldValue, $this->$property);

        for ($i = $index, $c = count($aces[$field]); $i < $c; ++$i) {
            $this->onEntryPropertyChanged($aces[$field][$i], 'aceOrder', $i + 1, $i);
        }
    }
1204481
public function deleteMapping($index)
    {
        try {
            $elasticclient = $this->client->getClient();
            $map = ['index' => $index];
            $response = $elasticclient->indices()->delete($map);
            return $response['acknowledged'];
        } catch (\Exception $ex) {
            return $ex->getMessage();
        }
    }
831511
public function createIndex(Index $index, $table)
    {
        $this->_execSql($this->_platform->getCreateIndexSQL($index, $table));
    }
196833
public function deleteIndex(IndexUUID $indexUUID)
    {
        $this->load();
        parent::deleteIndex($indexUUID);
        $this->save();
    }
384704
public function deleteIndex(IndexUUID $indexUUID)
    {
        $response = $this
            ->httpClient
            ->get(
                sprintf(
                    '/%s/indices/%s',
                    $this->getAppUUID()->composeUUID(),
                    $indexUUID->composeUUID()
                ),
                'delete',
                [],
                [],
                Http::getApisearchHeaders($this)
            );

        self::throwTransportableExceptionIfNeeded($response);
    }
1184726
protected function clearIndex($index)
    {
        $index->clear(Page::class);
        $index->clear(User::class);
        $index->clear(File::class);
        $index->clear(Site::class);
    }
1074156
protected function dropIndex(&$property, Index $index)
    {
        $property .= sprintf("('%s')", $this->getPropertyBase('drop' . ucfirst($index->getType)), $index->name);

        return $this->addFieldPropertyClousure($property);
    }
613255
public function indexExists(IndexEvent $event)
    {
        $request = new Exists();
        $request->index($event->getIndexCode());

        /** @var \OpenSearchServer\Response\Response $response */
        $response = $this->getClient()->submit($request);

        if (true !== $response->isSuccess()) {
            throw new IndexNotFoundException(sprintf("The index '%s' doesn't exists with the current configuration", $event->getIndexCode()));
        }
    }
1216278
public function onIndex(IndexEvent $event)
    {
        try {
            $this->searchManager->index($event->getSubject());
        } catch (MetadataNotFoundException $ex) {
            // no metadata found => do nothing
        }
    }
1103276
public function removeNumber(int $index): void
    {
        unset($this->numbers[$index]);
        $this->numbers = array_values($this->numbers);
    }
1063871
@Subscribe
    public void handleIndexDeletion(final IndicesDeletedEvent event) {
        event.indices().forEach(indexName -> {
            LOG.debug("Removing field type information for deleted index <{}>", indexName);
            dbService.delete(indexName);
        });
    }
90155
def index_delete(self, index):
        '''
        
        '''
        request = self.session
        url = 'http://%s:%s/%s' % (self.host, self.port, index)
        response = request.delete(url)
        return response
1173398
public function deleteModuleEntry($element, $client=null)
	{
		if ($this->baseDb->tableExists('#__extensions'))
		{
			// Delete module entry
			$query = "DELETE FROM `#__extensions` WHERE `element` = '{$element}'" . ((isset($client)) ? " AND `client_id` = " . $this->baseDb->quote($client) : '');
			$this->baseDb->setQuery($query);
			$this->baseDb->query();

			$this->log(sprintf('Removed extension entry for module "%s"', $element));

			// See if entries are present in #__modules table as well
			$query = "SELECT `id` FROM `#__modules` WHERE `module` = '{$element}'" . ((isset($client)) ? " AND `client_id` = " . $this->baseDb->quote($client) : '');
			$this->baseDb->setQuery($query);
			$ids = $this->baseDb->loadColumn();

			if ($ids && count($ids) > 0)
			{
				// Delete modules and module menu entries
				$query = "DELETE FROM `#__modules` WHERE `id` IN (" . implode(',', $ids) . ")";
				$this->baseDb->setQuery($query);
				$this->baseDb->query();

				$query = "DELETE FROM `#__modules_menu` WHERE `moduleid` IN (" . implode(',', $ids) . ")";
				$this->baseDb->setQuery($query);
				$this->baseDb->query();

				$this->log(sprintf('Removed module/menu entries for module "%s"', $element));
			}

			return true;
		}
		else
		{
			$query = "SELECT `id` FROM `#__modules` WHERE `module` = '{$element}'" . ((isset($client)) ? " AND `client_id` = " . $this->baseDb->quote($client) : '');
			$this->baseDb->setQuery($query);
			$ids = $this->baseDb->loadColumn();

			if ($ids && count($ids) > 0)
			{
				// Delete modules and module menu entries
				$query = "DELETE FROM `#__modules` WHERE `id` IN (" . implode(',', $ids) . ")";
				$this->baseDb->setQuery($query);
				$this->baseDb->query();

				$query = "DELETE FROM `#__modules_menu` WHERE `moduleid` IN (" . implode(',', $ids) . ")";
				$this->baseDb->setQuery($query);
				$this->baseDb->query();

				$this->log(sprintf('Removed module/menu entries for module "%s"', $element));
			}

			return true;
		}

		return false;
	}
1342258
public static function delete($index = null, $default = null)
	{
		static::$put_patch_delete === null and static::hydrate();
		return (is_null($index) and func_num_args() === 0) ? static::$put_patch_delete : \Arr::get(static::$put_patch_delete, $index, $default);
	}
917753
public function handle(Client $client, $index, $type, $alias = null)
    {
        $alias = $alias ?: $index;

        $entries = $this->registry->get($alias, $type);

        $this->dispatchHandlingStartedEvent($entries);

        foreach ($entries as $entry) {
            $this->dispatchProvidingStartedEvent($entry);

            $entry->getProvider()->run(
                $client,
                $index,
                $entry->getType(),
                $this->dispatcher
            );

            $this->dispatchProvidingFinishedEvent($entry);
        }
    }