Welcome to the Search Autocomplete & Suggest Guide!

Our Search Autocomplete & Suggest Documentation not only allows your customers to have quick and relevant autocompletion during search, but also provide searching tips, which will help them to locate their goal more quickly.

First, please find your extension in your account in My Downloadable Products section, and then proceed with Installation. It is best to follow our step-by-step guide in order to configure the best search results.

Go ahead, dive in!

Our extension works out-of-the-box, so after installation you need just to tune-up its settings for more effective work.

This should be a good beginning!

How to install extension

  1. Backup your store database and web directory.
  2. Login to SSH console of your server and navigate to root directory of Magento 2 store.
  3. Copy installation instructions from page My Downloadable Products to SSH console and press ENTER.
  4. Run command php -f bin/magento module:enable Mirasvit_Core Mirasvit_SearchAutocomplete for enable extension.
  5. Run command php -f bin/magento setup:upgrade for install extension.
  6. Run command php -f bin/magento cache:clean for clean cache.
  7. Deploy static view files

    rm -rf pub/static/frontend/*; rm -rf pub/static/backend/*; rm -rf var/view_preprocessed/*; php -f bin/magento setup:static-content:deploy

How to install extension

  1. Backup your store database and web directory.
  2. Login to SSH console of your server and navigate to root directory of Magento 2 store.
  3. Copy installation instructions from page My Downloadable Products to SSH console and press ENTER.
  4. Run command php -f bin/magento module:enable Mirasvit_Core Mirasvit_SearchAutocomplete for enable extension.
  5. Run command php -f bin/magento setup:upgrade for install extension.
  6. Run command php -f bin/magento cache:clean for clean cache.
  7. Deploy static view files

    rm -rf pub/static/frontend/*; rm -rf pub/static/backend/*; rm -rf var/view_preprocessed/*; php -f bin/magento setup:static-content:deploy

Configuring Autocomplete & Suggest

All Autocomplete settings are located at System / Settings / Mirasvit Extensions / Search Autocomplete section.

It consists of the following sections:

General Configuration

This section also breaks into lesser subsections, and contains the following options:

  • Minimum number of characters to search - specifies the minimum amount of characters, which customer should enter to trigger autocomplete.
  • The delay to start finding - specifies delay between triggering autocomplete. (by option above) and beginning of actual search.

    Note

    Our extension actually begins to search for possible autocompletions and suggestions only when both conditions match:
    • customer had entered minimal required number of characters;
    • there were no actions during specified delay period.
  • Fast Mode - Option allows to increase search speed due to the excluding Magento 2 from the autocomplete search at the initialization stage.

    Note

    • This option is available for Sphinx search and Elastic engines only;
    • The disadvantages include the increased indexing time of the search index, and the lack of some search capabilities, such as wildcard exceptions, individual search weight, Popular suggestions, Products in categories, number of found search results etc.
  • Searchable content - list of search indexes, where search is performed, and results displayed as autocomplete options. Indices are either taken from standard Magento, or if the extension is installed as part of Magento 2 Elasticsearch Extension or Sphinx Extension - from corresponding Indexes grid.

    Note

    The grid contains next settings:
    • Index - name of index, which can be included to autocomplete.
    • Is Enabled - includes current index to autocomplete
    • Max Number of results - the maximum number of results, which should be displayed in autocomplete drop-down widget.
    • Popular suggestions - based on the default Magento Search Terms. You can control it or modify at Marketing > SEO & Search > Search Terms.
    • Products in categories - is not a Category Index, Products in categories is taken from product results: the more matches the search query with products are found in the category, the higher the category will be in the list. Unfortunately, there is no option to control or modify it.
      You can drag and drop rows in this list to define order, in which results from different indices will be displayed in autocomplete drop-down.
  • Enable TypeAhead - enables auto-suggestion feature. Our extension collects information about most popular search queries and their results, groups them and stores separately. When autocomplete is triggered and TypeAhead option enabled, our application automatically searches for typed term and displays suggestion of found most relevant query.

    Tip

    Use Right Arrow button to quickly turn auto-suggestion to full autocomplete query and save autocomplete time.
  • Product Settings - defines content and appearance of autocomplete individual product information cells.
    • Show Price - displays price or price range of products. Will show only final_price of the product if Fast mode is enabled.
    • Show Thumbnail - displays small thumbnail of product image.
    • Show Rating - displays number of reviews and approval rating (so-called star rating).
    • Show Description - displays short excerpt from product's description.
    • Show SKU - displays SKU of the product.
    • Show "Add to cart" - displays shortcut button for quick purchasing products.
    • Optimize the autocomplete view for small screen size - allows optimization of autocomplete layout to small screen sizes. Note: may require additional style fixing at Appearance section.
    • Appearance - contains only one field, which defines custom appearance of autocomplete widget.
    • Additional CSS Styles - custom CSS styles, that should be applied either to entire drop-down, or to individual product cells. It is extremely powerful tool, which allows you to fit our Autocomplete extension to almost any theme.

      Example

      To customize individual product cell in autocomplete drop-down, use the following expression:
      .searchautocomplete__item-magento_catalog_product
      {
          // Your extended styles
      }

      It will be added to our stylesheet.

  • Hot Searches

    Hot searches are the most popular queries, which were requested by customers. If current customer request includes such a query, autocomplete can highlight them and put to the top of drop-down.

    • Search queries - allows to override Hot Searches by adding here special keywords (comma-separated), that should be counted as hot. It is very useful during promotional campaigns.
    • Ignored words - allows to exclude from Hot Searches certain keywords. It is also a list of comma-separated words.
    • Max Number of queries - the maximum allowed number of Hot Searches, which should be displayed on autocomplete drop-down.

      Tip

      Currently, Hot searches are the most searched Search Terms in your Magento. You can clear some of the search terms and it won't appear in Hot searches option: go to Marketing > SEO & Search > Search Terms, find the necessary term and delete it, otherwise, you will need to delete them in the database.

    FAQ

    This section describes the most common problems, that customers report, and how they can be resolved:

    How to make the autocomplete dropdown scrollable and smaller for mobile devices

    For this navigate to the Stores > Settings > Configuration > Mirasvit Extensions > Developer > CSS Settings and add the css styles below to the Additional CSS Styles field:

    @media screen and (max-width: 767px) {
        .mst-searchautocomplete__autocomplete {
            max-height: 200px;
            overflow-y: scroll;
        }
    }

    max-width: 767px - is the maximum width of the device for which these styles are applied.

    How to make the autocomplete show a product price including or excluding tax

    For this navigate to the Stores > Settings > Configuration > Sales > Tax > Price Display Settings and switch the option Display Product Prices In Catalog to Excluding Tax - to display price without taxes or any other option to display price including tax.

    Keep getting error onto each search page: The page you requested was not found, but we have searched for relevant content.

    This issue is possible if some page contains resources (js, css, images) with a 404 error.

    To prevent this issue, you can disable a 404 search at System -> Search Management -> Settings -> Mirasvit Extensions -> Search.

    After enabling Mirasvit_SearchAutocomplete my CSS styles are missed on frontend

    Please follow to System -> Search Management -> Settings -> Mirasvit Extensions -> Developer -> CSS Settings tab, set YES at Enable preprocessed CSS, then flush cache and run static content deploy.

    Does Mirasvit Search support REST API?

    Since Native Magento provides search API thus our search extension uses it as well, please follow the official documentation here

    Singular/Plural search: how it works?

    Our search extension supports singular and plural search out of the box for the EN, NL, RU locales. If you need to add support for other languages, use lang analyzer technology to customize your Elastic Search for the appropriate language.\ For the Sphinx extension, please use Sphinx engine version with Stemmer (with language specific morphology).

    Translation


    Our extension supports multilanguage stores. To translate it we have used the same logic as default Magento.


    All our translation files are in the "/i18n" folder of each sub-module.

    i18n files should be located at:

    • vendor/mirasvit/module-name/src/ModuleName/i18n - if installed via composer;
    • app/code/Mirasvit/ModuleName/i18n - if installed manually.


    Create a separate .csv file of your language for our extension. The names of all languages can be found with this command:
    php -f bin/magento info:language:list


    Override the strings in your dictionary file:

    "Original line" , "Translated line"


    To avoid rewriting the file with the updating of the module replace the translation file to your theme directory at app/design/frontend/THEME_VENDOR/theme_name/i18n/lg_LG.csv.
    Where lg_LG.csv is a translation file in another locale.


    To see the changes run these commands :
    php -f bin/magento setup:static-content:deploy
    php -f bin/magento cache:flush

    How to upgrade the extension

    To upgrade the extension follow these steps:

    1. Backup your store database and web directory.
    2. Login to the SSH console of your server and navigate to the root directory of the Magento 2 store.
    3. Run command composer require mirasvit/module-search-autocomplete:* --update-with-dependencies to update current extension with all dependencies.

      Note

      In some cases the command above is not applicable, it's not possible to update just current module, or you just need to upgrade all Mirasvit modules in a bundle. In this case command above will have no effect.

      Run instead composer update mirasvit/* command. It will update all Mirasvit modules, installed on your store.

    4. Run command php -f bin/magento setup:upgrade to install updates.
    5. Run command php -f bin/magento cache:clean to clean the cache.
    6. Deploy static view files

      rm -rf pub/static/frontend/*; rm -rf pub/static/backend/*; rm -rf var/view_preprocessed/*; php -f bin/magento setup:static-content:deploy

    Disabling the Extension

    Temporarily Disable

    To temporarily disable the extension please follow these steps:

    1. Login to the SSH console of your server and navigate to the root directory of the Magento 2 store.
    2. Run command php -f bin/magento module:disable Mirasvit_SearchAutocomplete to disabled the extension.

    Remove the Extension

    To uninstall the extension please follow these steps:

    1. Login to the SSH console of your server and navigate to the root directory of the Magento 2 store.
    2. Run command composer remove mirasvit/module-search-autocomplete to remove the extension.
    3. Run command php -f bin/magento setup:upgrade.

    Change Log

    1.2.4

    (2020-10-15)

    Improvements

    • Small spelling fixes

    1.2.3

    (2020-07-23)

    Fixed

    • Replace new lines with space (missing products in fast mode results)

    Improvements

    • Hide search on search icon click

    1.2.2

    (2020-07-08)

    Fixed

    • wrong price data in fast mode
    • show search term in fast mode empty results text
    • display search results in line
    • open result in new tab by image shift click
    • product reviews backward compatibility
    • misproportioned images
    • added comment for incompatibility with Fast Mode Autocomplete
    • getRating fix
    • decrease fast mode reindex server load
    • unknown column "score" issue

    1.2.1

    (2020-05-14)

    Fixed

    • Amasty Blog posts links
    • remove get params from URLs in fast mode for some cases

    1.2.0

    (2020-05-07)

    Fixed

    • compatibility with maria db
    • increase search autocomplete fast mode reindex speed
    • remove search box JS from checkout page to avoid conflicts with 3rd party

    1.1.109

    (2020-04-24)

    Fixed

    • ">" mark display issue
    • no word wrap on results title
    • filter out suggested search terms with mysql entries

    1.1.108

    (2020-04-07)

    Fixed

    • decrease server load in the fast mode
    • wrong category url
    • wrong add to cart action in the fast mode
    • fast mode product urls different from regular results
    • 'category product' index display issue
    • apply fast mode translations

    1.1.107

    (2020-03-04)

    Fixed

    • old search results are visible while new search is running
    • wrong product url in fast mode
    • in-stock product filter already applied issue

    1.1.106

    (2020-02-12)

    Fixed

    • Invalid attribute name: store_id on reindex
    • Category product arrow styling issue
    • Wrong product url on multi-store results when fast mode enabled

    1.1.105

    (2020-01-02)

    Fixed

    • Disable native search autocomplete

    1.1.104

    (2019-12-18)

    Fixed

    • Blackbird contentmanager index

    1.1.103

    (2019-12-16)

    Fixed

    • Add blackbird contentmanager index

    Improvements

    • Product search index refactoring

    1.1.102

    (2019-12-09)

    Fixed

    • Rating issue

    1.1.101

    (2019-12-03)

    Fixed

    • Wrong search results breadcrumbs
    • Rating issue

    1.1.100

    (2019-11-25)

    Improvements

    • Use default magento price block for search autocomplete

    1.1.99

    (2019-11-25)

    Fixed

    • Unable to apply 'Add to Cart' translation
    • Missing product rating
    • Category index results wrong urls in fast mode
    • CMS page index results wrong urls in fast mode

    1.1.98

    (2019-11-14)

    Fixed

    • Conflict with Webkul ShowPriceAfterlogin

    1.1.97

    (2019-11-12)

    Fixed

    • Search Button is not clickable when selecting the term from the Hot Searches

    1.1.96

    (2019-08-08)

    Fixed

    • Issue with wrong layer

    1.1.95

    (2019-08-06)

    Fixed

    • Prices issue for multistore setup in 'Fast Mode'
    • Product thumbnails issue in 'Fast Mode'

    1.1.94

    (2019-07-31)

    Fixed

    • Issue with autocomplete visibility, even if cart popoup was showed

    1.1.93

    (2019-07-30)

    Features

    • Fishpig Glossary index support

    Fixed

    • native search form active state
    • nested environment emulation error
    • reindex speedup
    • Blinking autocomplete box with multiple search forms on the same page

    1.1.92

    (2019-06-19)

    Fixed

    • Render html entities on server side
    • KB article typo in template
    • Remove .active when on autocomplete miss focus

    1.1.91

    (2019-04-26)

    Fixed

    • conflict with IE 10

    Improvements

    • Added message after fast mode enable

    1.1.90

    (2019-04-24)

    Fixed

    • Ensure search autocomplete Fast Mode config file on reindex
    • Display Fast mode indexes in correct order

    1.1.89

    (2019-04-12)

    Fixed

    • incorrect module conflict declaration

    1.1.88

    (2019-04-08)

    Fixed

    • Similar results in multiple attribute indexes

    1.1.87

    (2019-04-01)

    Fixed

    • Translations for search in stores with fast mode

    Improvements

    • Improved weighting, ability to use advansed search options, synonyms, stopwords

    1.1.86

    (2019-03-13)

    Fixed

    • Search in stores with fast mode