Skip to content
Snippets Groups Projects
Commit 4c406b718a92 authored by Arthur Lutz's avatar Arthur Lutz
Browse files

[views] use compose_query from search_helpers

parent a0d74ef12c90
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
from cubicweb.view import StartupView from cubicweb.view import StartupView
from cubes.elasticsearch.es import indexable_types from cubes.elasticsearch.es import indexable_types
from cubes.elasticsearch.search_helpers import compose_search
def get_connection(config): def get_connection(config):
...@@ -58,6 +59,12 @@ ...@@ -58,6 +59,12 @@
self.doc_types = doc_types self.doc_types = doc_types
super(CWFacetedSearch, self).__init__(query, filters) 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): def highlight(self, search):
""" """
Add custom highlighting Add custom highlighting
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment