2013-01-29 11:05:02 -06:00
|
|
|
#!/usr/bin/env bash
|
2013-03-08 11:04:38 -06:00
|
|
|
echo "Generating bulk indexable shakespeare lines with timestamp 6 hours in the past and 24ish hours into the future"
|
2013-01-29 11:05:02 -06:00
|
|
|
node reader.js > indexme.json
|
2013-01-29 11:42:16 -06:00
|
|
|
echo "Setting mapping for shakespeare index"
|
|
|
|
curl -XPUT http://localhost:9200/_template/shakespeare -d '
|
|
|
|
{
|
|
|
|
"template" : "shakespeare",
|
|
|
|
"mappings" : {
|
|
|
|
"_default_" : {
|
|
|
|
"properties" : {
|
|
|
|
"clientip" : { "type" : "ip" },
|
|
|
|
"speaker" : {"type": "string", "index" : "not_analyzed" },
|
|
|
|
"play_name" : {"type": "string", "index" : "not_analyzed" },
|
|
|
|
"line_id" : { "type" : "integer", "index": "not_analyzed" },
|
|
|
|
"speech_number" : { "type" : "integer", "index": "not_analyzed" },
|
2013-02-18 22:41:56 -06:00
|
|
|
"geo" : {
|
|
|
|
"properties": {
|
|
|
|
"state" : {"type": "string", "index" : "not_analyzed" },
|
|
|
|
"country" : {"type": "string", "index" : "not_analyzed" }
|
|
|
|
}
|
|
|
|
}
|
2013-01-29 11:42:16 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
'
|
|
|
|
echo
|
2013-01-29 11:05:02 -06:00
|
|
|
echo "Performing bulk indexing into localhost:9200"
|
|
|
|
curl -XPUT localhost:9200/_bulk --data-binary @indexme.json;echo
|
|
|
|
echo
|
|
|
|
echo "If tons of JSON just scrolled above, I've probably successfully loaded over 100,000 lines of shakespeare into localhost:9200/shakespeare"
|