[views] use q=term by default instead of search

authorArthur Lutz <arthur.lutz@logilab.fr>
changesetf91fb384423a
branchdefault
phasedraft
hiddenyes
parent revision#907c8a48b21b [views] debug-es also displays elastic search response
child revision<not specified>
files modified by this revision
views.py
# HG changeset patch
# User Arthur Lutz <arthur.lutz@logilab.fr>
# Date 1485337088 -3600
# Wed Jan 25 10:38:08 2017 +0100
# Node ID f91fb384423a1168b0c1e606baf9277ac8067435
# Parent 907c8a48b21b58cf02416a2bd4aa2c6cdb3e9902
[views] use q=term by default instead of search

diff --git a/views.py b/views.py
@@ -133,11 +133,11 @@
1              return
2 
3      def call(self, **kwargs):
4          # TODO if no ES configuration, redirect or display warning
5          self.render_search_comp()
6 -        query_string = self._cw.form.get('search', '')
7 +        query_string = self._cw.form.get('q', self._cw.form.get('search', ''))
8          self.w(u'<h1>%s</h1>' % self._cw._('Recherche'))
9          response = self.do_search(query_string)
10          if response.hits.total:
11              self.w(u'<h2>Resultats pour : <em>%s</em></h2>' %
12                     xml_escape(query_string))