[PATCH elasticsearch] [sort] added sort kwarg

Carine Dengler carine.dengler at logilab.fr
Tue Feb 18 16:55:23 CET 2020


# HG changeset patch
# User Carine Dengler <carine.dengler at logilab.fr>
# Date 1582041242 -3600
#      Tue Feb 18 16:54:02 2020 +0100
# Node ID c96089898c6ab9d81d0427a2a3e5668049d5d0a5
# Parent  bcb22f63b5fa76efa438f8ba7a897cb439094018
# Available At http://hg.logilab.org/review/cubes/elasticsearch
#              hg pull http://hg.logilab.org/review/cubes/elasticsearch -r c96089898c6a
[sort] added sort kwarg

diff -r bcb22f63b5fa -r c96089898c6a cubicweb_elasticsearch/views.py
--- a/cubicweb_elasticsearch/views.py	Wed Dec 11 14:02:19 2019 +0100
+++ b/cubicweb_elasticsearch/views.py	Tue Feb 18 16:54:02 2020 +0100
@@ -44,6 +44,7 @@
 
     def __init__(self, query=None,
                  filters={},
+                 sort=(),
                  doc_types=None,
                  index=None,
                  form=None,
@@ -60,7 +61,7 @@
         # Count all the hits by default
         self.track_total_hits = track_total_hits
         self.extra_kwargs = kwargs
-        super(CWFacetedSearch, self).__init__(query, filters)
+        super(CWFacetedSearch, self).__init__(query, filters, sort=sort)
 
     def search(self):
         # override methods to add custom pieces




More information about the cubicweb-devel mailing list