Skip to content

Instantly share code, notes, and snippets.

@Vineeth-Mohan
Created March 18, 2012 05:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vineeth-Mohan/2069044 to your computer and use it in GitHub Desktop.
Save Vineeth-Mohan/2069044 to your computer and use it in GitHub Desktop.
vineeth@vineeth-XPS-L501X:~/elasticSearch$ cat r.sh
#!/bin/bash
curl -X DELETE "localhost:9200/algotree"
echo
curl -X PUT "localhost:9200/algotree" -d '{ "settings" : { "index" : { "number_of_shards" : 2, "number_of_replicas" : 1 }}}'
echo
curl -X PUT "localhost:9200/algotree/public/_mapping" -d '{
"public" :{
"_all" : {"enabled" : true},
"properties" :{
"id" : { "type" : "string" },
"names" : { "properties" : {
"name": {
"type" : "string" ,
"include_in_all" : true
}
}
}
}
}
}'
curl -X POST "localhost:9200/algotree/public" -d '{ "names" : [ { "name" : "then the dinos came"},{"name" : "then something bad happenend with dinos" }] }'
echo
curl -X POST "localhost:9200/algotree/public" -d '{ "names" : [ { "name" : "first there was god"},{"name" : "then there came th eworld"}] }'
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment