Returns ``True`` if the index already exists in elasticsearch.

        Any additional keyword arguments will be passed to
        ``Elasticsearch.indices.exists`` unchanged.
16775
def exists(self, using=None, **kwargs):
        
        return self._get_connection(using).indices.exists(index=self._name, **kwargs)
158790
def existing_analysis(using):
    
    es = connections.get_connection(using)
    index_name = settings.ELASTICSEARCH_CONNECTIONS[using]['index_name']
    if es.indices.exists(index=index_name):
        return stringer(es.indices.get_settings(index=index_name)[index_name]['settings']['index'].get('analysis', {}))
    return DOES_NOT_EXIST
39083
public synchronized boolean has(int index, Scriptable start) {
        Integer key = new Integer(index);
        return indexedProps.containsKey(key);
    }
33397
def exists(self, doc_id, rev_id=''):
        
        '''
            
        '''

        title = '%s.exists' % self.__class__.__name__

    # validate inputs
        input_fields = {
            'doc_id': doc_id,
            'rev_id': rev_id
        }
        for key, value in input_fields.items():
            if value:
                object_title = '%s(%s=%s)' % (title, key, str(value))
                self.fields.validate(value, '.%s' % key, object_title)
    
    # send request and construct response
        url = self.bucket_url + '/%s' % doc_id
        params = None
        if rev_id:
            params = { 'rev': rev_id }
        response = requests.get(url, params=params)
        if not 'error' in response.json():
            return True
        return False
283372
def index_exists(engine: Engine, tablename: str, indexname: str) -> bool:
    
    insp = Inspector.from_engine(engine)
    return any(i['name'] == indexname for i in insp.get_indexes(tablename))
449382
def _match_exists(self, searchable):
        
        position_searchable = self.get_position_searchable()
        for pos,val in position_searchable.iteritems():
            if val == searchable:
                return pos
        return False
1099847
def exists(self, session_key):
        

        response = self.table.get_item(
            Key={'session_key': session_key},
            ConsistentRead=ALWAYS_CONSISTENT)
        if 'Item' in response:
            return True
        else:
            return False
702949
def ensure_index(self, key, unique=False):
        
        return self.collection.ensure_index(key, unique=unique)
888662
def exists_dimension(dimension_name,**kwargs):
    
    try:
        dimension = db.DBSession.query(Dimension).filter(Dimension.name==dimension_name).one()
        # At this point the dimension exists
        return True
    except NoResultFound:
        # The dimension does not exist
        raise False
987299
public boolean aliasExists(String alias) {
        try {
            final JestResult result = jestClient.execute(new GetSettings.Builder().addIndex(alias).build());
            return result.isSucceeded() && !Iterators.contains(result.getJsonObject().fieldNames(), alias);
        } catch (IOException e) {
            throw new ElasticsearchException("Couldn't check existence of alias " + alias, e);
        }
    }
1194998
@When("^I create an elasticsearch index named '(.+?)'( removing existing index if exist)?$")
    public void createElasticsearchIndex(String index, String removeIndex) {
        if (removeIndex != null && commonspec.getElasticSearchClient().indexExists(index)) {
            commonspec.getElasticSearchClient().dropSingleIndex(index);
        }
        commonspec.getElasticSearchClient().createSingleIndex(index);
    }
60271
def exists(self, callback=None):
        
        def existence_tested(response):
            if callable(callback):
                callback(bool(response))
        self.bucket.lookup(self.name, callback=existence_tested)
266153
function hasIndexChanged(index, prevIndex) {
  if (typeof index !== 'string' || !index) return false;
  if (typeof prevIndex !== 'string' || !prevIndex) return true;
  return index !== prevIndex;
}
65778
def id_exists(api, search_id):
    
    response = utils.checked_api_call(api, 'get_specific', id=search_id)
    return response is not None
365621
public function exists()
    {
        $indexValue = $this->getFieldValue($this->getIndex());
        if ($indexValue) {
            return $this->get($indexValue)->count() > 0;
        }
        return false;
    }
721081
def ensure_index(self, index, mappings=None, settings=None, clear=False):
        
        mappings = mappings or []
        if isinstance(mappings, dict):
            mappings = [mappings]
        exists = self.indices.exists_index(index)
        if exists and not mappings and not clear:
            return
        if exists and clear:
            self.indices.delete_index(index)
            exists = False

        if exists:
            if not mappings:
                self.indices.delete_index(index)
                self.indices.refresh()
                self.indices.create_index(index, settings)
                return

            if clear:
                for maps in mappings:
                    for key in list(maps.keys()):
                        self.indices.delete_mapping(index, doc_type=key)
                self.indices.refresh()
            if isinstance(mappings, SettingsBuilder):
                for name, data in list(mappings.mappings.items()):
                    self.indices.put_mapping(doc_type=name, mapping=data, indices=index)

            else:
                from pyes.mappings import DocumentObjectField, ObjectField

                for maps in mappings:
                    if isinstance(maps, tuple):
                        name, mapping = maps
                        self.indices.put_mapping(doc_type=name, mapping=mapping, indices=index)
                    elif isinstance(maps, dict):
                        for name, data in list(maps.items()):
                            self.indices.put_mapping(doc_type=name, mapping=maps, indices=index)
                    elif isinstance(maps, (DocumentObjectField, ObjectField)):
                        self.put_mapping(doc_type=maps.name, mapping=maps.as_dict(), indices=index)

                return

        if settings:
            if isinstance(settings, dict):
                settings = SettingsBuilder(settings, mappings)
        else:
            if isinstance(mappings, SettingsBuilder):
                settings = mappings
            else:
                settings = SettingsBuilder(mappings=mappings)
        if not exists:
            self.indices.create_index(index, settings)
            self.indices.refresh(index, timesleep=1)
365573
def get_index_by_alias(self, alias):
        
        try:
            info = self.es.indices.get_alias(name=alias)
            return next(iter(info.keys()))
        except elasticsearch.exceptions.NotFoundError:
            return alias