Magento

Improve Magento Search: Settings, Speed, Algolia and Meilisearch

Maria

8 min read

Site search is where shoppers with the clearest intent go: they know what they want and type it in. If Magento search returns nothing, the wrong products or a slow page, they leave. This guide shows how Magento 2 search works today, what you can improve in the admin without a developer, and when it's time for a different search engine.

homepage-concept-with-search-bar.webp

How Magento 2 search works

Magento 2.4 doesn't search the MySQL database directly. It sends products to a separate search engine and queries it for every search and every filtered category page. Current Magento 2.4 releases use OpenSearch by default; Elasticsearch support is being phased out.

When you change a product, Magento updates the search index through its indexers. Results are ranked by relevance: which attributes contain the search term, and how much weight each attribute has.

Magento search not working? Common causes

When search suddenly returns nothing or misses products you know are there, the cause is usually one of these:

  • The search engine is down or unreachable. Magento 2.4 can't search without OpenSearch (or Elasticsearch on older releases). Check that the service runs and that Magento's connection settings still point to it.
  • A version mismatch after an upgrade. Each Magento release supports specific search engine versions. An upgrade on one side without the other breaks indexing.
  • Indexers are invalid or cron doesn't run. The catalog search index isn't rebuilt, so new or changed products don't appear. Check Index Management and the cron jobs.
  • The product isn't visible in search. Its visibility is set to "Catalog" or "Not Visible Individually", it's disabled, or it isn't assigned to the website.
  • Out-of-stock products are hidden. If "Display Out of Stock Products" is off, products without stock disappear from results too.
  • The attribute isn't searchable. The shopper searches by a value, such as a part number or a color, that isn't marked "Use in Search".

Quick wins in the Magento admin

These need no code.

Check which attributes are searchable

In Stores > Attributes > Product, open each attribute and check Use in Search and Search Weight. Give the product name and SKU a high weight, and turn search off for attributes that only add noise.

Add synonyms

In Marketing > SEO & Search > Search Synonyms, group words your customers use differently: "sneakers" and "trainers", "sofa" and "couch". Each group can apply to all stores or to one store view.

Use search terms and redirects

In Marketing > SEO & Search > Search Terms, you see what customers search for, how often, and how many results they get. For popular queries, set a redirect URL to the right category or landing page.

Fix zero-result searches

Reports > Search Terms shows queries that return nothing. Each one is either a missing product, a missing synonym or a misspelling, and all three are cheap to fix.

Clean up product data

Search can only find what's in the data. Complete product names, attributes and descriptions, and consistent naming across the catalogue, improve results more than any extension.

Improve the search experience

  • Autocomplete with product suggestions as the shopper types, including images and prices.
  • Typo tolerance, so "iphnoe" still finds iPhone.
  • Filters on the search results page, the same as on category pages.
  • A visible search bar, especially on mobile, where it's often hidden behind an icon.
  • A useful "no results" page with popular categories and products instead of an empty screen.

Magento's default search covers the basics. Autocomplete with products, typo tolerance and good relevance on large catalogues usually need tuning or a different search engine.

Search merchandising

Search merchandising, sometimes called "searchandising", means deciding what shoppers see for a query, not only what matches it:

  • Boosting. Push in-stock products, best sellers or your own brand higher for broad queries.
  • Pinning. Put a specific product or category first for a popular query, such as a seasonal bestseller.
  • Burying. Push down discontinued or low-margin items without hiding them.
  • Banners and redirects. Show a promotion for "sale", or send "returns" straight to the returns page.

Magento's search terms and redirects cover the simplest cases. Hosted services such as Algolia include these tools; with OpenSearch or Meilisearch they're built as custom rules.

Search on mobile

Most shoppers search on a phone, where the search bar is often hidden behind an icon and suggestions are cramped. Make the search field visible at the top of the page, show product suggestions with images after two or three letters, keep filters one tap away on the results page, and make sure the keyboard doesn't cover the suggestions.

Search for B2B and complex catalogs

B2B buyers and parts customers search differently from consumers. They type part numbers, old numbers, dimensions and the model of the machine or vehicle a part fits. Default search handles exact words; it doesn't understand "6203 2RS" and "6203-2RS" as the same bearing.

What helps:

  • Normalized part numbers. Spaces, dashes and leading zeros removed when indexing and searching, so every spelling finds the same product.
  • All the numbers. Your SKU, the manufacturer's number, old and cross-reference numbers, all searchable.
  • Search by specification. Dimensions and technical attributes as filters on the results page.
  • Search by fit. A finder by vehicle, engine or machine model, alongside the text search.

