The Search Engine That Feels Like Magic

The Search Engine That Feels Like Magic Picture this: You’re browsing your favorite store online, looking for a specific pair of sneakers. You remember they were called something like “Blaze Runner” You type in “Blaz”, and boom, the site instantly suggests the exact pair you had in mind. Fast, accurate, effortless. Feels magical, right? That’s the kind of experience users expect everywhere today, whether they’re shopping, streaming, or searching inside apps. If a product’s search is slow or inaccurate, people don’t wait around. They bounce. Building that kind of lightning-fast, smart search experience used to be complicated and expensive. Big companies like Netflix and Amazon built their own search engines. Everyone else had to either shell out for costly, closed platforms or wrestle with heavyweight tools not built for the modern web. That’s where Meilisearch comes in. What Is Meilisearch? Meilisearch is an open-source search engine that’s designed to be incredibly fast, flexible, and easy for developers to use. Whether you’re building a web app, a mobile app, or an internal tool, Meilisearch lets you add amazing search experiences without the headache. Lightning speed: Typing just a few characters instantly returns results. Typo-tolerant: Even if users make mistakes, they still find what they need. Customizable: You can tweak rankings, synonyms, filtering, and more. Easy setup: You can have Meilisearch running in minutes. In short, it gives you the search power you expect from huge companies — without needing a giant team of engineers. What Makes Meilisearch Special? 1. Built with Rust Meilisearch is built in Rust — a language famous for its speed, safety, and efficiency. Rust lets Meilisearch run faster with fewer resources, making it perfect for today’s "edge computing" world where apps live closer to users. Translation? Lower costs, faster search, and happier users. 2. Open Source at Its Core Unlike some search engines that lock you into pricey plans, Meilisearch is open source. You can deploy it yourself, customize it freely, and actually own your search stack. Open source also means a vibrant community: thousands of developers contribute, build plugins, and share knowledge. (And yes, it’s one of the fastest-growing GitHub projects out there.) 3. Developer-First Meilisearch isn’t trying to upsell you on enterprise plans every five minutes. It’s made for builders — clear APIs, simple onboarding, and honest documentation. It just works — and lets you focus on your product, not your infrastructure. Getting Started with Meilisearch and Node.js Prerequisites Before starting, make sure you have: Node.js installed on your computer. A Node.js project. ### Setting up Meilisearch Cloud Go to Meilisearch Cloud or selfhost it, create an account or log in, and confirm your email. Click Create a project. Enter a project name (e.g., book-app) and select your preferred region. Once created, go to Settings to find: Your project URL (for API access) API keys: Master Key — full access, use only in a protected environment. Default Search API Key — for client-side search. Default Admin API Key — full access except for key management. Indexing Data Creating an Index and Adding Documents In the navigation, go to Indexes → Create an index. Provide an index name (e.g., books). Choose to import a JSON file with your documents. Every document must have a primary key (like an id field). If missing, the import will fail. Example JSON import: 13 book entries from the Google Books API. Updating and Deleting Documents Since Meilisearch Cloud doesn’t provide UI options for update/delete, you’ll use the REST API or SDKs. Update Documents curl -X PUT 'https:///indexes/books/documents' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ --data-binary '[ { "id": "71nDBQAAQBAJ", "title": "JavaScript Coding for Kids", "publisher": "No Starch Press" } ]' Make sure to include the primary key (id) for updates. Fields not specified remain unchanged. Delete Documents Delete a specific document: curl -X DELETE 'https:///indexes/books/documents/71nDBQAAQBAJ' \ -H 'Authorization: Bearer ' Other routes: /indexes/{index_uid}/documents — delete all documents. /indexes/{index_uid}/documents/delete-batch — delete a batch. Adding Meilisearch to a Node.js Project Clone the starter project: git clone https://github.com/Tammibriggs/meilisearch-app.git cd meilisearch-app npm install Run the app: npm start Visit http://localhost:3000/ — you’ll see a basic search app. Install the required packages: npm install meilisearch dotenv Create a .env file in the root: YOUR_PROJECT_URL= '' YOUR_SEARCH_API_KEY= '' Update server.js to use Meilisearch

Apr 28, 2025 - 19:15
 0
The Search Engine That Feels Like Magic

The Search Engine That Feels Like Magic

Picture this:

You’re browsing your favorite store online, looking for a specific pair of sneakers.

You remember they were called something like “Blaze Runner” You type in “Blaz”, and boom, the site instantly suggests the exact pair you had in mind.

Fast, accurate, effortless.

Feels magical, right?

That’s the kind of experience users expect everywhere today, whether they’re shopping, streaming, or searching inside apps.

If a product’s search is slow or inaccurate, people don’t wait around.

They bounce.

Building that kind of lightning-fast, smart search experience used to be complicated and expensive.

Big companies like Netflix and Amazon built their own search engines.

Everyone else had to either shell out for costly, closed platforms or wrestle with heavyweight tools not built for the modern web.

That’s where Meilisearch comes in.

What Is Meilisearch?

Meilisearch is an open-source search engine that’s designed to be incredibly fast, flexible, and easy for developers to use.

