From 54752ce05b2c7784ff22c6161f9ecc33d4b1149f Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Tue, 29 Jan 2013 10:42:16 -0700 Subject: [PATCH] Added mapping to load.sh --- scripts/load.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/load.sh b/scripts/load.sh index 87d014f1f6e..69c51a2a904 100755 --- a/scripts/load.sh +++ b/scripts/load.sh @@ -1,6 +1,25 @@ #!/usr/bin/env bash echo "Generating bulk indexable shakespeare lines with timestamp 3 hours in the past and 5 hours into the future" node reader.js > indexme.json +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" }, + "country" : {"type": "string", "index" : "not_analyzed" } + } + } + } +} +' +echo echo "Performing bulk indexing into localhost:9200" curl -XPUT localhost:9200/_bulk --data-binary @indexme.json;echo echo