How to sort a resultset by date (unixtime)?
search post {
document post {
field created type long {
indexing: summary | attribute
}
field description type string {
indexing: summary | index
}
}
rank-profile date inherits default {
first-phase {
expression: attribute(created)
}
}
}
curl:
curl -s -H "Content-Type: application/json" --data
'{"yql" : "select * from post where description contains \"computer\";","ranking":"date"}'
http://localhost:8080/search/ | jq .
The resultset is not sorted by 'created'. And 'relevance' is always zero:
{
"id": "id:post:post::1",
"relevance": 0,
"source": "content",
"fields": {...}
}