From bd42d6a1fcb6c8e6d89413e0ee22617625d95bad Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Wed, 29 Jul 2020 09:03:56 +0100 Subject: Add database index for full text search. --- perllib/FixMyStreet/DB/ResultSet/Comment.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'perllib/FixMyStreet/DB/ResultSet/Comment.pm') diff --git a/perllib/FixMyStreet/DB/ResultSet/Comment.pm b/perllib/FixMyStreet/DB/ResultSet/Comment.pm index 034b86a40..0a4403e52 100644 --- a/perllib/FixMyStreet/DB/ResultSet/Comment.pm +++ b/perllib/FixMyStreet/DB/ResultSet/Comment.pm @@ -4,12 +4,17 @@ use base 'DBIx::Class::ResultSet'; use strict; use warnings; +use Moo; +with 'FixMyStreet::Roles::FullTextSearch'; +__PACKAGE__->load_components('Helper::ResultSet::Me'); +sub text_search_columns { qw(id problem_id name text) } +sub text_search_nulls { qw(name) } + sub to_body { my ($rs, $bodies) = @_; return FixMyStreet::DB::ResultSet::Problem::to_body($rs, $bodies, 1); } - sub timeline { my ( $rs ) = @_; -- cgit v1.2.3 From 7af4f2cc87cd6ff55501bb2856193a03fe72158c Mon Sep 17 00:00:00 2001 From: M Somerville Date: Wed, 5 Aug 2020 15:56:10 +0100 Subject: Add database index for user full text search. --- perllib/FixMyStreet/DB/ResultSet/Comment.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'perllib/FixMyStreet/DB/ResultSet/Comment.pm') diff --git a/perllib/FixMyStreet/DB/ResultSet/Comment.pm b/perllib/FixMyStreet/DB/ResultSet/Comment.pm index 0a4403e52..ea38b3e14 100644 --- a/perllib/FixMyStreet/DB/ResultSet/Comment.pm +++ b/perllib/FixMyStreet/DB/ResultSet/Comment.pm @@ -9,6 +9,7 @@ with 'FixMyStreet::Roles::FullTextSearch'; __PACKAGE__->load_components('Helper::ResultSet::Me'); sub text_search_columns { qw(id problem_id name text) } sub text_search_nulls { qw(name) } +sub text_search_translate { '/.' } sub to_body { my ($rs, $bodies) = @_; -- cgit v1.2.3