Skip to content

Instantly share code, notes, and snippets.

@jprante
Created November 24, 2012 22:13
Show Gist options
  • Save jprante/4141611 to your computer and use it in GitHub Desktop.
Save jprante/4141611 to your computer and use it in GitHub Desktop.
Sorting with undefined values
curl -XDELETE 'localhost:9200/sort'
curl -XPOST 'localhost:9200/sort'
curl -XPUT 'localhost:9200/sort/sort/1' -d '
{
"num" : 1
}
'
curl -XPUT 'localhost:9200/sort/sort/2' -d '
{
"num" : 2
}
'
curl -XPUT 'localhost:9200/sort/sort/3' -d '
{
"test" : "Hello World"
}
'
curl -XGET 'localhost:9200/_refresh'
curl -XPOST 'localhost:9200/sort/_search?pretty' -d '
{
"query": {
"match_all" : {}
},
"sort" : [
{ "num" : { "order" : "asc" } }
]
}'
curl -XPOST 'localhost:9200/sort/_search?pretty' -d '
{
"query": {
"match_all" : {}
},
"sort" : [
{ "num" : { "order" : "desc" } }
]
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment