How To Improve Craft CMS Search Results
Craft's built-in search is better than most owners realise. Here's how we tune it with fuzzy matching, selective indexing, curated synonyms... and when it's time step it up a gear.
"Search doesn't find the thing I know is on the site."
It's one of the most common complaints we hear about a site that's otherwise working well — and one of the most fixable.
We build and maintain a good number of Craft sites, and search comes up on nearly all of them.
The good news is Craft's built-in search is more capable than most people realise, and a few deliberate changes and smart design, you can usually solve the problem without any new software. But also, when you do need to step it up a gear, Craft is capable of doing just that with integrations with other services.
Let's go through it...
First, understand why search misses things
Out of the box, Craft matches whole words. Search for "photograph" and an entry that only says "photography" won't come back, because those are different words. And computers have this annoying habit of being VERY literal.
Most "broken search" is really this: the content is there, but the way it's being matched is too strict, or the right field isn't being searched at all.
Here are a few ways to improve search:
1. Turn on fuzzy (partial-word) matching
By default Craft matches from the start of a whole word. You can loosen that so a search matches text inside words too — so "photograph" finds "photography", and a partial code finds the full one.
It's a one-time setting your developer adds to Craft's config:
// config/general.php
'defaultSearchTermOptions' => [
'subLeft' => true,
'subRight' => true,
],subRight lets a term match characters that come after it (the common, safe one); subLeft matches characters before it too, which is what catches things like part numbers buried in the middle of a value.
There's a catch: subLeft in particular stops the database using its index efficiently, so on a very large site it can slow searches down. On the vast majority of marketing sites you'll never notice, but it's a reason not to switch everything on blindly, and a reason big catalogues eventually move to a dedicated service (more on that below).
2. Be selective about what you index
Your instinct may be to make most fields searchable, and that quietly works against you. Every field you index becomes part of what search has to weigh up. This slows things down and can skew results.
In the field layout for each section, you can mark individual fields as searchable or not with the "Use this field's values as search keywords" toggle. The rule of thumb we use: index the fields a visitor would search by — titles, summaries, body copy, product names, key attributes, and leave out the rest.
A leaner index gives sharper, more relevant results, and it's usually the single change that makes the biggest difference.
3. Add a curated "Synonyms" field
This is the low-tech move that punches above its weight, and it's one editors really like because they can correct things very quickly.
Simply add a plain text field to your entries and call it "Search keywords" or "Synonyms", or similar and mark it as searchable. Let editors fill it with the alternate terms real people actually type: informal names, common misspellings, old product codes, regional words, abbreviations. A page about a "car park" can quietly carry "parking, garage, multi-storey"; a product can carry the names customers use rather than the ones marketing chose.
Because the field is indexed like any other, those terms surface the entry without cluttering the page a visitor sees.
AI can really help this, too. A developer could wire the field to populate itself when an editor saves an entry: Craft hands the page's title and body to a language model, which suggests a handful of synonyms, related terms, and likely misspellings, and drops them into the field. You could even use a hybrid where the editor has a field for ones they specifically want, and the AI has a field of general synonyms - so they don't get overwritten.
The editor reviews and trims rather than starting from a blank box, and an AI model will often catch terms a person wouldn't think of, like the informal name customers use or a spelling nobody on the team would make but plenty of visitors do. For international sites, UK vs US English might be relevant too.
4. Order results by relevance
If your results feel random, check how they're being sorted. Craft can rank matches by how well they score against the search term rather than by date or title, so the closest match comes first. It's the default, but it's not uncommon to see it changed at some point over the website's lifespan and setting it back to score is a small change but it's often the difference between search that feels helpful and search that feels like a list.
When you've outgrown built-in search
The four changes above resolve many search problems for smaller sites. But there's a point where native search starts fighting you, and it's worth recognising the signs rather than throwing more config at it:
- Typos need to "just work." Native search has no real typo tolerance — "adress" finds nothing. If your audience expects Google-grade forgiveness, that's a hard limit.
- You want results as you type. Instant, drop-down results (the experience people now expect) are awkward to build well on native search and can add a lot of load to your database.
- You need faceted filtering. Filtering results live by category, price, brand, date — at speed, across thousands of entries. Craft can do it, but again it's probably doing some pretty heavy lifting that a dedicated search engine wouldn't break a sweat over.
- Scale. Tens of thousands of entries, or the partial-matching settings above starting to drag.
- Ranking control. You want to boost certain content, or weight a title match above a body match, with precision.
If you're nodding at three or more of these, I would say that you've outgrown the built-in engine. That's not a failing of Craft, it's just outgrowing one of its features and the good news is you can now swap it for something better.
Moving to a search service like Algolia
A hosted search service takes over the hard parts like typo tolerance, instant "as-you-type" results, relevance tuning, faceting, and making it fast. Algolia is one of the best known services, and one we favour. Your content is mirrored into their index, and search queries go to them instead of your database.
The Scout plugin is a good bridge between Craft and Algolia. It watches your entries and keeps the Algolia index in sync automatically as content is saved, updated, or deleted, so the search index never drifts from what's actually on the site. You define which fields go into the index and Scout handles the rest.
Algolia isn't the only option. If you'd rather keep everything on your own infrastructure — for cost or data-residency reasons — Meilisearch and Typesense are open-source engines with the same instant-search, typo-tolerant feel, and there are Craft plugins to sync content into both.
It comes at a cost, though: a hosted service is a recurring bill and another moving part to keep in sync and maintain. It's the right call when search is core to how people use your site — a large catalogue, a big content archive, a directory. It's overkill for a twenty-page brochure site, where the built-in tuning above will serve you well for years.
Where to start
You may not need an Algolia style service. You might just need the first three changes above: partial matching on, a tidy index, and a synonyms field your editors can own. I would always recommend starting there, live with it for a few weeks, and only reach for a search service if the site truly demands it. If you can get away with a minimalist system, it's always better to do so.
But if your Craft site's search isn't pulling its weight and you'd like a second opinion, we can help. It's the kind of thing we tune as part of looking after the sites we maintain. Drop us a line at hello@mutual.agency.
Sources
Andrew is Technical Director at Mutual, a Craft CMS Partner agency. He has been building with Craft CMS since its public beta in 2012 — working through every major version from Craft 1 to Craft 5 — and has delivered over 100 sites for clients including Apple, Transparency International, and Arts University Bournemouth.
He writes about Craft CMS on the Mutual blog and has contributed to net Magazine. At Mutual, he leads development of Mutual One, a marketing platform built on Craft CMS as its foundation.
He has spoken about Craft CMS to undergraduate students at the University of Brighton and Canterbury Christ Church University, and appeared on the Devmode.fm podcast. He has also trained development teams at other agencies in working with the platform.