Magento 2 Search Settings and Terms
Magento 2 search functionality has been changed a lot if compare it with Magento 1. Thus, the latest version doesn’t allow for configuring search methods anymore. They were optimized and included into the default functionality. Besides, Magento 2 has been supplied with full text MySQL search engine. As a result, now you can control product search in Catalog rather than setting up individual methods and configure search terms.
Magento 2 Search Settings
Here you will learn how to set up a needed search type and enable it to work smoothly.
#1 Quick Search
In the upper-right section of your frontend header, you can find a search box. Visitors of your website can quickly surf for a needed product here. For this, a visitor enters a letter or several characters coming from the product he/she looks for and presses Enter key or taps a result in the list of matching products.
#2 Advanced Search Settings
The type of search allows your users surf the catalog by a larger set of parameters (product attributes: name, SKU, description, etc.) entered into the form:
The search result, in this case, becomes more precise as the engine checks multiple products against numerous matches. The link to the advanced search is in the footer of your webstore:
The fields of the form correspond to the attributes included in your product catalog. Thus, if you need to add a new field into the search form, make the next settings:
- Log in to the Admin Panel and navigate to Stores>Attributes>Product, then choose a needed attribute from the Attribute grid and go to the Storefront Properties;
- Set the Use in Search setting to ‘Yes’:
- Save the changes and clear the cache.
#3 Search Results
The list of search results includes all product variants relevant for characteristics entered in the Quick Search box or the Advanced Search form.
You can display the result list in a form of a product grid or a product list filtered and sorted by a set of attributes. In case the list of products exceeds a one-page size, there appears a pagination control. See how to set the product listing options here.
#4 Weighted Search
The Weighted Search option allows you to give attributes used in Advanced Catalog Search higher or lower value in search results. E.g.: Let’s suppose there are two attributes in the system, ‘color’ with the search weight of 3 and ‘description’ with the search weight of 1. Then a search query with the word ‘green’ will bring to a result list with products containing a color attribute value of green but without products with description that includes the word ‘green’.
To learn how to set up the search weight, see the path and the screenshot of the Advanced Search Settings. You can set a search weight to a number from 1 to 10. 10 has the highest priority here.
#5 Configuring Catalog Search
We have already mentioned Magento 2 uses the full text MySQL search engine. Here we’ll describe how to enable the MySQL engine and limit the size of valid query text.
- If you are still logged in the Admin Panel, navigate to the Stores>Settings>Configuration and choose Catalog option under the left-side drop-down Catalog menu. Expand the Catalog Search section and make the next settings:
Minimal Query Length: fill in the minimum number of characters that can be submitted by a user in a query;
Maximum Query Lenght: fill in the maximum number of characters that can be submitted by a user in a query;
Search Engine: use the default MySQL engine.
- Save the settings and clear the cache.
Magento 2 Search Terms
Monitoring the search terms applied by users can help you learn the actual product demand and improve current sales rates. If potential customers didn’t find the desired product in the catalog, you can direct them to another product rather than leaving them to hold an empty bag.
Here are several ways you can use the users’ search results to better the sales:
- Use a content page, a category page, a product detail page or page of another website as a landing page for a search term;
- Include synonyms and varieties of terms used by visitors to find one and the same product. E.g.: ‘chair’, ‘armchair’, ‘bench’, ‘recliner’, etc.;
- Find out common misspellings and redirect the queries to a correct product page.
How to Configure Popular Search Terms?
By default, the option is enabled as an engine optimization tool. However, it isn’t connected with the catalog search process. You can better your website ranking, as the Search Terms Page is indexed by search engines.
If you want to configure Popular Search Terms, log in to the Admin Panel.
- Then navigate to the Stores>Settings>Configuration>Catalog>Catalog>Search Engine Optimization:
- Enable the Popular Search Terms, save the settings and clear the cache.
How to Add Search Terms?
As you’ve learnt, you can add new search terms for better catalog navigation.
- If you logged in the Admin Panel, switch to the left sidebar and go to Marketing>SEO & Search>Search Terms then choose to Add New Search Term:
- Complete the next settings:
Search Query: fill in the phrase you want to add as a new term;
Store: choose a desired store view;
Redirect URL: if you want to redirect a user who applied the term for query to another page of the store or to another website, type the URL into the field;
Display in Suggested Terms: set the option to ‘Yes’ if you want the term to be applied as a suggestion if there is no result for a query.
- Save the settings and clear the cache.
If you need to edit a search term, you can make it right on the Search Term grid.
In case you need to delete a search term, set the ‘Action’ to delete in the upper-left corner of the Search Term grid:
Don’t forget to submit the action and clear the cache in the end.
How to Find Search Terms Report?
- Log in to the Admin Panel and choose Reports on the left sidebar. Then navigate to Marketing>Search Terms:
The report will allow you to see the number of results for each term, as well as the number of times the term was applied by users. The data included in the report can be filtered by term, store, results, and hits. Besides, you can export it for further analysis in CSV or Excel XML format.
Native Magento 2 search functionality can be taken to a new level with the use of Advanced Search. You will manage to show recent and popular searches and set up the search in categories, products on CMS pages. Besides, you can adjust the search window to your needs. For instance, show the ‘Add to Cart’ button in the advanced autocomplete window: