--- a/src/pyams_content_es/component/view.py Thu Jun 28 09:26:40 2018 +0200
+++ b/src/pyams_content_es/component/view.py Sun Jul 01 08:55:45 2018 +0200
@@ -61,16 +61,15 @@
params &= new_params
return params
- def get_results(self, context, limit=None):
- view = self.context
+ def get_results(self, context, sort_index, reverse, limit):
request = check_request()
registry = request.registry
client = get_client(request)
params = self.get_es_params(context)
search = Search(using=client.es, index=client.index) \
.query(params) \
- .sort('{0}workflow.{1}'.format('-' if view.reversed_order else '',
- view.order_by)) \
+ .sort('{0}workflow.{1}'.format('-' if reverse else '',
+ sort_index)) \
.source(['internal_id'])
if limit:
search = search[:limit]