Magento 2 Training Courses Magento 2 Training, Coaching and Consultancy now available - Find out more

Better Magento Search Results

An Alternative Approach to Configuring Your Magento Quick Search for Better Search Results

NOTE: You need to have a basic understanding of Attributes and Attribute sets in Magento to get the most out of this article. Our Free sample training material covers an introduction to attributes that you may find a useful.

On your Magento store you have a search function. Normally this is located in the header of your store or in that area.

When a customer enters a product name, or type of product into that search they would expect the system to return a list of related products that match the search term. This is not always the case and for many the search facility leaves a lot to be desired.

There are solutions in the market to help you with this and I will list some at the end of this post but for starters I want to give you a work around that may put you back in control of these search results (as well as allowing for spelling mistakes and typos).

Understanding how Magento Search Works

First we need to understand how the search works and to do that we need to be familiar with Magento's attributes (don't know what attributes are? Download our free sample training material which will introduce to these essential elements to running a Magento store).

When configuring an attribute one of the options is whether the attribute value is to be made available for searching on.

If you have a look through the attributes you will notice that attributes such as Name and Description have this value set to yes. By setting this to yes it means that this value is included in the search - so if you entered a name of 'Widget 1' for a product you would be able to search for 'Widget 1' in the quick search.

Whats the problem?

Well you might not actually have a problem with this. If when testing your searches and you are getting the results you would expect then you can walk away now. However the problem often comes from description type fields where you may enter information against a product that is not information you might want it returned in searches for. Take a look at the example below:

When we search for 'Sun Cream' most of the results are ok but there is one erroneous product.

The problem product is the 'Twister Beach Towel' which has no place in this search results. So why is it there? If we click through on the beach towel and take a look at the description you will see this text -

You can see the phrase 'sun cream' is included in the description meaning that this product will appear when you search for 'sun cream'.

The work around

This solution will not be right for all but it give you an alternative configuration for the 'Out of the box' Magento search.

If you are familiar with attributes you will know that you can create attributes that are not visible to your website visitor. I am suggesting that you create a new 'Text Area' attribute called 'search_terms'. Make it 'not visible on front end' and set 'Use in Quick Search' to 'Yes'.

Give the attribute a label and now assign this attribute to every attribute set you have.

You can now populate this attribute for each product with the keywords, phrases that relate to that product. Because the content of this attribute is not visible to your website visitor you have total control of what you put in here so you might also include competitor product names, common misspellings and anything else you like.

Once you have done this go back into your attributes and set the description (and short description if you use it) 'Use in Quick Search' to 'No' and reindex your data.

Obviously this solution requires every product to have values in the 'search_terms' attribute. You may find using the Import facility will help you speed up the process of populating this.

Of course there are other options and this is a 'Low tech' work around solution if you wanted to just use the out on the box functionality.

There are more sophisticated solutions out, here are just a couple of products I'm aware of:

Klevu - Magento Smart Search

Better Store Search

Leave a Reply

Sorry, you must be logged in to post a comment.