Skip to content

Instantly share code, notes, and snippets.

@dakrone
Created October 30, 2013 21:12
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 dakrone/7240353 to your computer and use it in GitHub Desktop.
Save dakrone/7240353 to your computer and use it in GitHub Desktop.
#!/usr/bin/env zsh
curl -XDELETE 'localhost:9200/mal'
echo
curl -XPOST 'localhost:9200/mal' -d'{
"mappings": {
"doc": {
"properties": {
"num": {"type": "integer", "ignore_malformed": true}
}
}
}
}'
echo
curl -XPOST 'localhost:9200/mal/doc/1' -d'{"num": 5}'
echo
curl -XPOST 'localhost:9200/mal/doc/2' -d'{"num": "aoe89a"}'
echo
curl -XPOST 'localhost:9200/mal/_refresh'
echo
curl -XPOST 'localhost:9200/mal/_search?q=*:*&pretty'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment