 	hello: 'elasticsearch!'
 .then(
 	(body) ->
-		createIndex 'events'
-		createIndex 'groups'
+		_createIndex 'events'
+#		_createIndex 'groups'
 	(error) ->
 		console.error 'Elasticsearch cluster is down'
 		throw new Error 'Elastic search cluster is down')
 
-
-# Normalize url by removing http, www, and trailing slash
-normalizeUrl = (url) ->
-	return url
-  
 
 # Add events to ElasticSearch event index
 # @param [object] query

	log: 'trace'
	apiVersion: '1.5'

createIndex = (name) ->
	client.indices.exists
		'index': name
	.then(

			if not exists
				client.indices.create
					'index': name
					'_id':
						'path': 'id'
				.then(
					(body) ->
						console.log "Created #{name} index successfully"
					(error) ->
						console.error 'Failed to create event index')
			else

				console.log "Index already exists"
	
		(error) ->
			console.error error)



# Make sure elastic search is running
client.ping
