Skip to content
This repository has been archived by the owner on Jan 30, 2018. It is now read-only.

Configuring Search

micho edited this page Aug 9, 2010 · 12 revisions

Teambox can use Sphinx for indexing and search. Your app needs to have a MySQL or PostgreSQL database in order to have Sphinx perform indexing.

Install Sphinx

For this, follow the official instructions.

Enabling search

By default search in Teambox is disabled. You need to modify “config/teambox.yml” in order to enable it:

# Enable search (you must have thinking_sphinx installed and configured)
allow_search: false

Once you have enabled search, you need to generate the search index:

$ rake ts:index RAILS_ENV=production

Then simply run the following to start sphinx:

$ rake ts:start RAILS_ENV=production

Finally, you will need to periodically update the search index in order to keep up to date:

$ rake ts:rebuild RAILS_ENV=production

Configuring the indexer

You should add a line to your crontab to reindex the database using Sphinx. Something like this would reindex your database every 5 minutes:

0,30 * * * * cd /path/to/teambox && RAILS_ENV=production /usr/bin/env rake ts:reindex >> log/cron.log 2>&1
Clone this wiki locally