# HG changeset patch
# User Arthur Lutz <arthur.lutz@logilab.fr>
# Date 1472660364 -7200
#      Wed Aug 31 18:19:24 2016 +0200
# Node ID 4cf521aa4ac244d6ab84877266625542d524146d
# Parent  1704583892a85ff88599eb97e9a19f24125c2f8c
[views] debug-es shows the request to copy in other tools

diff --git a/views.py b/views.py
--- a/views.py
+++ b/views.py
@@ -107,9 +107,10 @@
                                        start, stop,
                                        parents_for=parents_for,
                                        children_for=children_for)
-        # force search to be executed on our index, otherwise FacetSearch
-        # uses '_all'
-        search.index = self._cw.vreg.config['index-name']
+        if 'debug-es' in self._cw.form:
+            import json
+            self.w(unicode(json.dumps(search._s.to_dict())))
+            self.w(u'<br/>')
         try:
             response = search.execute()
         except NotFoundError: