What's New in 4: Fast full-text searching

RT is commonly used to manage a lot of data. Unfortunately, prior toRT 4, it didn't support effective indexing of the content of comments or correspondence. RT 4 makes use of the full-text indexing capabilities of PostgreSQL and Oracle, or the external Sphinx library for MySQL, to efficiently index this content, allowing for high-speed searching of textual content. Due to bugs in version 4.0.0, you'll need version 4.0.1 or higher to take advantage of the full-text indexing detailed below.

By default, with no full-text indexes enabled, RT 4 does not allow searching of the "Content" field at all, owing to how resource-intensive unindexed full-text searches are. If you wish to enable non-indexed full-text searching, like previous versions of RT allowed, you will need to add the following to your RT_SiteConfig.pm:

Set(%FullTextSearch,
Enable  => 1,
Indexed => 0,
);

The real magic comes from enabling your database's full-text indexes, however. For the section below, we'll be showing the configuration for PostgreSQL; we'll briefly address MySQL, which is slightly more complicated, at the end of this post.

If you intend to enable full-text indexed searches, you should also read the docs/full_text_indexing.pod file which shipped with your RT install, which will provide roughly the same information as below, but is additionally guaranteed to be up-to-date with your version of RT.

PostgreSQL configuration

To start off with, you'll need to configure your database to store the index. On PostgreSQL, this consists of adding a new column and creating an index on it. To do this, run rt-setup-fulltext-index:

$ /opt/rt4/sbin/rt-setup-fulltext-index
Enter the name of a DB table that will be used to store the Pg tsvector.
You may either use the existing Attachments table, or create a new
table.
[Attachments]:
Enter the name of a column that will be used to store the Pg tsvector:
[ContentIndex]:

Generally, you'll want to store the new column in the Attachments table, right next to the data it is indexing. If you want to back up the index separately, or have other storage constraints, you may wish to create a new table to store it, but the default is almost certainly correct. Similarly, the default column name is also most likely correct.

You may choose between GiST or GIN indexes; the former is several times
slower to search, but takes less space on disk and is faster to update.
[GiST]:

You can read more about the differences between the index types in the PostgreSQL manual.

Going to run the following in the DB:
ALTER TABLE Attachments ADD COLUMN ContentIndex tsvector
Going to run the following in the DB:
CREATE INDEX ContentIndex_idx ON Attachments USING gist(ContentIndex)
You can now configure RT to use the newly-created full-text index by
adding the following to your RT_SiteConfig.pm:
Set( %FullTextSearch,
Enable     => 1,
Indexed    => 1,
Column     => 'ContentIndex',
Table      => 'Attachments',
);

At this point, your database has been configured. Ensure that you add the Set(...) block that rt-setup-fulltext-index output (which may be different from the above!) to your RT_SiteConfig.pm before continuing.

Your index now exists, but is empty. In order to fill it, we must find and index every textual attachment in RT using rt-fulltext-indexer --all. This can be a very time-consuming task, so be prepared for it to take a while. It can be interrupted and resumed safely, however.

Once it has finished, you will need to schedule rt-fulltext-indexer to run at regular intervals to pick up new additions to the database. This is easiest done by running ln -s /opt/rt4/sbin/rt-fulltext-indexer /etc/cron.hourly, which will ensure that it runs once an hour, but many other alternatives are possible. Depending on how fast tickets are created in your system, running it as frequently as once every two to five minutes may be possible.

MySQL configuration

The story on MySQL is unfortunately considerably more complicated, as MySQL does not natively support a full-text index format. It integrates with the external Sphinx search library, but this requires recompiling MySQL to include the SphinxSE engine which allows MySQL queries to retrieve data from the Sphinx searchd indexer. While many vendors package the external Sphinx tools, none of them ships a MySQL package which has been compiled with SphinxSE at the time of writing. As such, this is most likely not for the faint of heart, or those only just getting their feet wet with system administration.

Despite that, the process of recompiling MySQL with SphinxSE is fairly straightforward. Full instructions are provided in the Sphinx documentation. Sphinx 2.0.1 has been tested to work with both MySQL 5.0 and 5.1; it is not compatible with MySQL 5.5 at this time.

