def index_exists(index, hosts=None, profile=None):
 es = _get_instance(hosts, profile)
 try:
  if (not isinstance(index, list)):
   index = [index]
  if es.indices.exists(index=index):
   return True
  else:
   return False
 except elasticsearch.exceptions.NotFoundError:
  return None
 except elasticsearch.exceptions.ConnectionError:
  return None
 return None

def index_exists ( index , hosts = None , profile = None ) : es = _get_instance ( hosts , profile ) try : if ( not isinstance ( index , list ) ) : index = [ index ] if es . indices . exists ( index = index ) : return True else : return False except elasticsearch . exceptions . NotFoundError : return None except elasticsearch . exceptions . ConnectionError : return None return None
return a boolean indicating whether given index exists cli example:: salt myminion elasticsearch .