Configuring product catalog search in Magento 2 is one of the ways to help your customers find products faster using the product search form.
Together with the layered navigation, Magento 2 catalog search enables you to create a great customers' shopping experience and provide them with the flexible and easy-to-use Magento 2 product catalog navigation.
Catalog search form is the most basic and the most used form of catalog navigation since all you need to do to get to the preferred product is to type a word or a phrase.
Besides, people who use the search form to find a product are more likely to make a purchase.
So, in this article, we will cover the types of catalog search in Magento 2 and go through the catalog search configurations.
Let's dive in.
Post Contents [hide]
Magento 2 Catalog Search Types
To ensure customers receive the best experience on your Magento 2 store there are 2 types of catalog search available - Quick Catalog Search and Catalog Advanced Search.
Quick Catalog Search
Magento 2 Quick Catalog Search requires customers to type just a few characters or a phrase that matches the name of the product or some other product information.
Advanced Catalog Search
Magento Advanced Search allows customers to be more specific about the products they are looking for. They can search for a product not only by Product Name but also SKU, Price, Long and Short Descriptions.
You can even add the product attribute to the advanced search, so customers can search for products by color, size, etc. Check the Storefront Properties section of the product attribute configurations to find out more.
Using the advanced catalog search in Magento 2 customers can find products that correspond to their queries in the best way which is great for their experience.
Catalog search settings allow you to make the search more effective by setting the store search recommendations, suggestions, results count and other options.
Want to track how many customers use catalogue search and what pages they use it from? Add Magento 2 Google Tag Manager to your store and get in-depth data reports on customers' behaviour.
Configure Catalog Search in Magento 2
To configure catalog search in Magento 2:
1. Go to Stores > Configuration > Catalog > Catalog > Catalog Search.
2. Set the Minimal and Maximum Query Lengths which define the minimum and the maximum number of characters in a search query. These options have to be compatible with the configurations of the search engines which we will cover later in this article.
Note: it's better to set a bigger number of minimum queries since the small number can impact the performance.
3. Enter the Number of top search results to cache for faster responses. The default number is 100 but you can also set 0 to cache all search terms and results entered the second time.
4. Select the Search Engine to use for catalog search.
Magento 2 offers you two different search engines to use for the Magento 2 catalog search: MySQL and Elasticsearch.
So, all of the above-mentioned configurations are to be configured for each of them.
However, both MySQL and Elasticsearch search engines also have some specific options you'll have to configure once you decide which search engine to use.
MySQL Catalog Search in Magento 2
MySQL is the search engine that is set for catalog search in Magento by default. To configure MySQL catalog search take the following steps:
- Set the Autocomplete Limit that is the maximum number of search results to display automatically.
- Enable Search Recommendations and set the Search Recommendations Count to limit the number of search recommendations displayed when the customer types in the search query.
- Decide whether to Show Results Count for Each Recommendation. It is the number of products that correspond to the search query which is displayed in brackets (3) near each search recommendation.
- Enable Search Suggestions and set the Search Suggestions Count to limit the number of search recommendations to show to the customer.
- Enable the Show Results Count for Each Suggestions option if you want to show the number of products in brackets near each suggestion.
Note: if you enable Search Recommendations Suggestions and Recommendations it can slow down the work of the website.
Configure Elasticsearch for Catalog in Magento 2
You can choose one more possible option for the catalog search — the Elasticsearch used by highly reputable online stores.
There are different versions available for you to select. However, it is highly recommended to use the Elasticsearch 6.x since 2.x. and 5.x. versions are not supported any more.
To configure Elasticsearch for you product catalog search on your Magento 2 store, follow these steps:
1. Enable EAV Indexer.
Note: this option is only available for Elasticsearch or Elasticsearch 5.x search engines.
2. Set the Autocomplete Limit that is the maximum number of search results to display automatically.
3. Configure the Elasticsearch Connection.
- Set the Elasticsearch Server Hostname, Port and Index Prefix.
- Choose whether to Enable Elasticsearch HTTP Auth to prompt for a username and password to access the Elasticsearch Server.
- Set the Elasticsearch Server Timeout or time period after which the system will time out.
- Test Connection to make sure you've successfully connected to the Elasticsearch Server.
4. Finish configuring Elasticsearch for the Magento 2 catalog search by setting the Search Recommendations and Suggestions in the same way as for the MySQL search engine.
Once you're finished with all configurations, don't forget to Save Config.
Blog Search and Catalog Search Integration
If you manage a blog on your Magento 2 store, the blog search integration will be of great benefit to you. Our Magento Blog Extra edition has the blog search integration feature that allows you to display products and blog posts in the search results.
This way your customers will be able, not only to find the products they are looking for, but useful blog posts connected to the search query as well.
Catalog Search is an integral part of your Magento 2 store not only because it improves your website navigation but because it encourages your customers to look for products and make purchases.
Coming to a website customers don't want to spend much time going through the endless product catalogs to find nothing that fits eventually. That is why configuring catalog search, you make sure they find it faster.
Except for all of the configurations described in this article, you can make the product catalog search more effective by creating search synonyms and adding your own search terms.
Managing popular search terms will help you to understand what your customer comes to your website for and what products are of great need.
Check out the article about Magento 2 search terms and synonyms configuration to learn more!