From 339b3891da16ff6ae66c048582d266d33b8a6a89 Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Mon, 25 Jan 2016 21:12:34 +0100 Subject: [PATCH] Fix Search on server side --- openslides/utils/search.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openslides/utils/search.py b/openslides/utils/search.py index 2226a01ef..12edd62e7 100644 --- a/openslides/utils/search.py +++ b/openslides/utils/search.py @@ -167,7 +167,8 @@ def search(query): The return value is a list of dictonaries where each dictonary has the keys id and collection. """ - parser = QueryParser("content", index.schema) + search_index = index.get_or_create_index() + parser = QueryParser("content", search_index.schema) query = parser.parse(query) - result = index.searcher().search(query, limit=None) + result = search_index.searcher().search(query, limit=None) return [dict(element) for element in result]