Magento 2 search settings guide

Magento 2 Search Settings Guide

Rate this article

Share this article

Magento 2 upgrade has brought in certain improvements to Magento. Site search is a very important feature for any e-commerce store and Magento search has always been one of Magento’s weak point. In this article, we will see how to configure magento 2 for the best search experience.

Magento 2 Features

  • Significantly improved scalability.
  • Faster page loading speed- Full-page caching has been built in Magento 2 which helps in faster speeds by reducing the number of disk reads and network round-trips.
  • A number of new marketing and analytics tools for Magento store owners to help them sell better.
  • A much simpler up-gradation process.
  • HTML5 and a revised CSS pre-processor.
  • All needed features to set up an e-commerce store in a short period of time.

Install the Magento 2 search extension

Magento 2 search settings guide

 

Catalog Search

Catalog search optimization is absolutely mandatory for Magento stores since website visitors who search are twice more likely to purchase than site visitors who don’t. So it is important that your Magento catalog search is optimized.

Quick Search

The Search box in the header of the store helps visitors find products in your catalog. The search text can be the full or partial product name or any other word or phrase that describes the product. The search terms that people use to find products can be managed from the Admin.

  1. In the Search box, on the top right-hand corner of your home page, customers can enter a few letters to find products that match against the product catalog. This is also known as autocomplete. ( Magento also shows that number of products matching in the catalog).
  2. Customers can either press the Enter key or tap a result in the list of matching products.Magento 2 search settings guide

Advanced Search

Advanced search lets your website visitors search your catalog by entering multiple fields into the search form such as

  1. Name.
  2. SKU.
  3. Description
  4. Short description
  5. Price.
  6.  Tax class.

 

Magento 2 search settings guide

 

Each of these fields is an attribute of your product. You can customize this search by including only relevant fields that you think will be useful for the site visitors.

  1. In the footer section of your Magento store, click on Advanced Search.
  2. Enter fields in the advanced search and click on search to get the search results.
  3. You can modify search parameters if you can’t find the search results you are looking for.
  4. Magento 2 search settings guide

Add Search to your Website

Search Results

Search results or the search results page contains all the products that match the search query entered into the search box. The results are shown as a grid or list which can be sorted by price or relevance. Pagination numbers are also present at the bottom of the page which can help to take users to the next pages in search results.

 

Magento 2 search settings guide

 

Weighted Search

Search weights help in changing your search results ranking by assigning individual weights to product attributes. In Magento 2, you can give weights to product attributes so that search results will change accordingly. For example, you can give more weight to the color of the product compared to the description of the product if more people are making color based searches on your website.

 

Magento 2 search settings guide

 

 

To set the search weights of an attribute-

  1. Login to your admin panel.
  2. From the admin sidebar, go to stores-> attribues-> product.
  3. Click on the attribute and click on edit.
  4. Choose storefront properties
    1. Set Use in search to “yes”.
    2. Set search weight from (1-10). 10 is the highest priority.
  5. Click on save.

Configuring Catalog Search

Magento supports both MySQL and elastic search.

MySQL

MySQL is the default search engine used by Magento.

MySQL is the default search engine. By adjusting the Catalog Search configuration, you can control the behavior of the search operations and determine the size of valid query text and the display of search recommendations.

Magento 2 search settings guide

  1. From the admin sidebar, go to stores-> settings-> configuration
  2. From the left panel, choose catalog.
  3. Expand the catalog search.
  4. Go to  stores-> settings-> configuration
  5. in the left panel, Choose catalog.
  6. Expand the catalog section.
  7. You can see that the search engine is set to MySQL.
  8. You can set the minimum and maximum query length.
  9. By default, the Search Engine is set to “MySQL”. If switching to MySQL, select that option. This affects the available fields.
  10. To limit the length and word count of search query text, set the Minimal Query Length and Maximum Query Length.
  11. Set the number of top search results to cache (default is 100. Entering 0 (zero) caches all search terms.
  12. Autocomplete limit The lower this number is, the faster the search performance is. The default amount is 8.
  13. You can enable search suggestions to “yes” or disable if not needed.
  14. To offer search recommendations, set Enable Search Recommendations to “Yes.”
  15. Click on save config.

Elasticsearch

Elasticsearch is a powerful search engine that powers search on many traffic-heavy websites.

Here are steps to configure elastic search

Step 1: Configure Search Options

  1. Go to the admin sidebar-> stores-> Settings-> Configuration.
  2. On the left panel, under catalog, choose catalog
  3. Expand the catalog search section.
  4. Set the minimal query and maximum query length.
  5. Under the  Search Engine field, choose the version of elastic search installed on your server. (deselect use system value)
    • Elasticsearch (Deprecated) — Elasticsearch 2.0+ that has been shutdown.
    • Elasticsearch 5.0+
    • Elasticsearch 6.0+

    Magento 2 search settings guide

  6. For Enable EAV Indexer, you can set it to be enabled. This improved indexing speed and prevents 3rd party extensions from using the indexer.
  7. If you would like to speed up the search speed, you can limit the number of top search results to cache to lower values for faster responses. The default is 100. Entering a value of 0 caches all search terms and results when entered a second time.
  8. Autocomplete Limit- Under autocomplete limit, deselect ” Use system value” and set a value. The lower the value you set here, the faster your search performance is.

Step 2: Configure the Elasticsearch Connection

Magento 2 search settings guide

 

 

  1. Enter the Elasticsearch Server Hostname.
  2. Enter the Elasticsearch Server Port.
  3. In the Elasticsearch Index Prefix field, enter a prefix.to identify the Elasticsearch index.
  4. Set Enable Elasticsearch HTTP Auth to “Yes” or no.
  5. In the Elasticsearch Server Timeout field, enter the number of seconds before the system times out. The default value is 15.
  6. Once the values are entered, click on Test connection to test your settings.

Step 3: Configure Search suggestions and Recommendations

Search suggestions and recommendations can impact server performance.

  1. Set Enable Search Suggestions to “Yes”. (if you would like to enable search suggestions).
  2. Search Suggestions Count – Here enter the number of search suggestions to display when a search query is made.
  3. Show results count for each suggestion- This option if enabled displays the number of items at the side of every search suggestion.
  4. To display search recommendations, set Enable Search Recommendations to “Yes”.
  5. In the Search Recommendation Count field, enter the number of recommendations to offer.
  6. If you would like to show the number of results found for each recommendation, set Show Results Count for Each Recommendation to “Yes”.
  7. When complete, click on save config

Here is an explanation of the search fields.

Option Scope Description
Minimal Query Length Store View The minimum number of characters allowed in a catalog search. For example, when you set the minimal query length to 2, search results will appear only after the user enter 2 letters in the search box.
Maximum Query Length Store View The maximum number of characters allowed in a catalog search.
Number of top search results to cache Store View The number of popular search terms and results to cache for faster responses. Since popular search terms are entered by all users again and again on your store, caching them might help in increasing search speed. Value of 0 caches all search results. The default value is 100.
Autocomplete Limit Store View The maximum number of search results to display for search autocomplete. The default value is 8.
Enable Search Suggestions Store View Search suggestions appear when the search box returns no results.
Search Suggestions Count Store View The maximum number of search suggestions offered for search queries. The default value is 2.
Show Results Count for Each Suggestion Store View Enables or disables the number of search results shown for each suggestion.
Enable Search Recommendations Store View Choose whether to show search recommendations or not when a search query returns zero results.
Search Recommendations Count Store View Determines the number of search terms offered as recommendations. The default value is 5.
Show Results Count for Each Recommendation Store View When set to “Yes”, the number of products found for a given search query are shown beside the search recommendations

 

Add Search to your Website

Search Terms

Search terms give great insights into what people are searching on your Magento 2 store. You can get an idea on what to stock more or find out gaps in product demand. You can also redirect customers to other pages for search queries that don’t have direct product name matches.

To view search terms,

  1. Log in to your Magento 2 admin panel.
  2. Navigate to Marketing-> Search terms.Magento 2 search settings guide

Landing Page

The landing page for a search term can be one of the following.

  1. Content page.
  2. Category page.
  3. Product page.
  4. Page on a different site.
  5. Check out page.
  6. Refund page.

Synonyms

Adding synonyms to Magento 2 is an easy way to direct users searching for products using search queries that don’t match their name in the catalog.

For example, if users are searching for “Apple laptop” and the product is listed as MacBook in your catalog, you can add MacBook as a synonym for Apple laptop

To add synonyms in Magento 2,

  1. Go to admin panel-> marketing-> Search synonyms.
  2. Click on the new synonym group button.
  3. Select the scope.
  4. Enter your list of synonyms separated by a comma.
  5. Click on Save synonym group.Magento 2 search settings guide Magento 2 search settings guide

Misspelled Words

The search terms report will give insights into spelling errors made by your customers. You can add redirects to such search terms and send them to the correct page or product using the synonyms feature.

Popular Search Terms in Magento 2

The most popular search terms on your Magento 2 store are displayed at the footer in the form of a tag cloud where the size of a search term indicates its popularity.

There is also a popular search terms page which can be accessed at yourstore.com/search/term/popular

 

Magento 2 search settings guide

  1. Go to stores-> settings-> configuration
  2. In the left panel, under catalog, choose catalog.
  3. Click on Search Engine Optimization section.
  4. Under Popular Search Terms, uncheck use system value as needed.
  5. Click on save config.

Magento 2 search settings guide

Add Search to your Website

Adding Search Terms- Magento 2

As you learn new words that people use to search for products in your catalog, you can add them to your search terms list to direct people to the most closely matching products in your catalog.

Magento 2 search settings guide

To add a new search term

Magento 2 search settings guide

  1. Go to marketing-> SEO & Search-> choose search terms.
  2. Click on Add new search Term.
  3. Under General Information
    • In the Search Query box, enter the search query
    • Choose a store.
    • Enter a redirect URL if needed.
    • If needed, set display in suggested terms to Yes
  4. Click on save search

To edit a search term in Magento 2

  1. In the Search Terms grid, click the row of the search term report in edit mode.
  2. Make the necessary changes.
  3. Click on save.

To delete a search term

  1. In the list, mark the checkbox of the term to be deleted.
  2. In the upper-left corner of the list, set Actions to “Delete”.
  3. When complete, tap Submit.

Search Terms Report- Magento 2.

The Search Terms report shows the

  • The number of results for each term,
  • The number of times (hits) the term was used.

The report data can be filtered by term, store, results, and hits, and exported for further analysis.

How to view the search terms report in Magento 2

  1. On the Admin sidebar, Go to reports-> Marketing-> search terms
  2. Use the controls to filter the report as needed.Magento 2 search settings guide

FAQ

How do I enable search in Magento 2?

Catalogue search optimization for Magento 2 is essential because otherwise, the visitors who search, will not be able to find the product they are looking for. The search box in the topmost part of the store site helps the visitor to find the products in the catalogue by searching full and partial names or words and phrases matching the product description.

Magento 2 has advanced search settings, giving you a chance to allow users to search by different variations like SKU, name of the product, and description in their form. It makes the search result more accurate. So, if you need to add another field to your search, you can

  • From admin panel> stores>attributes>product, choose the attribute needed from the attribute grid and go to storefront properties.
  • Set the user in the search setting to yes.
  • Save your changes and clean the cache.

What search engine does Magento use?

Magento uses both MySQL and elastic search, but MySQL is the default search engine. When you adjust the configuration of the catalogue search, you control how the search operations would behave. To enable the search MySQL engine and to limit the size of the text of valid queries, you can

  • Go to admin panel- stores- settings-configuration.
  • Choose a catalogue from the left-side drop-down part of the catalogue menu.
  • Expand the catalogue search section.

From that section, you can make the changes that are required, like

Minimal Query Length- the minimum character number that a user can submit in a query.

Maximum Query Length- choose the maximum number of characters that can be introduced for a query.

  • Save the settings. Clean the cache.

How do I search for products in Magento 2?

There are several ways to use the search results of users to improve sales –

  • Using pages like- content, category, and product detail, to use as a landing category for a search.
  • Including similar words to find the same product – like chair, armchair, etc.
  • Redirecting common misspellings to the correct page.

To configure popular search terms on Magento,

  • Log in to Admin Panel- click on stores- go to settings- search configuration -choose catalogue- again, choose catalogue- then click on search engine optimization.
  • Permit the popular search terms, and save the settings. Clean the cache. 

To add search terms,

  • Log in from Admin Panel- then choose Marketing- go to SEO & Search – and go to Search Terms –
  • In the search query, fill in the term to be added.
  • Store, choose the view you want.
  • Redirect URL if you want them to land on another page or site for the search they entered.
  • Use the display in suggested terms if you want the term to be displayed when there is no result for the search.
  • Save the settings. Clean the cache.

How does Magento 2 search work?

The search is either set on a schedule or entered manually. When a search is entered, it’s broken down into sections interconnected with logical OR, meaning if you enter more than a word, for each word, inquiries will be made separately. Like, short black dresses will be divided into short black dresses. This search type is accurate and will find products attributed to the terms.

To manage a search, when the search terms are entered, you can control each term and give a specification on where they would be shown, like – on search results or everywhere or in the catalogue.

Add Search to your Website

Are you showing the right products, to the right shoppers, at the right time? Contact us to know more.
You may also like