On this page
How Magento search works today
Magento 2.4 uses a separate search engine to find your products. This is OpenSearch on newer versions of Magento, or Elasticsearch on some installs. When a customer types into the search box, Magento looks for the words in your searchable attributes. Each attribute has a Search Weight that Magento uses to rank the results. The results are displayed with layered navigation.
Around that sit three tools that are easy to overlook: synonym groups, so “sofa” also finds “settee”; stop words, the little words like “the” and “for” that are ignored; and search term redirects, which send a search straight to a page. Set up well, they fix a surprising number of problems. Left alone, Magento search is literal. It matches words, not meaning, so “warm coat for dog walking” mostly finds products with “dog” in the name.
Two smaller settings catch people out. Magento ignores searches shorter than its minimum query length (three characters by default), so a shopper typing “XL” or a two-letter code gets nothing. And stop words live in files per language rather than in the admin, so changing them is a job for your developer. Both are worth knowing before you start testing.
Measure first
Before you change a setting, find out what’s going wrong. Magento already records every search. Go to Marketing → SEO & Search → Search Terms: each row is a search phrase, with the number of results it returned and how many times shoppers used it. Three views are worth ten minutes each.
- Zero results. Filter Results to 0 and sort by Uses. Some are products you don’t sell, which is useful buying intelligence. Many are products you do sell under a different word.
- Most used terms. Sort by Uses. Your top 50 searches carry a large share of all searching, so they deserve testing by hand.
- Variants and misspellings. “Gilet” vs “body warmer”, “trainers” vs “sneakers”, “grey” vs “gray”.
Magento’s report can’t tell you what happened after a search. If your web analytics records site search, look for searches followed by an exit or by a second, reworded search. Both mean the first results didn’t help, even when the result count wasn’t zero. A search for “kids wellies” that returns 40 adult boots is a failure the zero-results filter will never show you.
Then work out your zero-result share for a month: zero-result searches divided by all searches. Write it down. It’s your baseline, and it tells you whether anything you do next is working. The glossary explains zero-result searches and click-through rate, and our post on fixing zero result searches goes deeper.
Searches for things you don’t sell
Every zero-result list has searches for products you don’t stock. Don’t ignore them. A handful are noise, but a steady trickle of “bivvy bag” on an outdoor store is a buying conversation waiting to happen. Share the list with whoever does your buying each month.
Meanwhile, give those shoppers somewhere to go. Redirect the term to the nearest category, or write a short content page (“We don’t sell bivvy bags, but these lightweight shelters do the same job”) so search finds something honest instead of nothing.
Fix the basics in Magento admin
These six steps are all things you can do in your Magento backend. They should be done regardless of what tool you decide to use.
-
Add synonym groups
In Marketing → SEO & Search → Search Synonyms, add groups for words shoppers use interchangeably: “sofa, settee, couch”. Start with your zero-result terms, and keep each group to true equals: “boots” and “shoes” aren’t the same to someone who wants boots. More in our post on Magento search synonyms.
-
Send some searches straight to a page
Open a term in Search Terms and set its Redirect URL. “Returns”, “delivery” and “size guide” should land on those pages, and a brand name can go to the brand’s category.
-
Check which attributes are searched, and how much they count
In Stores → Attributes → Product, open each important attribute’s Storefront Properties. Set Use in Search to Yes for name, SKU, brand and what shoppers type (colour, material, compatibility), and give name and brand a higher Search Weight than long descriptions. Switch searching off for attributes that only add noise, such as internal supplier notes.
-
Tidy product names
Names do most of the work. Brand, product type and key spec beats a supplier code or a marketing name on its own: “Ridgeline merino base layer, men’s, long sleeve” is found by far more searches than “RML-200 Alpine”.
-
Decide what happens to out-of-stock products
Check the Display Out of Stock Products setting in your inventory configuration, and each product’s visibility. Hiding everything out of stock makes popular searches return nothing; showing it with a back-in-stock option often works better.
-
Test your top 50 terms
Once Magento has picked up the changes (on most stores this runs on a schedule), search each top term by hand on desktop and phone. If you wouldn’t buy from the first row, nor will shoppers.
Autocomplete
The search box is where shoppers decide
Plenty of shoppers never see your results page. They type a few letters, glance at the dropdown and click, or give up. That makes the dropdown the most important part of search, and on many Magento stores it’s the weakest.
A good one shows products with images and prices, categories, content pages, a “did you mean” option if a typo is detected and recently searched terms if the search box is empty. It should take up most of the screen on mobile and be keyboard accessible and screen reader friendly. It should also give your shoppers the option to ask a question if they can’t describe what they’re looking for in words. More on search autocomplete in the glossary.
Ottla’s instant search box, a feature of the Ottla Magento module, does all of this and links to the assistant. On a new install it takes over the header search dropdown, including those of popular autocomplete extensions, and pressing Enter with nothing selected still runs Magento’s own search.
Part numbers and trade buyers
Your trade customers know the product code and type it in. They don’t browse. Magento is pretty good at returning a product when a full SKU is searched. But what about a partial code? What about when they type the code with a space instead of a hyphen? Or a part number from the manufacturer that isn’t your SKU? Or a barcode? Test all of these on your own products.
What will your trade customers want to see? Smaller product rows that show price, stock and a quantity box that adheres to pack sizes, allowing them to add 10 boxes of screws to their basket without visiting the product page.
Don’t forget about old product codes. Your trade customers search for products that they’ve ordered in the past. If you have a discontinued SKU, it should lead to the product that replaced it. If Magento can’t do this on your store, you can always create redirects for your most searched-for old product codes.
Long questions and everyday wording
Shoppers increasingly type the way they talk: “warm coat for dog walking”, “something for a six-year-old who loves dinosaurs”, “paint for a bathroom ceiling”. Keyword search struggles because the useful words (“warm”, “bathroom”) rarely appear in product names.
A few practical fixes help. Let content pages and buying guides appear in results, so “which tent” finds your tent buying guide. Show a short answer from your help content where one exists. And for searches that are really questions, offer a way into an assistant that can ask what the shopper needs and suggest products. Someone typing “tent for windy campsites” is asking for advice, and a list of every tent sorted by relevance doesn’t give it. The glossary covers semantic search, which matches meaning rather than exact words.
Ranking and merchandising results
Relevance should decide most of the order. Business rules then adjust it: boost a brand you’ve just taken on, bury products with high returns, pin a hero product to the top of garden furniture for the bank holiday, exclude anything you can’t deliver in time. Time-box anything promotional so it switches itself off, and keep the positions your team has curated on key category pages.
Sorting is also important. Shoppers use best sellers, newest and biggest saving. They don’t use position.
Review your rules on a monthly basis. You’ll have a rule to promote a new brand, a rule for a promotion with a supplier and a rule someone added in a panic last spring. Before you know it, your search relevance isn’t doing much. Ensure you have an owner and end date for each rule. And remove any that you can’t explain.
Category pages and filters
Category pages are search results someone else chose the words for, and filters do the narrowing. Good filters come from clean attributes: consistent values, sensible names and counts that show how many products each choice leaves. Each category should show the filters that matter there; “heel height” belongs on shoes, not handbags. Watch for filters with a single option, near-duplicate values (Navy, Navy blue, Dark blue) and combinations that lead to empty pages. Order values the way shoppers think, not alphabetically: sizes run S, M, L, XL, and seat counts run 2, 4, 6, 8. Put the filter shoppers use most at the top, which on a clothing store is nearly always size.
Our catalogue guide covers attribute clean-up, the glossary explains faceted search, and there’s a post on faceted navigation best practices.
Several stores and languages
With several store views, search problems multiply quietly. Synonyms are language-specific (“pull” is a jumper in French and a verb in English), so set synonym groups per store view. Redirects may differ by store: your Irish delivery page isn’t your UK one. And check top searches in each store view separately, because each market searches differently.
If you run several brands from one Magento install, make sure each website’s search only ever returns that brand’s products, and test it. A shopper on your premium brand finding your budget brand’s version of the same kettle is an awkward conversation.
Keep Magento search as your safety net
Whatever you add on top of Magento’s search should fail quietly. If the service behind your search box is slow or down, shoppers should get Magento’s own search and pages, not an empty dropdown or a spinner. Ask every vendor to show you, then test it yourself on staging by blocking their service, for example with a firewall rule. Time how long the page takes to fall back. A few seconds of waiting on every search during an outage costs more sales than the outage itself.
A 10-point site search audit
We recommend doing this every quarter, and again 6 weeks before your busiest trading period to allow time to make improvements. You should be able to complete this in an afternoon with two people: one to search and one to take notes. If you’d like a quicker test, try our site search test.
| Check | How to test | Owner |
|---|---|---|
| You know your zero-result share | Zero-result searches divided by all searches, last month | Ecommerce manager |
| Top 50 terms tested by hand | Search each one: would you buy from the first row? | Merchandiser |
| Synonyms cover top variants | Re-search your five commonest zero-result terms | Merchandiser |
| Help and brand searches redirect | Search “returns”, “delivery” and your top three brands | Ecommerce manager |
| Codes work | An exact code, a partial code, one without separators, a barcode | Trade or B2B lead |
| Dropdown shows categories and content | Type a category name and a help topic | Developer or agency |
| Mobile search tested | Search one-handed on a phone; is anything hidden by the keyboard? | Ecommerce manager |
| Keyboard access tested | Search and choose a result using only Tab, arrows and Enter | Developer or agency |
| Out-of-stock behaviour decided | Search a popular out-of-stock product | Ecommerce manager |
| Fallback tested | On staging, block the search service; does Magento search still work? | Developer or agency |
FAQ
Questions about Magento site search
Questions merchants ask us about search, answered.
Why does Magento search return no results for products we sell?
There are usually a few reasons. It could be a different word or spelling that Magento doesn’t know about, an attribute that isn’t searchable, or the product’s visibility and stock settings. Check your Search Terms report and try searching the term against your product’s attributes.
Which search fixes can we make without a developer?
Most of them. Synonym groups, search term redirects, which attributes are searched and their Search Weight, product names and how out-of-stock products are shown are all set in Magento admin. Stop words live in files per language, and testing the fallback needs a staging copy, so those two are jobs for your developer.
Can shoppers search by part number or barcode?
Magento finds exact SKUs; partial codes and barcodes depend on your setup. Ottla’s part-number search matches SKUs, part numbers and barcodes, including partial codes, once you choose the codes in Magento admin.
Why does a search for “XL” or a short code find nothing?
Magento ignores searches shorter than its Minimal Query Length, which is three characters by default. You can lower it under Stores → Configuration → Catalog → Catalog → Catalog Search, but Magento warns that a low limit can slow search down, so try it on a staging copy first.
Will a new search box slow the site down?
Ottla’s scripts load in the background without shifting the page, and every call has a short time limit with Magento’s own search as the fallback. Test any search tool on a staging copy before you go live.
Related reading
AI search and autocomplete
Search box that allows your shoppers to search as they type. Part number search for your trade customers and improved search relevance.
The Magento extension
Install, connect and switch features on from your Magento admin.
Synonyms and redirects
Step by step in the Ottla console.