Sometimes we may find that some newly added products are not available to be searched in the shop. The reason is that the product is still not included in the product index.
The situation is like you have bought some books, but haven’t put them onto the book self yet.
However, in PrestaShop, the products should be automatically indexed into the search when they are saved in the Backoffice. But if you are using some third-party software to manage the catalog (where they may directly communicate with the database) etc. The product index may not be complete.
We are going to discuss how to index the product on below.
- Backoffice access (for manually re-build)
Scheduled re-build by cron job
- Server access / Web hosting account (for creating cron job)
- curl / wget command
You may find related settings in backoffice under [Shop Parameters] ⇒ [Search]. You should see a section like below picture:
The details are shown here, where you may know how many products are indexed. 2 choices are available in the middle, which allow you to choose whether re-build the whole index or only insert the missing products. Simply clicking on them will do the trick!
Cron is a build-in function in Linux system which allow users to schedule tasks. This can be done directly on the server or some hosting platforms like cPanel or Cloudways.
Cron use a row of 5 value to define the schedule time, below are some examples:
* * * * * means to execute at every minute
0 3 * * * means to execute at 3am each day
0 5/12 * * * means to execute at 5am & 5pm each day
0 */3 * * * means to execute every hours
0 0 1,15 * 3 means to execute at 00:00 if it is the 1st or 15th or the month and it is Wednesday
If you are not sure about your inputs, you may check and get a human-readable description here: crontab.guru
Tasks can be scheduled by inputting entry at the bottom with below format:
0 3/12 * * * curl "https://xxx....."
There are 2 commands can do the trick:
wget "[URL]" -O /dev/null
wget is usually pre-installed in Linux machine. However, running
wget command will save file on the current directory. Using the switch
-O /dev/null could prevent this happen
curl looks simply but it is not always pre-installed in Linux machine. Please make sure you have this command available before you create the cron job.
There is a BUG in version 220.127.116.11 & 18.104.22.168, where you are not able to re-build the index by using cron job. Please make sure your shop is having a version ≥ 22.214.171.124 to ensure the cron job works.
If you are unfortunately using 126.96.36.199 / 188.8.131.52, we recommend you to upgrade the version or use the fix provided below: