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 whether

Magento 2 offers

  • 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.

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 quick search

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 advanced search

 

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. how to use advanced search magento 2

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.

 

search results page magento 2

 

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.

 

search weight magento 2

 

 

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 catalog search configuration

  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 elasticsearch installed on your server. (deselect use system value)
    • Elasticsearch (Deprecated) — Elasticsearch 2.0+ that has been shutdown.
    • Elasticsearch 5.0+
    • Elasticsearch 6.0+

  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

elasticsearch connection settings

 

 

  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.

OptionScopeDescription
Minimal Query LengthStore ViewThe 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 LengthStore ViewThe maximum number of characters allowed in a catalog search.
Number of top search results to cacheStore ViewThe 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 LimitStore ViewThe maximum number of search results to display for search autocomplete. The default value is 8.
Enable Search SuggestionsStore ViewSearch suggestions appear when the search box returns no results.
Search Suggestions CountStore ViewThe maximum number of search suggestions offered for search queries. The default value is 2.
Show Results Count for Each SuggestionStore ViewEnables or disables the number of search results shown for each suggestion.
Enable Search RecommendationsStore ViewChoose whether to show search recommendations or not when a search query returns zero results.
Search Recommendations CountStore ViewDetermines the number of search terms offered as recommendations. The default value is 5.
Show Results Count for Each RecommendationStore ViewWhen set to “Yes”, the number of products found for a given search query are shown beside the search recommendations

 

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.search terms magento 2

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 search synonyms add synonyms magento 2

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

 

popular search terms magento 2

  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.

search engine optimization magento 2

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.

adding search terms

To add a new search term

add new search term magento 2

  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.Search terms report magento 2

muthali ganesh

Muthali loves writing about emerging technologies and easy solutions for complex tech issues. You can reach out to him through chat or by raising a support ticket on the left hand side of the page.