From 179d0be933ddf52f9b20ba42a7a6f9593fcc80cc Mon Sep 17 00:00:00 2001 From: Pavel Puchkin Date: Mon, 28 May 2018 01:06:57 +0200 Subject: [PATCH] Make search case-insensitive by using ilike --- app/views/packages/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/packages/__init__.py b/app/views/packages/__init__.py index 6cb06d84..30b1f90c 100644 --- a/app/views/packages/__init__.py +++ b/app/views/packages/__init__.py @@ -51,7 +51,7 @@ def packages_page(): search = request.args.get("q") if search is not None: - query = query.filter(Package.title.contains(search)) + query = query.filter(Package.title.ilike('%' + search + '%')) if shouldReturnJson(): pkgs = [package.getAsDictionary(app.config["BASE_URL"]) \