PS PrestaShop Beginner

Smart Live Search — Complete Guide

Install, configure and operate DFLiveSearch: live search, suggestions, synonyms, typo tolerance, relevance, statistics and email alerts for PrestaShop 8 and 9.

Updated Module version 1.4.0

Overview and requirements

DFLiveSearch replaces PrestaShop’s native search with a live AJAX engine: a results panel opens from the first characters, showing each product’s image, name, price and promotional badges. The module also adds an intelligent search engine (synonyms, typo tolerance, weighted relevance), suggestion carousels (popular searches and recommended products), a full analytics dashboard and email alerts on no-result searches.

  • Compatible with PrestaShop 8.0 to 9.x, Classic theme and derived themes.
  • PHP 8.1 and above.
  • Multi-shop and multilingual (FR/EN/ES/DE/IT).
  • No file overrides: native hooks only.

The module relies on the hooks displayHeader, displayTop, displaySearch, displayBackOfficeHeader and actionOrderStatusPostUpdate. It creates six tables: dflivesearch_stats, dflivesearch_log, dflivesearch_alerts, dflivesearch_popular, dflivesearch_synonyms and dflivesearch_lexicon.

Installation

Install the module like any other PrestaShop module:

  1. Download the dflivesearch.zip archive from your customer account.
  2. In the back-office, go to Modules > Module Manager.
  3. Click Upload a module and drop the archive.
  4. Once installed, click Configure.

On installation, the module registers its hooks, creates its tables and pre-fills a placeholder text translated into the five languages. A few common synonym groups are also pre-filled and the typo-correction dictionary is built from your catalogue. The live search field is immediately active on your store.

Updating

Update from the Module Manager as usual. The built-in upgrade script creates the new tables, applies the default values of the new options (synonyms, relevance, typo tolerance, search bar appearance) without touching your existing configuration, then rebuilds the correction dictionary. No manual action is required. After updating, clear the PrestaShop cache and regenerate the assets to purge the old JavaScript.

After a large catalogue import, remember to rebuild the correction dictionary (see the “Intelligent search” section) so typo correction reflects your up-to-date catalogue.

General configuration

The configuration page gathers the search behaviour settings:

  • Enable the module: turns the live search field on or off on the store.
  • Placeholder text: text shown in the field, translatable per language.
  • Minimum number of characters: search trigger threshold (2 by default).
  • Maximum number of products: limit of results displayed in the panel.
  • Popular searches and recent searches: display of suggestion carousels before typing.
  • Autocomplete: term suggestions (products, categories, popular searches) while typing, with keyboard navigation (up/down arrows, Enter, Escape) and highlighting of the typed term. The maximum number of suggestions is configurable.
  • Quick add to cart and quantity selector: options to add a product directly from the results.
  • Personalised products: factors in the logged-in customer’s history for automatic recommendations.

Appearance

