   commands.push(m)
 client.indices.delete {index:"movies"}, (err, res)->
   console.log(err, res)
-  client.indices.create {index:"movies"}, (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)->



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



  def

# console.log processedMovies

settings = {
  "analysis": {
    "char_filter": {
       "replace": {
        "type": "mapping",
        "mappings": [
          "&=> and "
        ]
      }
    },
    "filter": {
      "word_delimiter" : {
        "type" : "word_delimiter",
        "split_on_numerics" : false,
        "split_on_case_change" : true,
        "generate_word_parts" : true,
        "generate_number_parts" : true,
        "catenate_all" : true,
        "preserve_original":true,
        "catenate_numbers":true
      }
    },
    "analyzer": {
      "default": {
        "type": "custom",
        "char_filter": [
          "html_strip",
          "replace"
        ],
        "tokenizer": "whitespace",
        "filter": [
            "lowercase",
            "word_delimiter"
        ]
      }
    }
  }
}

mapping = {
  index:"movies"
  type:"movie"
