Magento search is slow or returns the wrong products

Visitors who use search convert better than visitors who browse. Which makes it the worst place on the store to be slow, and the most common place to be wrong.

Diagnosis8 min read

Someone who types into your search box has already decided what they want. They are further down the funnel than anyone browsing a category, and they are less patient. If search takes three seconds or returns the wrong thing, you lose the visitor who was closest to buying.

Magento search runs on OpenSearch or Elasticsearch. That is a capable engine, and the problems we find are almost never the engine itself. They are in how it was set up, what was indexed into it, and what happens when it is not available.

When search is slow

Start by checking whether search is genuinely slow or whether the page around it is. Time the search request itself rather than the page load, because a fast query rendered into a heavy results page reads as slow search to the visitor but needs a completely different fix.

  • The engine is undersized. Search runs in memory. Give it too little and it spends its time swapping instead of answering.
  • The index is stale or rebuilding. A reindex during business hours makes every query slower while it runs.
  • It fell back to the database. If the engine is unreachable, some setups degrade to database queries. That works and it is dramatically slower on any real catalogue.

When search is fast but wrong

This is the more common complaint and it is not a performance problem at all, though it arrives in the same conversation. Relevance depends on what you told the engine to care about.

The attributes that are searchable, their weight, and whether synonyms are configured determine what comes back. A store selling technical products where the article number is not searchable will frustrate every professional buyer who knows exactly what they want.

  1. Check which attributes are marked as searchable. Article numbers, brand and material are the usual omissions.
  2. Check the search weight per attribute. Product name should outrank description, and often does not.
  3. Add synonyms for the words your customers use that your catalogue does not.
  4. Look at your internal search terms report. It is the cheapest customer research available and almost nobody reads it.

The report nobody opens

Magento logs what people searched for and how many results they got. Sort that by searches with zero results and you get a list of things customers wanted and did not find, in their own words.

Some of those are products you do not sell, which is useful. Most of them are products you do sell under a different name, which is a relevance problem you can fix this afternoon.