From: Eevee Date: Tue, 29 Jun 2010 04:58:08 +0000 (-0700) Subject: Fuzzy lookup results were not respecting type limits. X-Git-Tag: veekun-promotions/2010070701~4 X-Git-Url: http://git.veekun.com/zzz-pokedex.git/commitdiff_plain/5ed0ed3118bcd848f4d9533fc00baf3afbef4322 Fuzzy lookup results were not respecting type limits. --- diff --git a/pokedex/lookup.py b/pokedex/lookup.py index bab2a42..0b09823 100644 --- a/pokedex/lookup.py +++ b/pokedex/lookup.py @@ -449,6 +449,8 @@ class PokedexLookup(object): name, self.INTERMEDIATE_LOOKUP_RESULTS): query = whoosh.query.Term('name', suggestion) + if type_term: + query = query & type_term results.extend(searcher.search(query)) ### Convert results to db objects