Skip to content

Instantly share code, notes, and snippets.

@imotov
Created December 7, 2012 16:18
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save imotov/4234377 to your computer and use it in GitHub Desktop.
curl -XDELETE 'localhost:9200/test-idx'
curl -XPUT 'localhost:9200/test-idx' -d '{
"mappings": {
"doc": {
"properties": {
"foo" : {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}'
curl -XPUT 'localhost:9200/test-idx/doc/1' -d '{"foo": "QNMP-1900"}'
curl -XPUT 'localhost:9200/test-idx/doc/2' -d '{"foo": "QNMP-1901"}'
curl -XPUT 'localhost:9200/test-idx/doc/3' -d '{"foo": "QNMP-2100"}'
curl -XPUT 'localhost:9200/test-idx/doc/4' -d '{"foo": "QNMZ-1900"}'
curl -XPOST 'localhost:9200/test-idx/_refresh'
echo
curl 'localhost:9200/test-idx/doc/_search?pretty=true' -d '{
"query": {
"wildcard" : { "foo" : "QNMP-19*" }
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment