So you’ve built your amazing prestashop and you’ve imported hundreds of products into the system but alas, when you peform a search, nothing is returned even though you know you’ve entered text present in one of your products.
This one had me stumped for a bit as I assumed that the data would be stored within the system or that prestashop would do some dynamic search on the database records. It turns out prestashop is a little more sophisticated than that and actually indexes all the products in the site to make search results quicker.
To ensure all of your products are indexed go to your backend, click on preferences and then search.
Once in there you will see how many products have been indexed. If you had the same problem as me you will see that 0 products have been indexed. This is because I imported products from a CSV. Manually inserted products are automatically indexed.
Once you are in backoffice->preferences->search you will see something like
Indexed products: 44 / 44.
-> Add missing products to index.
-> Re-build entire index.
You can click either option to re-index your products. Once you don’t have thousands of entries it should take < 1 min to do. You can also set up a cron job to perform this indexing regularly for you.
Other options on this screen inclued
- Ajax search: To automatically fill in your search box, like google
- Minimum word length
- Blacklisted words
There are also options here to weight your search results using various factors such as weight, tags etc.