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:
Magento 2 provides with a search box in the header section of your website. Your customers can make a quick search for the products they are looking for here. The search text can be the product name or just a part of the product name. It can also be an attribute describing the product.
You can manage the search terms being used by customers on your website using the Admin section of Magento installation.
To use quick search your customer:
- May enter first few letters of the product name in the search box;
- May tap a search suggestion to get to the relevant result.
Advanced search is available from the footer section of your website.
Advanced search displays result based on values your customer specifies in a form. It will display all the products that match the criteria set by the customer.
To use advanced search:
- Your customers may specify as many criteria available in the advanced filters. They can even fill forms with full or partial search terms.
- If they find search results to be inadequate and they can Modify the search filters.
Search results show the most relevant results which match the search terms and criteria. The only difference between Quick search and Advanced search is that quick search shows results based on search query and Advanced search shows results based on layered navigation.
You can view search results either in a grid or a list. You can also sort the search results by selecting an attribute from the drop-down list available.
|Quick tip: You can set how many products you want to display on search results page or in a grid from Catalog Storefront configuration.|
What happens when a customer searches for “red jacket”? Does Magento give search results for products with “red jacket” in the product name or products with “jacket” in the product name or both?
You can specify which results you want to show first in search results. You can also show only those results which are related to a specific part of a search term. All you need to do is assign Weight to attributes which are enabled for catalog search.
Attributes with higher weight are displayed in search results before the ones with lower weight.
For example, a search for “red jacket” has two search terms – a Color attribute and a Description attribute. Say, the Color attribute has a search weight set to ‘5’ and the Description attribute has a search weight set to ‘1’. The results will display search results for “red” and not for the “description”.
To set up the weighted search, follow these steps:
- Go to Stores => Attributes (Under Products)
- Find the attribute you want to change search weight for and open it in Edit mode
- Choose Storefront Properties
- Change the value of “Use in Search” to “Yes”
- Select “Search Weight” value. You can set weight from 1-10, with 1 being the lowest priority and 10 being the highest priority.
Configuring Catalog Search
As mentioned earlier, Magento 2 community edition supports only one search engine by default – a Full-Text MySQL search.
You can configure Catalog Search in Magento 2 using following steps:
- Go to Stores => Configurations
- Click Catalog and Select Catalog from the left sidebar options
- Scroll down and expand the Catalog Search section
- Set minimum and maximum query length here. Or you can use system values for these settings
As Magento 2 community edition offers only MySQL search engine, you don’t need to change this setting.
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:
- Go to Marketing => Search Terms (under SEO & Search)
- Click on Add New Search Term
- Fill in the query details
- Set “Display in Suggested Terms” to “Yes”
- 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.|
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
- Catalog Products