Add override for search to remove subject
authorMarcus Ramberg <marcus.ramberg@usit.uio.no>
Thu, 20 Nov 2014 11:39:02 +0000 (12:39 +0100)
committerMarcus Ramberg <marcus.ramberg@usit.uio.no>
Thu, 20 Nov 2014 11:39:02 +0000 (12:39 +0100)
local/lib/RT/Search/Simple_Local.pm [new file with mode: 0644]

diff --git a/local/lib/RT/Search/Simple_Local.pm b/local/lib/RT/Search/Simple_Local.pm
new file mode 100644 (file)
index 0000000..0a65410
--- /dev/null
@@ -0,0 +1,14 @@
+# Remove subject from freetext search since we coallece it.
+no warnings qw/redefine/;
+package RT::Search::Simple;
+
+sub HandleDefault   {
+    my $fts = RT->Config->Get('FullTextSearch');
+    if ($fts->{Enable} and $fts->{Indexed}) {
+        return default => "Content LIKE '$_[1]'";
+    } else {
+        return default => "Subject LIKE '$_[1]'";
+    }
+}
+
+1;