[views] use q=term by default instead of search (closes #17049619)

authorArthur Lutz <arthur.lutz@logilab.fr>
changeset9fd50d807896
branchdefault
phasepublic
hiddenno
parent revision#cf0931e576e2 [views] debug-es also displays elastic search response
child revision#d93ffcdabd6e [facet] add extra_kwargs instance property on CWFacetedSearch
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 9fd50d80789695f743c46040c37db8f247dd75a1
# Parent cf0931e576e2d4868efb1e72294b683d06bb4718
[views] use q=term by default instead of search (closes #17049619)

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))