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

Claes Merin claes at gastabud.com
Fri Aug 19 10:35:07 EDT 2016


We are using sphinx (since last night) for FTS searches.

Setup is as described in this excellent guide:

http://blog.christosoft.de/2016/07/rt4-request-tracker4-fulltext-search-sphinx-debian-jessie/

We also ran in to the problem described here, and I was thinking if one
could resolve it by including the subject in the sphinx database...

Modifying the query in the guide to simply include the t.Subject like
this...

## /etc/sphinxsearch/sphinx.conf
sql_query = \
  SELECT a.id id, t.Subject, 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 LIKE '%text%' AND t.Status != 'deleted'
##

The problem with this is, if there is a ticket that does not have an
attachment, it will not get indexed and is not searchable through FTS...

Maybe this solution could help someone, but also I'm interested if it
would be possible to use an "TicketsIndex" table or somehow extend the
"AttachmentsIndex" to include ticketId to index "tickets" rather than
"attachments"..?


Claes Merin
Gästabudstaden AB

On 2015-10-09 08:09, Alex Vandiver wrote:
> On Wed, Oct 07, 2015 at 04:23:02PM -0500, ktm at rice.edu wrote:
>> It looks like you should be able to change the following function in
>> lib/RT/Search/Simple.pm: [snip]
> 
> RT 4.2.10 made the change to only search the Content field, and not
> also the Subject field, intentionally; see the commit the did so [1]
> for the full rationale.
> 
> In short, it is impossible to have a performant full-text search if
> you search both Subject and Content.  In most RT installs, the
> auto-reply from the ticket creation includes the subject of the
> ticket, which means it is indexed along with the ticket, so removing
> the Subject clause still results in finding the appropriate ticket.
> 
> You're welcome to revert the change locally -- though I would suggest
> doing so via an overlay and not by editing the file directly, or your
> change will be lost when you next upgrade.  If you do make the change,
> I expect you'll find the simple search to be noticeably (and perhaps
> unusably) slower.
>  - Alex
> 
> 
> 
> [1] https://github.com/bestpractical/rt/commit/8450f0a9f233d6a761ac22dbdf14926abc54d7fa
> 
> 



More information about the rt-users mailing list