Ahoy. When sorting on a string field in ascending order, is there a way to
move the documents with a null value for the sort-field to the end of the
results?
For example, with the setup below, we sort by ascending city, but Bob has
no city and is the first result. Can we cause Bob to be the last result?
curl -s -X DELETE localhost:9200/test
curl -X PUT 'localhost:9200/test?pretty=true'
curl -XPUT localhost:9200/test/people/1 -d '{
"name" : "Jane",
"city" : "Toronto"
}'
curl -XPUT localhost:9200/test/people/2 -d '{
"name": "Jack",
"city": "Ottawa"
}'
curl -XPUT localhost:9200/test/people/3 -d '{
"name": "Bob"
}'
curl 'localhost:9200/test/people/_search' -d '{ sort: [{"city": {"order":
"asc"} }] }'