Overview
Meilisearch is an open-source, developer-centric search engine engineered for integrating real-time search capabilities into web and mobile applications. It distinguishes itself through its focus on speed, relevance, and a streamlined developer experience. Unlike broader data stores or log aggregators, Meilisearch is purpose-built for full-text search, prioritizing low-latency query responses and intuitive setup.
The core of Meilisearch functionality revolves around its search API, which allows developers to index documents and perform queries with features like typo tolerance, custom ranking rules, and faceted search. It automatically handles many complex search considerations, such as tokenization and stemming, to provide relevant results out-of-the-box. Developers can deploy Meilisearch either as a self-hosted instance, offering full control over the infrastructure, or utilize the Meilisearch Cloud for a managed service experience. Its architecture is designed for ease of integration, offering client SDKs in multiple programming languages including JavaScript, Python, PHP, and Ruby, simplifying the process of embedding search directly into applications.
Meilisearch is particularly well-suited for projects requiring a search solution with minimal operational overhead and high customization potential for search relevance. Its open-source nature fosters community contributions and allows for transparency in its development and features. Use cases range from e-commerce product search and documentation search to internal knowledge bases and content discovery platforms. The engine provides granular control over ranking factors, enabling developers to fine-tune search results to match specific business logic or user preferences. For instance, a developer can prioritize newer documents or items with higher ratings in search results, contributing to a more tailored user experience.
While Meilisearch provides a powerful search layer, it is not a complete database solution. It is designed to work alongside existing data stores, indexing relevant data for search purposes rather than storing primary application data. This separation of concerns allows applications to leverage specialized databases for their core data management while offloading search complexities to Meilisearch. Its RESTful API design further ensures that it can be integrated with virtually any tech stack, making it a flexible choice for modern application development. The platform's emphasis on performance means that search results are typically returned in milliseconds, enhancing the responsiveness of applications where search is a critical component.
Key features
- Full-Text Search: Provides fast and accurate search across large datasets with built-in typo tolerance and language-agnostic tokenization.
- Typo Tolerance: Automatically corrects common typing errors, ensuring users find relevant results even with misspellings.
- Custom Ranking: Allows developers to define specific ranking rules based on attributes like popularity, price, or recency to influence search result order.
- Faceted Search: Supports filtering and navigation of search results by categories or attributes, enhancing the discovery experience.
- Filtering & Sorting: Enables precise control over search results through custom filters and sorting options for specific fields.
- RESTful API: Offers a straightforward API for indexing data and performing queries, compatible with any programming language or framework.
- Multi-Tenant Search: Supports isolating search indexes for different users or organizations within a single Meilisearch instance, ensuring data privacy.
- SDKs & Integrations: Provides official client SDKs for JavaScript, Python, PHP, Ruby, Go, Java, C#, Dart, and Rust, simplifying integration into applications.
- Open-Source: The core engine is open-source, offering transparency and flexibility for self-hosting and community contributions.
- Meilisearch Cloud: Offers a managed service option for deployment, scaling, and maintenance, reducing operational overhead.
Pricing
Meilisearch offers a free developer tier and various paid plans for its cloud service, with self-hosting being free with community support.
| Plan | Documents | Search Requests | Features | Price/Month |
|---|---|---|---|---|
| Developer | 10,000 | 50,000 | Typo tolerance, custom ranking, filtering, sorting, basic support | Free |
| Starter | 100,000 | 500,000 | All Developer features, priority support | $29 |
| Growth | 500,000 | 2,500,000 | All Starter features, advanced analytics, dedicated resources | $99 |
| Business | 1,000,000+ | 5,000,000+ | All Growth features, enterprise-grade SLA, custom pricing | Custom |
For detailed and up-to-date pricing information, refer to the official Meilisearch pricing page.
Common integrations
- Front-end Frameworks: Integrates with React, Vue, Angular, and Svelte via client-side SDKs to power real-time search UIs.
- Back-end Frameworks: Can be integrated with Node.js (Express), Ruby on Rails, Django, Laravel and more, using server-side SDKs to manage indexes and perform queries.
- Databases: Works in conjunction with PostgreSQL, MySQL, MongoDB, and others by indexing data from these sources into Meilisearch for search functionality.
- E-commerce Platforms: Used for product search in platforms built with Shopify, WooCommerce, or custom solutions, enhancing product discovery.
- CMS Platforms: Can power search for content in headless CMS systems like Strapi, Contentful, or WordPress (via custom integrations).
Alternatives
- Algolia: A hosted search API known for its speed and developer tools, often used for production-grade search experiences.
- Elasticsearch: A distributed, RESTful search and analytics engine capable of handling large volumes of data for complex search and logging use cases.
- Typesense: An open-source, fast, typo-tolerant search engine designed for building instant search experiences.
Getting started
To get started with Meilisearch, you can either run it locally or use the Meilisearch Cloud. Here's an example using Node.js to add documents and perform a search query.
First, install the Meilisearch JavaScript client:
npm install meilisearch
Then, initialize the client and perform operations:
import { MeiliSearch } from 'meilisearch'
// Initialize the client
const client = new MeiliSearch({
host: 'http://localhost:7700', // Replace with your Meilisearch instance URL
apiKey: 'aSecretMasterKey', // Replace with your master key if Meilisearch is protected
})
const movies = [
{ id: 1, title: 'The Shawshank Redemption', genres: ['Drama'] },
{ id: 2, title: 'The Dark Knight', genres: ['Action', 'Crime'] },
{ id: 3, title: 'Pulp Fiction', genres: ['Crime', 'Drama'] },
{ id: 4, title: 'The Lord of the Rings: The Return of the King', genres: ['Fantasy', 'Adventure'] },
]
async function setupMeilisearch() {
try {
// Create an index if it doesn't exist
const index = client.index('movies')
// Add documents to the index
let addDocTask = await index.addDocuments(movies)
await client.waitForTask(addDocTask.taskUid)
console.log('Documents added:', movies.length)
// Search for movies containing "dark"
let searchResults = await index.search('dark')
console.log('Search results for "dark":', searchResults.hits)
// Search for movies with "drama" genre
searchResults = await index.search('drama', {
filter: ['genres = Drama']
})
console.log('Search results for "drama" genre:', searchResults.hits)
} catch (error) {
console.error('Meilisearch operation failed:', error)
}
}
setupMeilisearch()
Ensure your Meilisearch instance is running (e.g., via Docker or a local binary) before executing this code. For comprehensive setup instructions and API details, consult the Meilisearch documentation.