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

[views] don't repeat search =, use changed methods

parent aea1ea565d4e
No related branches found
No related tags found
No related merge requests found
......@@ -49,13 +49,14 @@
else:
es = Elasticsearch()
search = Search(using=es, index=index_name,
doc_type=indexable_types(self._cw.vreg.schema))
search = search.query('multi_match',
query=query_string,
fields=("title^3", "name^3", "content^2", "_all",))
search = search.highlight('content')
search = search.highlight_options(pre_tags="", post_tags="", fragment_size=150)
doc_type=indexable_types(self._cw.vreg.schema)) \
.query('multi_match', # noqa
query=query_string,
fields=("title^3", "name^3", "content^2", "_all",)) \
.highlight('content') \
.highlight_options(pre_tags="",
post_tags="",
fragment_size=150)
try:
response = search.execute()
except NotFoundError:
......
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