From 658720f83806e8da9ce2f03ce1d983719172f8a8 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Mon, 25 Jul 2016 11:00:44 -0400
Subject: [PATCH] Improved fuzzy searching for PostgreSQL.

---
 module/VuFind/src/VuFind/Db/Table/Tags.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/module/VuFind/src/VuFind/Db/Table/Tags.php b/module/VuFind/src/VuFind/Db/Table/Tags.php
index bf8fe2361c9..39237e5fe7a 100644
--- a/module/VuFind/src/VuFind/Db/Table/Tags.php
+++ b/module/VuFind/src/VuFind/Db/Table/Tags.php
@@ -104,7 +104,7 @@ class Tags extends Gateway
                     new Expression(
                         'DISTINCT(?)', ['resource.id'],
                         [Expression::TYPE_IDENTIFIER]
-                    ), 'id'
+                    ),
                 ]
             );
             $select->join(
@@ -117,7 +117,7 @@ class Tags extends Gateway
                 'rt.resource_id = resource.id',
                 '*'
             );
-            $select->where->like('tags.tag', $query);
+            $select->where->literal('lower(tags.tag) like lower(?)', [$query]);
 
             if (!empty($source)) {
                 $select->where->equalTo('source', $source);
-- 
GitLab