diff --git a/views.py b/views.py index a0d74ef12c900fa5b2bbbbcbb8ba4066eb6c602d_dmlld3MucHk=..4c406b718a92546a3ba2cf2a93e0eb7704380978_dmlld3MucHk= 100644 --- a/views.py +++ b/views.py @@ -27,6 +27,7 @@ from cubicweb.view import StartupView from cubes.elasticsearch.es import indexable_types +from cubes.elasticsearch.search_helpers import compose_search def get_connection(config): @@ -58,6 +59,12 @@ self.doc_types = doc_types super(CWFacetedSearch, self).__init__(query, filters) + def query(self, search, query): + if query: + return compose_search(search, query=query, fields=self.fields) + #return search.query('multi_match', fields=self.fields, query=query) + return search + def highlight(self, search): """ Add custom highlighting