Configuration

Smart Search: getting it to stay current

Smart Search: getting it to stay current

Smart Search only finds what it has indexed. Keep the index current with the Content - Smart Search plugin, a scheduled task and an occasional rebuild.

Smart Search (com_finder) keeps its own index. Search quality depends entirely on that index being up to date. There are three pieces to get right.

1. Turn on the content plugin

In the plugin manager, enable Content - Smart Search. This is the piece that indexes an article the moment you save it. Without it, the index only changes when you rebuild it by hand, which is the situation most neglected sites are in.

The finder plugins themselves (Smart Search - Content, - Categories, - Contacts, - News Feeds, - Tags) decide what types of content are indexed at all. Leave on the ones you use.

2. Build the index once, from the command line

The button in the admin works, but on a site with a few hundred articles it will hit the PHP time limit. The CLI has no such problem:

php cli/joomla.php finder:index

Run it from the root of your Joomla install. It processes in batches and tells you how long each one took. A site of 150 articles finishes in a few seconds.

3. Let the scheduler keep it honest

The content plugin covers articles you edit through the admin. It does not cover things that change without a save: an article whose publish date has passed, content imported straight into the database, or an item deleted outside the CMS.

Joomla has a task scheduler built in, under System, Scheduled Tasks. Add a task, pick a rebuild interval that matches how often your content actually changes, and let it run. Weekly is plenty for most sites.

For the scheduler to fire at all, something has to trigger it. Joomla offers three ways, set in the Scheduled Tasks options:

  • Lazy scheduler, which piggybacks on visitor traffic. Enable the System - Schedule Runner plugin. Fine for a busy site, unreliable for a quiet one.
  • Web cron, a URL with a key that you call from an external cron service.
  • CLI, which is the one to pick if you have shell access:
php cli/joomla.php scheduler:run

Point a real cron job at that and the whole scheduler works, not just your search index.

Checking it worked

Smart Search's admin view lists what it has indexed and when. If the count is far below your article count, something in step one is off. If the count is right but a recent article is missing, the content plugin is disabled.

Stuck on something else?

Doctor Joomla is a project of Cloudfaction, a Dutch agency building and maintaining Joomla sites since 1999. The articles are made with the help of AI, so tell us if something does not match your screen. Mail info@cloudfaction.nl if you want someone to look at yours.

Rather have someone look at it

Doctor Joomla is a Cloudfaction project.

A Dutch agency that has been building and running Joomla sites since 1999. If your site needs more than an article can fix, get in touch.