Checks if an index exists

@param string $index

@return bool
@author Daniel Wendlandt
540885
public function exists($index)
    {
        $request = $this->createRequestInstance(self::INDEX_EXIST, $index, null);

        try {
            $this->client->send($request);
        } catch (ClientException $exception) {
            return false;
        }

        return true;
    }
572046
public function hasIndex($index, $collection)
    {
        if (empty($this->queriesResultCache[ 'collectionIndexes' ][ $collection ])) {
            $this->getIndexes($collection);
        }

        return (bool)in_array($index, $this->queriesResultCache[ 'collectionIndexes' ][ $collection ]);
    }
1045872
def index_exists(index, hosts=None, profile=None):
    '''
    
    '''
    es = _get_instance(hosts, profile)

    try:
        return es.indices.exists(index=index)
    except elasticsearch.exceptions.NotFoundError:
        return False
    except elasticsearch.TransportError as e:
        raise CommandExecutionError("Cannot retrieve index {0}, server returned code {1} with message {2}".format(index, e.status_code, e.error))
1079425
public function indexAt($index)
    {
        return ($index >= 0 && $index <= $this->count() - 1) ? $this->blockManagers[$index] : null;
    }
228641
def HasIndex(self, index):
        
        for i in self.Items:
            if i.index == index:
                return True
        return False
564673
def index_exists(self, table: str, indexname: str) -> bool:
        """"""
        # MySQL:
        sql = ("SELECT COUNT(*) FROM information_schema.statistics"
               " WHERE table_name=? AND index_name=?")
        row = self.fetchone(sql, table, indexname)
        return True if row[0] >= 1 else False
980929
public function exists($offset): bool
    {
        $offsets = is_array($offset) ? $offset : func_get_args();

        foreach ($offsets as $key) {

            if (! $this->offsetExists($key)) {
                return false;
            }
        }

        return true;
    }
1092789
public function exists($index, $type, $id)
    {
        return $this->db->head([$index, $type, $id]);
    }
462507
public function offsetExists($offset)
    {
        if ($offset == $this->querySeparator) {
            return true;
        }

        if (isset($this->array[$offset])) {
            return true;
        }

        $nested = $this->nested();

        return isset($nested[$offset]);
    }
1002693
public function has($index = null)
	{
		try
		{
			if ($this->toArray())
			{
				if ($index === null)
				{
					return true;
				}

				return $this->hasProperty($index);
			}
		}
		catch (\Exception $exc)
		{

		}

		return false;
	}
741989
public boolean isExists(String index) {
        IndicesExistsRequestBuilder indicesExistsRequestBuilder =
                admin().indices().prepareExists(index);
        return JMElasticsearchUtil
                .logRequestQueryAndReturn("isExists",
                        indicesExistsRequestBuilder,
                        indicesExistsRequestBuilder.execute())
                .isExists();
    }
753369
public function isAfter($index)
	    {
	        if ($index instanceof Period) {
	            return $this->start >= $index->end;
	        }

	        return $this->start > self::validateDateTime($index);
	    }
850093
public function offsetExists($index)
    {
        if (!$exists = parent::offsetExists($index)) {
            if (isset($this->{$index})) {
                return true;
            }
        }
        return $exists;
    }
308760
public function isBetterThan(Index $index)
    {
        if ($this->hasSameColumnNames($index->getColumnNames()) && $this->isUnique() && !$index->isUnique()) {
            return true;
        }

        return false;
    }
242013
public function remove($index)
    {
        if (!isset($this->names[$index])) {
            return false;
        }
        $this->context->getMappings(); // force parsing
        unset($this->names[$index]);
        $this->names = array_values($this->names);
        $this->indexes = array_flip($this->names);
        $this->onRemove($index);
        return true;
    }
670085
public function isBefore($index)
	    {
	        if ($index instanceof Period) {
	            return $this->end <= $index->start;
	        }

	        return $this->end <= self::validateDateTime($index);
	    }
206288
protected function checkIndex(Index $index, IgnoredChange $ignoredChange)
    {
        // Not needed to be implemented yet
        if ($ignoredChange->getPropertyName() !== $index->getName()) {
            return false;
        }

        return false;
    }