The Appearance section lets you adapt the search to your branding:

  • Primary colour: colour of buttons and accents (default #2196F3).
  • Primary colour (hover): button hover colour (default #1976D2).
  • Max window width: maximum width of the search panel. Accepts a CSS value such as 900px, 1200px or 100%.
  • Search bar size (since version 1.4.0): Small, Medium or Large. Adjusts the height, text size and icon size of the bar displayed in your header.
  • Search bar width: maximum width of the bar itself (400px, 50%, 30rem…). Leave the field empty to fill the theme container’s full width.
  • Search bar corner radius: from 0 (square corners) to 50 px (pill shape).
  • Keyboard shortcut: opens the search with Ctrl+K (Cmd+K on Mac) or the / key from anywhere on the page. A hint badge (“Ctrl K” or “⌘K”) is shown in the bar on desktop. The option can be disabled.

These values are injected as CSS on the front. For an Algolia-style “pill” bar, pick a corner radius of 50 and a Large size. For a full-width results window on both mobile and desktop, enter 100% in the window width field.

Since version 1.4.0, the search window is fully keyboard accessible: the bar is focusable and opens with Enter or Space, focus stays inside the window while tabbing, Escape closes it and focus returns to the bar. A clear button appears in the field as soon as text is entered, and animations respect the system prefers-reduced-motion preference.

Recommended products appear as a carousel as soon as the search field opens. Two modes are available via the Recommended products source setting:

  • Automatic: the module selects best-sellers (and factors in customer history if the “Personalised products” option is enabled).
  • Manual: you precisely choose the featured products.

In manual mode, a dedicated selector appears: search for a product by name or reference, click to add it, then reorder the thumbnails by drag-and-drop. The defined order is respected on the storefront.

Only active and visible products are offered in the selector. The order of the thumbnails determines the order of appearance in the carousel.

Search behaviour

Search works by words: each typed word must be found (in the name, reference, EAN code or short description), in any order. A query like “simple bell stethoscope” therefore finds the product even if those words are not adjacent in the name. Since version 1.2.0, each word is also expanded to its synonyms and the search covers variant references (see the “Intelligent search” section).

Products with combinations

For a product with combinations, the add-to-cart button is replaced by a “View options” button that links to the product page, so the customer can choose their combination before adding. When the customer searched for the exact reference of a combination, this button leads straight to the matching variant.

Availability and stock

Out-of-stock products remain visible in the results and carry an “Out of stock” badge. This badge does not appear for products where ordering out of stock is allowed (PrestaShop’s “Allow ordering” setting): those remain addable to the cart.

If you enter a quantity greater than the available stock of a product that cannot be ordered out of stock, the module does not add the product and shows a message indicating the remaining quantity.

Intelligent search: synonyms, typos and relevance

Since version 1.2.0, DFLiveSearch includes an intelligent search engine. All these settings are in the Intelligent search section of the configuration page.

Synonyms

The synonym dictionary links equivalent terms: a customer searching for “tv” also finds products named “television” or “telly”. The editor is multilingual (one tab per language). Enter one group per line, with terms separated by commas:

tv, telly, television, television set
computer, pc, laptop
headphones, headset, earphones

All terms on the same line are treated as equivalent: searching for one of them automatically expands the query to the others. Enable or disable the feature via the Enable synonyms option. A few common groups are pre-filled on installation; adapt them to your catalogue.

Synonyms are stored per shop and per language. Remember to fill in each language tab to cover your whole customer base.

Typo tolerance

When a search returns no results, the module automatically tries to correct the typo using a dictionary built from your catalogue (product names, references, categories). If the correction yields results, they are shown directly with a “Results for…” notice and a link back to the original spelling.

  • Typo tolerance: turns automatic correction on or off.
  • Max correction distance: maximum number of differing characters tolerated (1 to 3; 2 recommended). A higher value corrects more typos but increases the risk of false positives.
  • Show “Did you mean?”: displays the correction banner. When disabled, the correction is applied silently.

Correction relies on a phonetic pre-selection (SOUNDEX) followed by a Levenshtein distance calculation: it recovers “television” from “televsion”, for example. Words shorter than three characters are not corrected; short equivalences (such as “tv”) are handled by synonyms.

Correction dictionary

The correction dictionary (table dflivesearch_lexicon) is built on installation and can be rebuilt at any time via the Rebuild dictionary button on the configuration page. The info box shows the number of indexed words and the date of the last rebuild.

Rebuild the dictionary after a large catalogue import or a mass change of product names, so typo correction reflects your up-to-date catalogue. You can also automate this rebuild via a scheduled task.

Result relevance

Results are ranked by a weighted relevance score: exact name match (highest score), name starting with the query, query contained in the name, then reference and EAN. Two boosts complete this ranking:

  • In-stock boost: at comparable relevance, available products rise to the top of the list.
  • Best-seller boost: favours the best-selling products, based on PrestaShop sales statistics.

Both options can be enabled independently in the Intelligent search section.

Search by variant reference

The search now covers the identifiers specific to combinations: reference, EAN, UPC and supplier reference of each variant. Typing the reference or barcode of a combination therefore brings up the parent product. When the query looks like a code, the result points straight to the right combination (link to the exact variant) and the card shows that variant’s reference and price.

Purely alphabetic references (no digit) remain findable but open the product page on the default combination. References containing digits (EAN, most SKUs) trigger the direct link to the exact variant.

Dashboard and statistics

The module logs every search (term entered, number of results, any product click, order conversion). The back-office dashboard shows:

  • total searches and the number of unique searches;
  • success, click and conversion rates;
  • a day-by-day search evolution chart;
  • the top 20 searches with clicks and conversions;
  • the top 20 no-result searches;
  • a CSV export of all the data.

Conversion tracking uses the actionOrderStatusPostUpdate hook: an order placed after a click in the search results is counted as converted. Since version 1.3.0, each order is counted only once, regardless of subsequent status changes.

Email alerts

The alert system monitors terms that return no results. As soon as a term exceeds the configurable threshold (5 by default), an email alert is sent to the address of your choice and a notification appears in the back-office header. Each alert can be marked as read or dismissed. Email templates are provided in the five languages (EN/FR/ES/DE/IT) and the subject is sent in the store’s default language. These no-result searches are a valuable source for detecting catalogue gaps, common typos or missing synonyms to add.

Data retention

Search logs are kept for 90 days by default (configurable duration). A manual clean-up button is available in the back-office, and since version 1.3.0 an automatic purge runs continuously according to the configured retention period.

FAQ and troubleshooting

How do I configure synonyms?

In the “Intelligent search” section of the configuration, enter one synonym group per line (terms separated by commas) in each language tab, then save. Make sure the “Enable synonyms” option is active.

In the “Appearance” section, choose the bar’s size (Small / Medium / Large), maximum width and corner radius. A radius of 50 gives a pill-shaped bar. These settings only affect the bar displayed in the header; the results window is controlled by “Max window width”.

How do I disable the Ctrl+K shortcut?

In the “Appearance” section, set the “Keyboard shortcut” option to No. The badge disappears from the bar and the Ctrl+K, Cmd+K and / keys no longer open the search.

A search with a typo returns an empty page

Check that the “Typo tolerance” option is enabled and that the correction dictionary contains words (info box in the configuration). After a large import, click “Rebuild dictionary”. You can also increase the “Max correction distance”.

The search does not find a variant reference

Search by variant reference (ref, EAN, UPC, supplier ref) is available since version 1.2.0. Update, clear the cache and regenerate the assets. To get the direct link to the exact variant, the query must look like a code (contain at least one digit).

The search returns nothing for several words

Search works by order-independent words. If you have just updated, clear the PrestaShop cache and regenerate the assets to load the new JavaScript.

The autocomplete panel hides the results

Autocomplete closes automatically when the field loses focus or with the Escape key. Make sure you are using the latest version and clear the cache if the old behaviour persists.

An “out of stock” badge appears on an orderable product

The module reads the “Allow ordering” setting in the Quantities tab of the product page (stored in StockAvailable on PrestaShop 8). Check this setting: if it allows ordering, no badge is shown.

What happens on uninstall?

Uninstalling cleanly removes the hooks, the configuration variables and the module’s six tables. No residual data is left in the database.

Was this page helpful?

Still stuck? Contact support