* fix: return empty result if no valid terms given

This commit is contained in:
Eray Özkural
2005-12-13 08:42:47 +00:00
parent 606464ec98
commit aad2efc4ef
+4 -1
View File
@@ -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):