On an engine parts store we built, buyers find parts by vehicle, engine or exact dimensions, using about 2 million compatibility links, and the store has handled about 200,000 part lookups. See the case study.

Search speed and server load

Every search and every filtered category page is a query to the search engine and to Magento. On a busy store this adds up: search competes with shoppers, bots and reindexing for the same server. Signs of trouble: search gets slow during campaigns, or the whole store slows down while products reindex.

Check that indexers run on "Update by schedule", that the search engine has enough memory, and that it runs on its own server on larger stores. A performance audit shows whether search is what slows your store down.

Other search engines for Magento

  • Tuning OpenSearch. Better analysers, synonyms and relevance rules on the engine Magento already uses.
  • Hosted search services. SaaS search with autocomplete, typo tolerance and merchandising built in, paid by usage.
  • Meilisearch. An open-source search engine with fast, typo-tolerant search, which you host yourself.

In a headless Magento store, search moves off Magento completely. In our headless setup, for example, Meilisearch handles site search and OpenSearch handles the catalogue and filters, with search falling back to OpenSearch if Meilisearch is down.

Algolia

Algolia is a hosted search service with fast autocomplete, typo tolerance and merchandising tools. A few years ago it was mostly installed by enterprise stores; today it's common on mid-sized stores too. We install the Magento plugin and almost always add customization on top, because the standard setup rarely covers everything: customer group prices that must show correctly in results, stock and availability rules, or business data that should affect ranking, such as margins, brands or a client's own priorities.

A separate search service next to the store

Search doesn't have to live inside Magento. For a long-standing client on a custom Magento 1 store, we replaced the store search with a separate service running next to the store. It now handles typos, answers much faster, adds almost no load to the site, and searches the blog too, which the old search couldn't. The same approach works for Magento 2 stores that want better search without changing the front-end.

Comparing the options

Magento default (OpenSearch) Tuned OpenSearch Meilisearch Algolia
Cost Included Development time Self-hosted, development time Subscription, grows with usage
Typo tolerance Basic Configurable Built in Built in
Autocomplete with products Basic Custom Custom front-end Built in
Merchandising tools Limited Custom Custom Built in
Where data lives Your server Your server Your server Algolia's cloud
Fits when Small catalog, simple needs You want control and no subscription Fast, typo-tolerant search on your own server You want features fast and accept a monthly fee

Before changing anything, measure what search does today, so you can see the effect:

  • Share of sessions with a search, and conversion of those sessions compared to the rest
  • Zero-result searches, as a share of all searches, and the top queries among them
  • Search exits: shoppers who leave right after the results page
  • Clicks on results: which positions people click, and how often they refine the query
  • Search speed: response time of search requests, especially during campaigns

Magento's Search Terms report covers the first two. Analytics tools such as GA4 or PostHog cover the rest, if search events are tracked.

Why can't Magento find a product by its part number?

Usually because the number isn't a searchable attribute, or because shoppers type it with spaces or dashes the index doesn't expect. Make the attribute searchable and normalize part numbers when indexing.

Is Algolia worth it for Magento?

If your catalog is large, search drives a big share of sales and you want autocomplete and merchandising without building them, often yes. Budget for the subscription and for customization, because the standard plugin rarely covers B2B prices or custom ranking rules.

Why does Magento search return irrelevant results?

Usually because too many attributes are searchable with the same weight, or because product data is incomplete. Start with Use in Search and Search Weight.

Can Magento search handle typos?

OpenSearch supports fuzzy matching, but out of the box it's limited. Better typo tolerance needs tuning or a search engine built for it.

Do we need Elasticsearch or OpenSearch?

Yes. Magento 2.4 needs a search engine, and current releases use OpenSearch. Check the versions supported by your Magento release before an upgrade.

Does better search increase sales?

Shoppers who search usually know what they want, so every failed search is a likely lost sale. Measure it: track searches, zero-result searches and conversion from search before and after changes.

Search returns the wrong products, nothing, or takes too long? SYSINT has worked with Magento since 2014. We tune Magento search, set up and customize Algolia or Meilisearch, and fix the performance problems behind slow search. See our Magento development and Magento support services.

Are we a good fit? Let's discuss.

Tell us about your store and what you want to get done. If we're a fit, you get a clear next step. If not, we'll tell you.

  • Reply within one business day
  • Fixed estimate before we start
  • No commitment