Skip to content

Instantly share code, notes, and snippets.

@sebbacon
Created February 10, 2015 14:25
Show Gist options
  • Save sebbacon/1d131d4bb764954757f2 to your computer and use it in GitHub Desktop.
Save sebbacon/1d131d4bb764954757f2 to your computer and use it in GitHub Desktop.
set -e
curl -XDELETE http://localhost:9200/data/test
curl -XPUT http://localhost:9200/data/_mapping/test -d '
{
"test" : {
"properties" : {
"License Status" : {"type": "string", "index" : "not_analyzed" },
"License Type" : {"type": "string", "index" : "not_analyzed" },
"License Expiration Date" : { "type" : "date", "format": "mm/dd/YYYY" }
}
}
}
'
curl -XPOST 'http://127.0.0.1:9200/_bulk' --data-binary @bulk.out
open("scraper.out", "r") do |f|
f.each_line do |line|
puts '{"index" : {"_index": "data", "_type": "test"}}'
puts line
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment