Both 'subject' and 'body' of an email ticket searchable via RT's web interface?

Hello all,

I usedthe default sphinx.conf generatedwhere the ‘sql_query’ to fetch
data for indexing:

/*sql_query = \ SELECT a.id, a.content FROM Attachments a
JOIN Transactions txn ON a.TransactionId = txn.id AND txn.ObjectType =
‘RT::Ticket’
JOIN Tickets t ON txn.ObjectId = t.id \ WHERE a.ContentType =
‘text/plain’ AND t.Status != ‘deleted’

sql_query_info = SELECT * FROM Attachments WHERE id=$id

*/Question:

I’d like to fulltext search for patterns/words both in the ‘subject’ and
'body’of an email ticket
from the RT’s web interface ‘Search’ box.Is it possible with the above
configs of sql_query*?If
not please let me know what more should Ineed to add?

Thanks,

I’d like to fulltext search for patterns/words both in the ‘subject’ and 'body’of an email ticket
from the RT’s web interface ‘Search’ box. Is it possible with the above configs of sql_query*? If
not please let me know what more should I need to add?

Most of the time true full-text indexing isn’t needed for the Subject
since it’s a normally indexed string with a max length. I’d suggest
first approaching this by extending RT::Search::Googleish with an
overlay that instead of defaulting unknown and quoted words to Subject
searches, defaults them to Subject OR Content searches. This will do
what you mean, and should be fairly simple. I know we’ve done it for
support clients. RT::Search::Googleish was written to be extensible
with minimal effort.

Thomas

I'd like to fulltext search for patterns/words both in the 'subject' and 'body'of an email ticket
from the RT's web interface 'Search' box. Is it possible with the above configs of sql_query*? If
not please let me know what more should I need to add?

Most of the time true full-text indexing isn’t needed for the Subject
since it’s a normally indexed string with a max length. I’d suggest
first approaching this by extending RT::Search::Googleish with an
overlay that instead of defaulting unknown and quoted words to Subject
searches, defaults them to Subject OR Content searches. This will do
what you mean, and should be fairly simple. I know we’ve done it for
support clients. RT::Search::Googleish was written to be extensible
with minimal effort.

Thomas


Help improve RT by taking our user survey: https://www.surveymonkey.com/s/N23JW9T
I just searched the documentation on how to do this. I’m not able to find
any other than a brief description about RT::Search::Googleish here:

http://bestpractical.com/rt/docs/4.0/RT/Search/Googleish.html

Thanks,

I just searched the documentation on how to do this. I’m not able to find
any other than a brief description about RT::Search::Googleish here:

RT::Search::Googleish - RT 4.0.25 Documentation - Best Practical

For this customization, you’ll need to grok the code. There are a few comments in there to help you get started, but unfortunately the clean way to customize simple search isn’t documented yet. Try starting with something like this in local/lib/RT/Search/Googleish_Local.pm

package RT::Search::Googleish;

use strict;
use warnings;
no warnings qw(redefine);

our @GUESS;

Changes the first guess from “subject” to “default” if quoted. For

@GUESS handlers, $_[1] is a boolean for quoted or not by the user.

$GUESS[0] = [ 10 => sub { return “default” if $_[1] } ];

@_ positional params are documented in the main Googleish.pm for

Handle* subs

sub HandleDefault { return content => “Subject like ‘$[1]’ OR Content like '$[1]’” }

1;