Skip to content

Instantly share code, notes, and snippets.

@harryf
Created December 30, 2010 17:31
Show Gist options
  • Save harryf/760026 to your computer and use it in GitHub Desktop.
Save harryf/760026 to your computer and use it in GitHub Desktop.
An elasticsearch mapping for techup events
#!/bin/sh
echo "Deleting index"
curl -XDELETE 'http://localhost:9200/techup/'
echo "\nCreating index"
curl -XPUT 'http://localhost:9200/techup/'
echo "\nApplying mapping"
curl -XPUT 'http://localhost:9200/techup/events/_mapping' -d '
{
"events" : {
"properties" : {
"title" : { "type" : "string", "boost" : 2.0 },
"summary" : { "type" : "string" },
"updated" : { type: "date", "format" : "EEE, dd MMM yyyy HH:mm:ss Z" },
"link" : { type: "string", "index" : "not_analyzed" }
}
}
}'
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment