This commit is contained in:
Sanj 2011-08-31 16:18:53 +05:30
commit 9dbd383ff4

View File

@ -37,7 +37,7 @@ class FeatureSearchManager(models.GeoManager):
# use the pg_trgm index
qset = qset.extra(select={"similarity":"similarity(preferred_name, %s)"},
select_params=[text],
where=["preferred_name %% '%s'"],
where=["preferred_name %% %s"],
params=[text],
order_by=["-similarity"])
if adm1: qset = qset.filter(admin1__exact=adm1)