Fix isbn:false not matching if other identifiers are attached to the book.

This commit is contained in:
Kovid Goyal 2012-08-04 19:33:39 +05:30
commit e3a4850308

View File

@ -568,6 +568,7 @@ class ResultCache(SearchQueryParser): # {{{
matches.add(id_) matches.add(id_)
continue continue
add_if_nothing_matches = valq == 'false'
pairs = [p.strip() for p in item[loc].split(split_char)] pairs = [p.strip() for p in item[loc].split(split_char)]
for pair in pairs: for pair in pairs:
parts = pair.split(':') parts = pair.split(':')
@ -583,10 +584,14 @@ class ResultCache(SearchQueryParser): # {{{
continue continue
elif valq == 'false': elif valq == 'false':
if v: if v:
add_if_nothing_matches = False
continue continue
elif not _match(valq, v, valq_mkind): elif not _match(valq, v, valq_mkind):
continue continue
matches.add(id_) matches.add(id_)
if add_if_nothing_matches:
matches.add(id_)
return matches return matches
def _matchkind(self, query): def _matchkind(self, query):