How Search Works in Magento 2 - HBWSL Magento2 Blog
Magento 2 Tutorials

How Search Works in Magento 2

Site Search is very important part of your e-commerce website. The ease of finding the desired product and the relevancy of search results impacts sales.  Studies even suggest the placement of a product in search results may affect its sales favorably or adversely.

So how do you gain more control over site search on your ecommerce website? We have created this guide to tell you how search works in Magento and how to configure it for better results.

Search in Magento 1.x Versions

To understand search in Magento 2, we need to first understand how it worked in the previous versions.

Magento 1.x supports three types of search functionality –

  • Like – This method lets customers find products which are similar to the words they searched for. For example, a search for “red jacket” will result with products that are either “red” or “jacket” or have any of the search terms in their description.
  • Full Text – This method lets customers find products which are an exact match to the search term being used. For example, a search for “red jacket” will only result in products that have “red jacket” in the product name.
  • Combine – The problem with the full-text method is, it is too rigid. What happens if there are very few terms that have “red jacket” in their product name? You may lose a sale over a rigid search method. To solve this problem, Magento offered a third type of search method – Combine. Combine method uses search results from both the Like method and the Full-Text method.

Search in Magento 2

You now have a basic idea of search function works in Magento. But there have been big changes made to the Magento platform.

Magento 2 no longer offers setting up a search method! It now comes with a Full-text MySQL search engine.

You’re probably thinking, how do I set up the search in my store then? Worry not. The search methods have been optimized and made into a default function. Instead of setting individual methods, you are now given even better tools to control product search in Catalogs.

We’ll cover the following types of searches and how to use them in this article:

  1. Quick Search
  2. Advanced Search
  3. Weighted Search
  4. Configuring Catalog Search
  5. Search Terms
  6. Search Synonyms

Search Terms

Search terms are queries your customers are searching for on your website. You can get a good insight from generating a search terms report. In search terms report, you can filter data by terms, stores, results displayed, number of times the term was used (hits) etc.

If a lot of people are searching for a product, it reflects in the search terms. If you don’t have the product, you should add it to your catalog for better sales results.

A few ways to use Search terms are:

  • Adding a search term for the products you don’t have. Search terms let you add a redirect URL to the query. So when a customer searches for a product you don’t have, they will be redirected to a product page which you do have in your catalog.
  • Adding a search term for misspellings. By default, there is no support for search in Magento 2 for misspellings. You can add search terms for major spelling mistakes and redirect them to your product page. For example, a customer may search for ‘rod iron’ or ‘rot iron’ instead of ‘wrought iron’ in a furniture store.

Follow these steps to add a new Search Term:

  1. Go to Marketing => Search Terms (under SEO & Search)Search Terms Submenu
  2. Click on Add New Search TermAdd or Edit Search Term
  3. Fill in the query detailsSave Search Term
  4. Set “Display in Suggested Terms” to “Yes”
  5. Click Save Search
Quick Tip: When using redirect URL in Search terms, remember that the landing page can be a content page, a category page, a product page or even a web page from a different website.

Search Synonyms

Imagine losing a customer because they typed in a different search query to the product name in your store. For example, product name in your store may be “t-shirt” and your customer is searching for “tees”. Or they may be searching for “fleece” or “hoodie” and you have a “sweatshirt” listed in your catalog.

You can add a set of synonyms for a product so that your customer gets search results related to your product instead of getting a “No Results” notification.

You can learn in our step-by-step tutorial, how to add search synonyms in Magento 2.

That’s all there is to out-of-the-box functions for search in Magento 2.

Mirasvit Sphinx Search Ultimate

If you’re unsatisfied with Magento 2 Community edition’s out-of-the-box search and want advanced site search capabilities, there’s a great extension by Mirasvit – The Sphinx Search Ultimate for Magento 2.

The best features of Mirasvit Sphinx Search Ultimate are –

  • Search results within milliseconds – High searching speed of over 500 queries/sec against 1,000,000 SKUs
  • Search auto-complete
  • Search support for keywords with hyphens/slashes
  • Responsive themes support
  • Accurate search results even when your product is misspelt, and
  • Search support for multiple content types –
    • CMS Pages
    • Forums
    • Catalog Products
    • Categories
    • Attributes
Share this Story
Load More Related Articles
Load More By Editorial Staff
Load More In Magento 2 Tutorials

Check Also

How A/B Testing Using Humcommerce Can Increase Conversions on Your Magento Store

Magento is one of the most powerful e-commerce ...