[rt-users] Help! I enabled Full Text search and now Simple search won't look at Subjects !!

ktm at rice.edu ktm at rice.edu
Wed Oct 7 17:23:02 EDT 2015


On Wed, Oct 07, 2015 at 02:51:16PM -0400, Al Joslin wrote:
> I am running 4.2.11
> 
> I have install mariadb 10.0 
> 
> I have enabled native mySQL full text search
> 
> It works fine - EXCEPT: it seems that I can have Full Text -or- Subject from the Simple Search box, but not both?
> 
> If I disable the full text from the RT_Site_config then the simple search box searches subjects but not attachments
> 
> If I enable the full text from the RT_Site_config then the simple search box searches attachments but not subjects
> 
> I don’t know how to proceed, this is not going to go over well…
> 
> I also have a custom field my users insisted on that will carry text — can I index and search more than one table (attachments) ?
> 
> thanks
> al;
> 

Hi Al,

It looks like you should be able to change the following function in
lib/RT/Search/Simple.pm:

# $_[0] is $self
# $_[1] is escaped value without surrounding single quotes
# $_[2] is a boolean of "was quoted by the user?"
#       ensure this is false before you do smart matching like $_[1] eq "me"
# $_[3] is escaped subkey, if any (see HandleCf)
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]'";
    }
}

to something like the following (untested):

sub HandleDefault   {
    my $fts = RT->Config->Get('FullTextSearch');
    if ($fts->{Enable} and $fts->{Indexed}) {
        return default => "Subject LIKE '$_[1]' OR Content LIKE '$_[1]'";
    } else {
        return default => "Subject LIKE '$_[1]'";
    }
}

Regards,
Ken



More information about the rt-users mailing list