Skip to content

Instantly share code, notes, and snippets.

@defp
Forked from jprante/filter-integer.sh
Last active August 29, 2015 14:06
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 defp/96b47e2017bdac5944bd to your computer and use it in GitHub Desktop.
Save defp/96b47e2017bdac5944bd to your computer and use it in GitHub Desktop.
curl -XDELETE 'localhost:9200/test'
curl -XPUT 'localhost:9200/test/doc/1' -d '
{
"sentence" : "Hi!",
"value" : 1
}
'
curl -XPUT 'localhost:9200/test/doc/2' -d '
{
"sentence" : "Hi!",
"value" : 2
}
'
curl 'localhost:9200/test/_refresh'
curl -XPOST 'localhost:9200/test/_search' -d '
{
"query" : {
"filtered" : {
"query" : { "text" : { "sentence" : "Hi!" } },
"filter" : { "term" : { "value" : 1 } }
}
}
}
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment