From 9e5404f3079ec2da1548b38fe2aa650816c3af40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Thu, 1 Dec 2011 13:06:46 +0100 Subject: [PATCH] fix text search in non db case --- tabellio/searchform/form.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tabellio/searchform/form.py b/tabellio/searchform/form.py index 8179c65..fb199b1 100644 --- a/tabellio/searchform/form.py +++ b/tabellio/searchform/form.py @@ -773,8 +773,12 @@ class SearchView(BrowserView): return [] if data.get('text'): - # plaintext search, get document ids from postgresql - kw['id'] = self.get_ids_from_postgres(data.get('text')) + portal = getToolByName(self.context, 'portal_url').getPortalObject() + if hasattr(portal, 'db'): + # plaintext search, get document ids from postgresql + kw['id'] = self.get_ids_from_postgres(data.get('text')) + else: + kw['SearchableText'] = data.get('text') if data.get('search_type_is_document'): kw['portal_type'] = 'tabellio.documents.document'