From 129800847138e802040d4ad53adc06b9776ac1c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Pio?= Date: Wed, 17 Dec 2014 17:18:54 -0200 Subject: Fix issue #200 search works with base63 bodies Now the search works with the decoded body too, instead of only with the raw mail --- service/pixelated/adapter/search.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'service/pixelated') diff --git a/service/pixelated/adapter/search.py b/service/pixelated/adapter/search.py index d1e43735..3d71bab7 100644 --- a/service/pixelated/adapter/search.py +++ b/service/pixelated/adapter/search.py @@ -22,6 +22,7 @@ from pixelated.support.functional import flatten from whoosh.index import FileIndex from whoosh.fields import * from whoosh.qparser import QueryParser +from whoosh.qparser import MultifieldParser from whoosh.query import Term from whoosh import sorting from pixelated.support.functional import unique @@ -175,7 +176,7 @@ class SearchEngine(object): .replace('-in:', 'AND NOT tag:') .replace('in:all', '*') ) - return QueryParser('raw', self._index.schema).parse(query) + return MultifieldParser(['raw', 'body'], self._index.schema).parse(query) def remove_from_index(self, mail_id): writer = self._index.writer() -- cgit v1.2.3