 
 
 client = new elasticsearch.Client({
-  # host:"localhost:9200"
-  host:args[0]
+  host:args[0] or "localhost:9200"
 })
 
 

  def

# console.log processedMovies
mapping = {
  index:"movies"
  type:"movie"

  commands.push(m)
client.indices.delete {index:"movies"}, (err, res)->
  console.log(err, res)
  client.indices.create {index:"movies", body:{settings:settings}}, (err, res)->
    console.log(err, res)

    client.indices.putMapping mapping, (err, res)->
      console.log(err, res)
      client.bulk {body:commands}, (err, res)->
