diff --git a/pisi/search/invertedindex.py b/pisi/search/invertedindex.py index ea42c952..4f8d4657 100644 --- a/pisi/search/invertedindex.py +++ b/pisi/search/invertedindex.py @@ -39,7 +39,10 @@ class InvertedIndex(object): def query(self, terms, txn = None): def proc(txn): docs = [ self.get_term(x, txn) for x in terms ] - return reduce(lambda x,y: x.intersection(y), docs) + if docs: + return reduce(lambda x,y: x.intersection(y), docs) + else: + return set() return self.d.txn_proc(proc, txn) def list_terms(self, txn= None):