From 2c40030ed7a4195c7e44536f27af91eefc182229 Mon Sep 17 00:00:00 2001 From: Alex Legler Date: Sun, 13 Dec 2015 13:49:53 +0100 Subject: Sort message replies by date --- lib/index.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/index.rb b/lib/index.rb index 3e88a43..6aee1e2 100644 --- a/lib/index.rb +++ b/lib/index.rb @@ -140,7 +140,10 @@ def get_child_data(list, parent_id) children = $es.search( index: 'ml-' + list, size: 100, - body: { query: { match: { parent: parent_id } } } + body: { + query: { match: { parent: parent_id } }, + sort: { date: 'asc' } + } ) if children['hits']['total'] == 0 -- cgit v1.2.3-65-gdbad