Once a SphinxSE-enabled MySQL has been installed, the configuration proceeds roughly as for PostgreSQL, above. First, you must run rt-setup-fulltext-index, which will ensure that your MySQL is correctly configured with SphinxSE, then prompt you for additional information:

$ /opt/rt4/sbin/rt-setup-fulltext-index
Enter name of a new MySQL table that will be used to connect to the
Sphinx server:
[AttachmentsIndex]:
Enter URL of the sphinx search server; this should be of the form
sphinx://<server>:<port>/<index name>
[sphinx://localhost:3312/rt]:

In order to communicate with the Sphinx searchd server, we create a virtual SphinxSE table in the database. This table hence needs to know where your Sphinx searchd server is running. The default is usually correct if you are planning to run searchd on your database server on the default port.

Maximum number of matches to return; this is the maximum number of
attachment records returned by the search, not the maximum number
of tickets.  Both your RT_SiteConfig.pm and your sphinx.conf must
agree on this value.  Larger values cause your Sphinx server to
consume more memory and CPU time per query.
[10000]:

This is an unfortunate limitation imposed by the design of Sphinx; 10000 should be sufficient for most purposes, but you may need to increment this number if you have tickets with an extremely large number of transactions which match your common search criteria. If you wish to change this number later, you must alter it in both RT_SiteConfig.pm and sphinx.conf files.

Going to run the following in the DB:
CREATE TABLE AttachmentsIndex (
id     INTEGER UNSIGNED NOT NULL,
weight INTEGER NOT NULL,
query  VARCHAR(3072) NOT NULL,
INDEX(query)
) ENGINE=SPHINX CONNECTION="sphinx://localhost:3312/rt" CHARACTER SET utf8
You can now configure RT to use the newly-created full-text index by
adding the following to your RT_SiteConfig.pm:
Set( %FullTextSearch,
Enable     => 1,
Indexed    => 1,
Table      => 'AttachmentsIndex',
MaxMatches => '10000',
);

It will also output a sample sphinx.conf file. At this point, your database has been configured. Ensure that you add the Set(...) block that rt-setup-fulltext-index output (which may be different from the above!) to your RT_SiteConfig.pm before continuing.

Your index now exists, but is empty. In order to fill it, we must run the Sphinx indexer:

$ indexer rt
Sphinx 2.0.1-beta (r2792)
Copyright (c) 2001-2011, Andrew Aksyonoff
Copyright (c) 2008-2011, Sphinx Technologies Inc (http://sphinxsearch.com)
using config file '/etc/sphinx.conf'...
indexing index 'rt'...
collected 133809 docs, 1015.6 MB
sorted 137.2 Mhits, 100.0% done
total 133809 docs, 1015645236 bytes
total 144.967 sec, 7006036 bytes/sec, 923.02 docs/sec
total 400 reads, 6.474 sec, 637.6 kb/call avg, 16.1 msec/call avg
total 582 writes, 2.473 sec, 959.3 kb/call avg, 4.2 msec/call avg

Finally, you will need to start the searchd daemon:

$ searchd
Sphinx 2.0.1-beta (r2792)
Copyright (c) 2001-2011, Andrew Aksyonoff
Copyright (c) 2008-2011, Sphinx Technologies Inc (http://sphinxsearch.com)
using config file '/etc/sphinx.conf'...
listening on all interfaces, port=3312
precaching index 'rt'
precached 1 indexes in 0.033 sec

You will need to re-index the data using indexer --rotate rt at regular intervals. Since Sphinx does not do incremental indexing, but rather re-indexes all content each time it is run, a "main+delta" split of the data may be necessary to reduce index update time sufficiently to allow close to real-time indexing.

Share this post:

SSL and login fixes for rt.cpan.org

For increased security, rt.cpan.org now redirects all non-SSL requests to the HTTPS side of the service. Although we always encouraged using rt.cpan.org over SSL, we haven't required it until now.

This change happily fixes login continuity problems caused by having a secure cookie but clicking on non-secure links. If you had issues staying logged into the service, it should be much better now.

Additionally, OpenID login now works again after applying some fixes last night. The RT security releases from April originally broke it.

If you have problems with the service please email us at cpan-questions@bestpractical.com.

Share this post:

RT 4.0.1 released

I'm happy to announce that RT 4.0.1 is now available.

This release is a bugfix release. It contains a number of notable fixes identified since the 4.0.0 release:

  • Fixes for MySQL+Sphinx and native PostgreSQL full text search, and improved documentation.

  • Javascript to forbid running RT in a frame, to prevent clickjacking attacks.

  • Better detection and hinting of common web path misconfigurations.

  • Minified javascript with an external jsmin now works in fastcgi and mod_perl deployments. This requires that mod_perl deployments switch to 'SetHandler modperl'; see docs/web_deployment.pod .

  • Javascript fixes for IE8 in the admin UI.

  • Multiple warning fixes during the upgrade process.

  • Removed previously missed rights related to right delegation.

Share this post:

RT Training Sessions for 2011

Best Practical Solutions provides unparalleled instruction in how to get the most out of RT.

2011 will bring two-day training sessions to six cities across the world. As we like to keep class sizes relatively intimate, register soon or we may not be able to guarantee you a seat.

These sessions will be offered in:

  • Boston (Cambridge), MA, USA — August 15 & 16, 2011
  • Chicago, IL, USA — September 26 & 27, 2011
  • San Francisco, CA, USA — October 18 & 19, 2011
  • Washington DC, USA — October 31 & November 1, 2011
  • Melbourne VIC, Australia — November 28 & 29, 2011
  • Barcelona, Spain — TBA

If you can't make it to these cities, please drop us a line to request a public training for your area in 2012.

This training will introduce you to the new features in RT4 as part of a comprehensive overview of RT. Whether you're an old hand at RT or a recent convert, you'll have a good understanding of all of RT's features and functionality by the end of the session.

The first day starts off with a tour of RT's web interface and continues with a detailed exploration and explanation of RT's functionality, workflows and configurability. We'll touch on basic administration, but concentrate largely on helping you and your team get the most out of your RT instance.

The second day of training picks up with RT administration and dives into what you need to safely customize and extend RT. We'll cover point-and-click configuration, upgrading and installing RT, development best practices, RT's API, building an extension, and database tuning.

It goes without saying that you'll get the most out of training if you attend both days of the course, but we've designed the material so that you can step out after the first day with a dramatically improved understanding of how to use RT or show up on the second day and get quickly up to speed on how to make RT do your bidding.

Learn more on our website: http://bestpractical.com/services/training.html

Share this post:

End of life for RT 3.6

On Friday September 30th, 2011 Best Practical Solutions will cease support for the 3.6 series of Request Tracker. 3.6.0 was released on June 15th 2006 and the series has received only critical bug and security fixes since June 2008. We will continue to provide critical bug or security fixes until September 30th, 2011 if any are required.

We're currently developing a schedule for future RT series and will publish an end of life policy and schedule as soon as they are complete. The 3.8 series will continue to receive bugfixes at this time, but our development efforts will be concentrated on polishing RT 4.0 and working on the new features we have planned for 4.2.

Share this post:

We're hiring! Come hack Perl for Best Practical

About us

We're Best Practical Solutions, a small software company located in Somerville, MA. We build software and sell support, training, consulting, and custom development. Our main product, RT (Request Tracker), is the premiere open source issue tracking system. We've been around since the fall of 2001 and are entirely self-funded. We're currently hard at work on our next new product. Things just keep getting busier.

About the job

We're looking for a Perl Hacker to help us enhance and refine our products, and help us be excellent to our customers. You'll be responsible for everything from implementing new features across all our products to testing and applying user-contributed patches to our released software. In a typical week, you'll probably spend about half your time working on customer projects and half working on internal and open source projects.

The hours are flexible and we all telecommute some of the time...though we work from our office in the heart of Davis Sq, Somerville, most days. We do just about EVERYTHING online and on the phone. You should be comfortable using email and instant messaging systems to collaborate and get work done.

About you

You should be a self-starter who has some experience with Perl, as well as a bit of experience with at least a few of the following:

  • Open source development practices
  • Distributed source control
  • Test driven development
  • User interface design
  • Documentation
  • Javascript
  • SQL databases
  • Optimization, profiling, and debugging
  • UNIX systems administration

It's okay if you don't know everything out of the gate, but you should be able to learn on the fly and be comfortable asking questions when you get in over your head. RT is a large codebase to dive into, so you should be prepared to work with a project that's too big to hold in your head at once. If you want to see what sort of trouble you're getting yourself into, you can find all of our open source code http://github.com/bestpractical/.

We're a small company and the boss is typically overextended. You should be comfortable working both independently and in small teams, prioritizing tasks on your own, and juggling tasks and projects.

Compensation

DOE - This is a full-time salaried position, but the details are negotiable. We're a small, self funded company. The standard benefits apply, of course: health insurance, dental insurance, and junk food to make that dental insurance worthwhile.

How to apply

Send something approximating a cover letter, and a resume in plain text, HTML or PDF, and a sample of some code you've written to resumes@bestpractical.com. If you're involved in open source development of one kind or another, please tell us about it. If you have a CPAN ID, tell us what it is. We won't consider applications without a code sample. We'll be paying particular attention to the readability, comments and tests.

 


Share this post:

What's New in 4: Streamlined quotes in correspondence

As a ticket grows long in the tooth, correspondence which quotes the entire history of the conversation can balloon to become extremely large and unwieldy. It can be taxing just to find the new content of incoming email amidst all its history.

RT 4.0 makes this more manageable by folding away quoted content during ticket display. This lets you focus on what's important: the new text. When you do need to see the quoted text, it's still there, hidden behind a click. Now when you look at a ticket, you won't have to mentally skim over quoted lines or paragraphs. Quote folding makes reading a ticket's correspondence and history far more comfortable.

Screenshot: ticket correspondence with quote folds closed

When you expand those folded-away quotes by clicking "Show folded text", you'll see that RT 4.0 now also colors nested quotes differently, so you can easily distinguish who wrote which text. The nesting level of each quote becomes more apparent when colored. Let RT count the angle brackets for you.

Screenshot: ticket correspondence with quote folds open

Our quote folding is robust enough to understand various quoting disciplines, whether it be top-posting, interleaved, or bottom-posting. You also don't have to stick with > to indicate quotations; RT recognizes many other kinds of quote markers.

HTML display

Along with quote folding, we've improved how RT 4 displays HTML content in ticket history. One way that a lot of people quote text is by coloring the original text or the new content in their response. To facilitate such quoting, RT 3.8.2 and later display colors specified in HTML mail. RT 4.0 improves our HTML mail handling further. RT 4 understands more ways that mail client generates text styling, especially Microsoft Outlook. We also permit more kinds of styling, such as font-family and font-size.

Share this post:

RT 4.0.1rc1 available for testing

We're happy to announce that RT 4.0.1rc1 is now available for testing.
If you had any problems with 4.0.0 or have been preparing for an upgrade, we'd appreciate your feedback as we prepare for the 4.0.1 release. 

http://download.bestpractical.com/pub/rt/devel/rt-4.0.1rc1.tar.gz
http://download.bestpractical.com/pub/rt/devel/rt-4.0.1rc1.tar.gz.sig

SHA1 sums
9cf2baab4db8bd085ed95e3f4f2ac0f296c1af65  rt-4.0.1rc1.tar.gz
ee050fe10819bee0f341db304c10182e5e470c0e  rt-4.0.1rc1.tar.gz.sig

This release contains a number of bugfixes identified since the 4.0.0 release as well as some changes that didn't make the 4.0.0 code freeze.

  • Fixes for MySQL+Sphinx and native PostgreSQL full text search and  improved documentation.
  • Javascript to forbid running RT in a frame, to prevent clickjacking  attacks.
  • Better detection and hinting of common web path misconfigurations.

You will also find a new tarball, rt-4.0.1rc1-third-party-source.tar.gz
This contains the uncompiled source of any code that we ship (such as the minified source of jQuery).

A complete changelog is available from git by running 
git log rt-4.0.0..rt-4.0.1rc1 
on the 4.0.1-releng branch.  You can read more about how to get a clone of our git repo and branch it in the new docs/hacking.pod

 

Share this post:

What's New in 4: Editing rights just got easier

Screenshot: global group rights editor

We completely revamped the user and group rights editor for RT 4. The new editor features a number of usability improvements:

  • Only the users or user-defined groups with rights granted to them are shown. This means you don't see every privileged user in the system when you just want to change rights for one. It also makes the editing rights much faster for systems with large numbers of users or groups.
  • Each right has a description which helps you find the one you actually want. If you're used to the short right names like us, you can click on those too.
  • Rather than a tiny select box or one long list, the rights are now grouped into logical tabs based on the most common type of user you might grant them to. The tabs are just suggestions though, and there are bound to be times when you want, for example, Requestors to have a right normally reserved for your staff.
  • Any subgroups of a group are shown next to the group name when you're editing rights. This quickly shows who else will inherit the rights you add or remove.

Adding rights to a user or group

If the group already has rights granted to it, simply click on the group name, click the rights you want to add, and Save Changes.

If the group doesn't have existing rights, begin typing its name into the Add Group field, and a list of autocompleted options will pop up. Choose the group you're looking for and then click on the rights you want to add, saving changes when you're done.

Removing all rights from a user or group

Uncheck every right from the user/group and click Save Changes. You should see a number of Right Revoked status messages (one for each right previously granted), and the user/group shouldn't appear in the left hand list. If they still appear, then you likely missed a right and should check again.

Share this post:

What's New in 4: Autocompletion of requestors, owners, and more

In the past, RT's requestor, Cc, and other user fields were just plaintext boxes that accepted email addresses or usernames. It was easy to typo an address or misspell a username and end up with not quite the ticket you wanted. Often making matters worse, the Owner field was limited to a dropdown. This worked fine for sites with a small number of possible owners, but it fell down quickly with more than a few dozen potential owners.

RT 4 solves the problems above by introducing built-in autocompletion for requestors, owners, Ccs, and AdminCcs. Out of the box, requestors and the other user fields now autocomplete as you type. The owner list remains a dropdown by default, but you can easily enable owner autocompletion by changing your preferences. You may prefer to enable it site-wide by adding Set($AutocompleteOwners, 1); to your RT_SiteConfig.pm file.

Screenshot: autocomplete for ticket create

Where do I see user autocomplete in action?

An autocompletion box should pop up for any field that accepts a username or email address. This includes the ticket create, update, jumbo, and people pages. Adding a requestor to a ticket is now much quicker, for example. Just go to the People page and start typing the email address, username, or real name of the new requestor in the input box under Add New Watchers. Select the user from the autocomplete, change Type to Requestor and click Save Changes. The old style find people form still works as usual, of course.

Screenshot: autocomplete for the ticket people page

The user administration page in RT 4 sports a "Go to user" input box at the top that autocompletes against all the users in the system. If you have a long list of privileged users, or you're looking for an unprivileged one, it's now a breeze to jump to their record.

Screenshot: autocomplete for user admin page

Customizing for your organization

Out of the box, user autocomplete matches against the beginning of email addresses, usernames, and any part of real names. This should suit most organizations well, but don't fear if it doesn't work for yours, there's an easy way to change it!

Perhaps there are a lot of people named Joe in your company and you want to match on RT's nickname field as well. Adding this bit to your RT_SiteConfig.pm would do the trick:

# See more valid options here by running: perldoc /opt/rt4/etc/RT_Config.pm Set($UserAutocompleteFields, { # Keep the defaults EmailAddress => 'STARTSWITH', Name => 'STARTSWITH', RealName => 'LIKE', # Add the NickName field -- too many Joes! NickName => 'LIKE', });

Or perhaps a help desk wants to pick users by phone number when adding requestors.

Set($UserAutocompleteFields, { # Keep the defaults EmailAddress => 'STARTSWITH', Name => 'STARTSWITH', RealName => 'LIKE', # Useful for fielding support phone calls WorkPhone => 'STARTSWITH', });

With that in place, your staff will be able to add requestors by phone number in RT.

Share this post: