[icinga-checkins] icinga.org: icingaweb2-module-logstash/master: Try to add stable sorting

git at icinga.org git at icinga.org
Fri Feb 5 14:05:47 CET 2016


Module: icingaweb2-module-logstash
Branch: master
Commit: 2ca6175a810b8012b9f0e4cd26261658c4c50cf2
URL:    https://git.icinga.org/?p=icingaweb2-module-logstash.git;a=commit;h=2ca6175a810b8012b9f0e4cd26261658c4c50cf2

Author: Markus Frosch <markus at lazyfrosch.de>
Date:   Tue Jun 23 11:10:52 2015 +0200

Try to add stable sorting

---

 library/Logstash/Search.php |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/library/Logstash/Search.php b/library/Logstash/Search.php
index 39a07ba..72b07e3 100644
--- a/library/Logstash/Search.php
+++ b/library/Logstash/Search.php
@@ -53,9 +53,18 @@ class Search extends ElasticsearchBackend implements QueryInterface
 
         if ($this->sort_field) {
             $post['sort'] = array(
-                $this->sort_field => array(
-                    'order' => $this->sort_direction ? $this->sort_direction : 'desc'
+                array(
+                    $this->sort_field => array(
+                        'order' => $this->sort_direction ? $this->sort_direction : 'desc'
+                    )
+                ),
+                /* TODO: find way for stable sorting
+                array(
+                    '_id' => array(
+                        'order' => 'asc'
+                    )
                 )
+                */
             );
         }
 



More information about the icinga-checkins mailing list