Whether you’re building a web app, a mobile app, or an internal tool, Meilisearch lets you add amazing search experiences without the headache.

  • Lightning speed: Typing just a few characters instantly returns results.
  • Typo-tolerant: Even if users make mistakes, they still find what they need.
  • Customizable: You can tweak rankings, synonyms, filtering, and more.
  • Easy setup: You can have Meilisearch running in minutes.

In short, it gives you the search power you expect from huge companies — without needing a giant team of engineers.

What Makes Meilisearch Special?

1. Built with Rust

Meilisearch is built in Rust — a language famous for its speed, safety, and efficiency.

Rust lets Meilisearch run faster with fewer resources, making it perfect for today’s "edge computing" world where apps live closer to users.

Translation?

Lower costs, faster search, and happier users.

2. Open Source at Its Core

Unlike some search engines that lock you into pricey plans, Meilisearch is open source.

You can deploy it yourself, customize it freely, and actually own your search stack.

Open source also means a vibrant community: thousands of developers contribute, build plugins, and share knowledge.

(And yes, it’s one of the fastest-growing GitHub projects out there.)

3. Developer-First

Meilisearch isn’t trying to upsell you on enterprise plans every five minutes.

It’s made for builders — clear APIs, simple onboarding, and honest documentation.

It just works — and lets you focus on your product, not your infrastructure.

Getting Started with Meilisearch and Node.js

Prerequisites

Before starting, make sure you have:

  • Node.js installed on your computer.
  • A Node.js project. ### Setting up Meilisearch Cloud
  1. Go to Meilisearch Cloud or selfhost it, create an account or log in, and confirm your email.
  2. Click Create a project.
  3. Enter a project name (e.g., book-app) and select your preferred region.
  4. Once created, go to Settings to find:
    • Your project URL (for API access)
    • API keys:
      • Master Key — full access, use only in a protected environment.
      • Default Search API Key — for client-side search.
      • Default Admin API Key — full access except for key management.

Indexing Data

Creating an Index and Adding Documents

  1. In the navigation, go to IndexesCreate an index.
  2. Provide an index name (e.g., books).
  3. Choose to import a JSON file with your documents.
  4. Every document must have a primary key (like an id field). If missing, the import will fail.

Example JSON import: 13 book entries from the Google Books API.

Updating and Deleting Documents

Since Meilisearch Cloud doesn’t provide UI options for update/delete, you’ll use the REST API or SDKs.

Update Documents
curl -X PUT 'https:///indexes/books/documents' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer ' \
--data-binary '[
  {
    "id": "71nDBQAAQBAJ",
    "title": "JavaScript Coding for Kids",
    "publisher": "No Starch Press"
  }
]'
  • Make sure to include the primary key (id) for updates.
  • Fields not specified remain unchanged.
Delete Documents
  • Delete a specific document:
curl -X DELETE 'https:///indexes/books/documents/71nDBQAAQBAJ' \
-H 'Authorization: Bearer '
  • Other routes:
    • /indexes/{index_uid}/documents — delete all documents.
    • /indexes/{index_uid}/documents/delete-batch — delete a batch.

Adding Meilisearch to a Node.js Project

  1. Clone the starter project:
git clone https://github.com/Tammibriggs/meilisearch-app.git
cd meilisearch-app
npm install
  1. Run the app:
npm start

Visit http://localhost:3000/ — you’ll see a basic search app.

  1. Install the required packages:
npm install meilisearch dotenv
  1. Create a .env file in the root:
YOUR_PROJECT_URL= ''
YOUR_SEARCH_API_KEY= ''
  1. Update server.js to use Meilisearch:
import express from 'express';
import { MeiliSearch } from 'meilisearch';
import dotenv from 'dotenv';

dotenv.config();

const app = express();
const PORT = process.env.PORT || 3000;

app.set('view engine', 'ejs');
app.use(express.static('public'));

app.get('/', async (req, res) => {
    const searchValue = req.query.search;
    const client = new MeiliSearch({
        host: process.env.YOUR_PROJECT_URL,
        apiKey: process.env.YOUR_SEARCH_API_KEY,
    });
    const index = client.index('books');
    const searchResults = !!searchValue && (await index.search(searchValue));

    res.render('index', {
        books: searchResults ? searchResults.hits : [],
        searchValue,
    });
});

app.listen(PORT, () => {
    console.log(`Listening at http://localhost:${PORT}`);
});

Now, when you search through the form on the webpage, it can fetch real search results from your Meilisearch project.

Final Thoughts

The search bar might seem small, but it’s one of the most powerful parts of any app or website.

Done right, it feels invisible — users get exactly what they need without even thinking about it.

Done wrong, and users leave.

Meilisearch helps you get it right.

Fast, flexible, open, and built for the future — it’s everything a modern search experience should be.

If you’re building something where search matters (and these days, that's basically everything), it might just be the smartest tool you didn’t know you needed.

I’ve been actively working on a super-convenient tool called LiveAPI.

LiveAPI helps you get all your backend APIs documented in a few minutes

With LiveAPI, you can quickly generate interactive API documentation that allows users to execute APIs directly from the browser.

Image description

If you’re tired of manually creating docs for your APIs, this tool might just make your life easier.