Difference between revisions of "Setting up automatic Smart Search indexing"

From Joomla! Documentation

(Created page with "Although the Smart Search index is automatically kept up-to-date whenever content items are amended, there are some circumstances where you need to run the re-run the indexer. Y...")

Although the Smart Search index is automatically kept up-to-date whenever content items are amended, there are some circumstances where you need to run the re-run the indexer. You can do this manually using the Index toolbar button in the [[Help25:Components Finder Manage Indexed Content|Manage Indexed Content]] screen, however if you need to re-index content automatically then it is also possible to run the indexer as a command-line application. This makes it particularly convenient to run the indexer from a cron job.

+

{{version|2.5,3.0}}Although the Smart Search index is automatically kept up-to-date whenever content items are amended, there are some circumstances where you need to re-run the indexer. You can do this manually using the Index toolbar button in the [[Help25:Components Finder Manage Indexed Content|Manage Indexed Content]] screen, however if you need to re-index content automatically then it is also possible to run the indexer as a command-line application. This makes it particularly convenient to run the indexer from a cron job.

−

The Smart Search CLI application is located in the <tt>cli/finder</tt> directory in your site's root directory (that is, the same directory as your configuration.php file). In this directory you will find a file called <tt>run.php</tt>. Simply enter this command to run the indexer:

+

The Smart Search CLI application is located in the <tt>cli</tt> directory in your site's root directory (that is, the same directory as your configuration.php file). In this directory you will find a file called <tt>finder_indexer.php</tt>. Simply enter this command to run the indexer:

<source lang="bash">

<source lang="bash">

−

php run.php

+

php finder_indexer.php

</source>

</source>

Typical output from the command-line indexer looks like this:

Typical output from the command-line indexer looks like this:

Line 21:

Line 21:

==Setting up a cron job==

==Setting up a cron job==

−

Whilst the specifics are beyond the scope of this article, in general you will merely have to enter the above command into the cron job manager and specify the time or times on which the job is to be run.

+

Whilst the specifics are beyond the scope of this article, in general you will merely have to enter the above command into the cron job manager and specify the time or times on which the job is to be run. You will probably need to include the full path to the indexer. For example, like this

+

<source lang="bash">

+

php /var/www/myjoomla/cli/finder_indexer.php

+

</source>

==Out of memory issues==

==Out of memory issues==

If your site has particularly complex indexing requirements it is possible that the standard memory allocation will not be sufficient for the indexer to run to completion. You can increase the memory allocated to the command-line indexer using an extra parameter on the command-line, like this:

If your site has particularly complex indexing requirements it is possible that the standard memory allocation will not be sufficient for the indexer to run to completion. You can increase the memory allocated to the command-line indexer using an extra parameter on the command-line, like this:

<source lang="bash">

<source lang="bash">

−

php -d memory_limit=256M run.php

+

php -d memory_limit=256M finder_indexer.php

</source>

</source>

Replace the <tt>256M</tt> with whatever is appropriate for your circumstances.

Replace the <tt>256M</tt> with whatever is appropriate for your circumstances.

Revision as of 07:36, 18 March 2013

This article is for Joomla! CMS Version(s)

Although the Smart Search index is automatically kept up-to-date whenever content items are amended, there are some circumstances where you need to re-run the indexer. You can do this manually using the Index toolbar button in the Manage Indexed Content screen, however if you need to re-index content automatically then it is also possible to run the indexer as a command-line application. This makes it particularly convenient to run the indexer from a cron job.

The Smart Search CLI application is located in the cli directory in your site's root directory (that is, the same directory as your configuration.php file). In this directory you will find a file called finder_indexer.php. Simply enter this command to run the indexer:

Setting up a cron job

Whilst the specifics are beyond the scope of this article, in general you will merely have to enter the above command into the cron job manager and specify the time or times on which the job is to be run. You will probably need to include the full path to the indexer. For example, like this

php /var/www/myjoomla/cli/finder_indexer.php

Out of memory issues

If your site has particularly complex indexing requirements it is possible that the standard memory allocation will not be sufficient for the indexer to run to completion. You can increase the memory allocated to the command-line indexer using an extra parameter on the command-line, like this:

php -dmemory_limit=256M finder_indexer.php

Replace the 256M with whatever is appropriate for your circumstances.

The command-line indexer uses the same parameters as the indexer on the Manage Indexed Content screen. You can change the parameters using the Options toolbar button on that screen. Note that both the Indexer Batch Size and Memory Table Limit fields affect the amount of memory used by the indexer.