Contents
Most apps need search before they need scale. You're building a project management tool, a client portal, an inventory system — and users need to find things fast. The temptation is to reach for Algolia or Elasticsearch on day one because that's what the big players use.
Here's the honest version: you probably don't need that yet. And starting there adds cost, operational complexity, and an external dependency before you've even validated your product. Laravel Scout with TNTSearch is what I reach for first, and it's held up well past the point where most clients expected to need something more.
What Scout Actually Is
Laravel Scout is an abstraction layer. You add it to any Eloquent model, define what's searchable, and get a clean search() method. The underlying engine — Algolia, Meilisearch, TNTSearch, or others — is swappable.
That last part is what makes starting with TNTSearch smart. You get real full-text search now, with no external service to manage and no monthly bill. When you need to scale, you swap the driver and keep everything else.
Getting started takes about five minutes:
composer require laravel/scout
composer require teamtnt/laravel-scout-tntsearch-driver
php artisan vendor:publish --provider="Laravel\Scout\ScoutServiceProvider"
Set your driver in .env:
SCOUT_DRIVER=tntsearch
Then add the Searchable trait to any model and define what to index:
use Laravel\Scout\Searchable;
class Product extends Model
{
use Searchable;
public function toSearchableArray(): array
{
return [
'name' => $this->name,
'description' => $this->description,
'sku' => $this->sku,
];
}
}
Build the index once:
php artisan scout:import "App\Models\Product"
Now search anywhere in your app:
$results = Product::search('blue running shoes')->get();
That's it. No API keys. No external service. Runs on your existing server.
What TNTSearch Is Actually Good At
TNTSearch is a PHP-based full-text search engine that stores its index as a local SQLite file. It supports fuzzy matching, which means a user typing "runing shoes" still finds "running shoes." It handles partial word matches. It ranks results by relevance.
For catalogs up to a few hundred thousand records, it's fast enough that you won't notice the difference from Algolia in production. I've run it comfortably on mid-size e-commerce catalogs and internal content libraries.
What it doesn't do well: real-time index updates at high write volume, geographic search, and extremely complex relevance tuning. Those are the things that eventually push you toward a dedicated search service. Most apps never get there.
Keeping the Index Fresh
Records need to be re-indexed when they change. Scout handles this automatically when you use Eloquent:
$product->update(['name' => 'Blue Trail Running Shoes']);
// Scout fires an observer and updates the index automatically
For bulk imports or data migrations, you re-index manually:
php artisan scout:import "App\Models\Product"
If you're queueing Scout operations — which you should in production — add SCOUT_QUEUE=true to your .env and let background workers handle index updates without slowing down your request cycle.
The Migration Path When You Need It
This is the part worth emphasizing. If you outgrow TNTSearch, switching to Algolia or Meilisearch is a driver swap, not a rewrite.
Change your .env:
SCOUT_DRIVER=algolia
ALGOLIA_APP_ID=your-app-id
ALGOLIA_SECRET=your-secret
Run the import again to populate the new index. Your Product::search() calls don't change. Your controllers don't change. Your tests don't change.
You've bought yourself months of zero search infrastructure cost, and the migration when you need it is a genuine afternoon of work rather than a significant project.
When to Skip Ahead
There are cases where starting with a hosted service makes sense. If you know from day one that you need geographic search, typo-tolerance at scale, or multi-language relevance ranking across millions of records — start with Meilisearch or Algolia. The cost is worth it.
But if you're building an MVP, a client portal, or a product you're still validating, starting with the free option and migrating later is almost always the right call. Save the infrastructure budget for problems you've actually encountered.
Scout makes this tradeoff almost free. The abstraction is the entire point.
If you're building search into a Laravel application and want to get it right from the start, let's talk.