From 8182deb97f785c26fe10b7ff4425b182e6eb38a1 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Thu, 28 Apr 2011 18:50:34 +0100 Subject: [PATCH] Correctly parenthesize searches that are used to make search restrictions. --- src/calibre/library/caches.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/library/caches.py b/src/calibre/library/caches.py index 543c6eab96..98fd3a9fbc 100644 --- a/src/calibre/library/caches.py +++ b/src/calibre/library/caches.py @@ -783,7 +783,7 @@ class ResultCache(SearchQueryParser): # {{{ else: q = query if search_restriction: - q = u'%s (%s)' % (search_restriction, query) + q = u'(%s) and (%s)' % (search_restriction, query) if not q: if set_restriction_count: self.search_restriction_book_count = len(self._map)