Fast Full-Text Search with Meilisearch Integration
Meilisearch Integration for Website Search
Note: when the number of records in a catalog exceeds 50,000, the standard LIKE '%query%' in PostgreSQL starts to lag. Query time grows, database load increases. We have run into this problem on multiple projects. The solution — Meilisearch: a full-text search engine built in Rust that responds faster than 50 ms even on millions of records. It supports typos, fuzzy search, faceted filtering, and autocomplete out of the box. Configuring Meilisearch involves index setup, ranking rules, and synchronization with the database. We offer turnkey Meilisearch integration: from infrastructure configuration to the UI component. Based on our estimates, this integration pays for itself in 2–3 months, with infrastructure cost savings of up to $5,000 per year. Typical project cost starts at $3,500. Get a consultation on integrating your project.
Meilisearch official documentation: "Meilisearch is an open-source, RESTful search engine built in Rust. It is designed to be fast, relevant, and easy to use."
Why Choose Meilisearch?
PostgreSQL built-in search becomes inefficient beyond 50,000 records. Meilisearch builds an inverted index separately, so queries bypass the main database. This reduces load and speeds up search by 10–20 times. Compare: a 200,000 product table queried via Meilisearch returns in 30–50 ms, while a SQL LIKE query can take 500 ms or more. Furthermore, Meilisearch fixes typos and supports faceted filtering out of the box — features that require additional configuration in Elasticsearch. Our Meilisearch integration service delivers average ROI of 300%. With over 5 years of experience and 50+ search integration projects, we guarantee stable performance under peak loads. Contact us to evaluate your project.
Integration Architecture
Browser → Backend API → Meilisearch HTTP API ↓ PostgreSQL (data source) Indexer (Queued Job / Cron) Meilisearch does not replace the main database. Data lives in PostgreSQL; only search-relevant information flows into Meilisearch. Synchronization is done via queues on record changes or periodic index rebuilds.
How to Set Up Synchronization?
- Install Meilisearch via Docker:
docker run -p 7700:7700 getmeili/meilisearch - Create an index with the required fields and set ranking rules.
- Connect Laravel Scout with the official Meilisearch driver. Example model:
use Laravel\Scout\Searchable; class Product extends Model { use Searchable; public function toSearchableArray(): array { return [ 'id' => $this->id, 'name' => $this->name, 'description' => strip_tags($this->description), 'brand' => $this->brand->name, 'category_id' => $this->category_id, 'price' => $this->price, 'in_stock' => $this->stock > 0, ]; } } - Run the initial indexing:
php artisan scout:import "App\Models\Product". - For search with filters, use:
$results = Product::search($query) ->where('in_stock', true) ->where('category_id', $categoryId) ->orderBy('price') ->paginate(20); Faceted Filtering
Meilisearch returns aggregations for facets in a single request. For example, to filter by category, brand, and availability, send a query with filter and facets parameters. The response contains a distribution for each facet, simplifying the construction of UI filters.
Direct Search from the Browser
Direct requests from JavaScript to Meilisearch are possible using a Search-only API Key – a key with limited permissions (only search against specific indexes). This reduces latency by eliminating an extra hop through the backend. Example: client.index('products').search(query, { filter: 'in_stock = true', limit: 10 }).
Case Study: E-commerce Store with 200,000 Products
In our practice, we worked with an electronics store client with a catalog of 200,000 SKUs. Initially, search ran via PostgreSQL LIKE, response time reached 800 ms, and database CPU load hit 70%. We set up Meilisearch: Docker on a separate server, synchronization via Laravel Scout with queues. After integration, search time dropped to 40 ms, database load decreased by 75%. Infrastructure cost savings amounted to $5,000 per year. The client reported improved UX and a 12% conversion rate increase. The project took 8 business days. Our Meilisearch integration for this client delivered fast full-text search with typo tolerance and faceted filtering.
What's Included in the Work
| Deliverable | Description |
|---|---|
| Search Audit | Analysis of current implementation, load testing |
| Infrastructure | Docker image, SSL setup, API key generation |
| Index Schema | Define attributes, ranking rules, facets |
| Backend Integration | Synchronization code via queues, search queries |
| UI Component | Responsive search with autocomplete and filters |
| Testing | Validation on real data, edge-case scenarios |
| Documentation | Architecture description, deployment instructions |
| Post-Launch Support | 2 weeks of maintenance |
Estimated Timeline
| Stage | Time |
|---|---|
| Infrastructure Setup | 1 day |
| Index Schema | 1 day |
| Backend Integration | 2–3 days |
| UI Search Component | 2–3 days |
| Testing and Deployment | 1 day |
Total: 7–9 business days for a typical catalog. Pricing is individual — contact us for a project evaluation.
Monitoring
Monitoring Metrics
Meilisearch exports metrics via `/metrics` in Prometheus format (when the option is enabled). Key indicators: index size, indexing task duration, queries per second. Task status is available via `/tasks`.We guarantee that search will remain fast even under concurrent requests from thousands of users. Experience shows that properly configured indexing reduces database load by 60–80%. Order Meilisearch integration for your site and get fast, relevant search. Contact us for a consultation and project evaluation.







