Deploy and Use Meilisearch for Lightning‑Fast Full‑Text Search
This guide walks through installing Meilisearch via Docker, creating indexes, configuring settings, managing documents, and performing instant, sortable, and filtered searches using its RESTful API, while highlighting its speed, low hardware requirements, and multilingual support.
Introduction
Meilisearch is a lightweight, fast full‑text search engine that delivers sub‑50 ms response times and runs on modest hardware, offering an alternative to Elasticsearch.
Key Features
Search results returned in under 50 ms
Instant search as you type
Smart typo‑tolerance
Optimized support for Chinese and other languages
Highly customizable indexing and search behavior
RESTful HTTP API
Official SDKs for Java, JavaScript, Go, Python, and more
Installation
Deploy Meilisearch with Docker:
docker pull getmeili/meilisearch:v1.13 docker run -p 7700:7700 --name meilisearch \
-e MEILI_ENV='development' \
-v /mydata/meiliData:/meili_data \
-d getmeili/meilisearch:v1.13After the container starts, the API is reachable at http://<host>:7700.
Index Operations
Import a demo dataset (e.g., movies.json) into a new index:
curl -X POST '{{MEILISEARCH_URL}}/indexes/movies/documents?primaryKey=id' \
-H 'Content-Type: application/json' \
--data-binary @movies.jsonList all indexes: curl -X GET '{{MEILISEARCH_URL}}/indexes' Delete an index:
curl -X DELETE '{{MEILISEARCH_URL}}/indexes/movies'Settings Operations
Retrieve current settings for an index:
curl -X GET '{{MEILISEARCH_URL}}/indexes/movies/settings'Make title and release_date sortable, and genres and release_date filterable:
curl -X PATCH '{{MEILISEARCH_URL}}/indexes/movies/settings' \
-H 'Content-Type: application/json' \
--data-binary '{
"sortableAttributes": ["title", "release_date"],
"filterableAttributes": ["genres", "release_date"]
}'Document Operations
Add a document:
curl -X POST '{{MEILISEARCH_URL}}/indexes/movies/documents' \
-H 'Content-Type: application/json' \
--data-binary '{
"id": 1,
"title": "Transformers Test",
"overview": "Young teenager, Sam Witwicky becomes involved in the ancient struggle between two extraterrestrial factions of transforming robots...",
"genres": ["Adventure", "Science Fiction", "Action"],
"poster": "https://image.tmdb.org/t/p/w500/6eehp9I54syN3x753XMqjKz8M3F.jpg",
"release_date": 1182902400
}'Retrieve a document:
curl -X GET '{{MEILISEARCH_URL}}/indexes/movies/documents/1'Update a document (partial update):
curl -X PUT '{{MEILISEARCH_URL}}/indexes/movies/documents' \
-H 'Content-Type: application/json' \
--data-binary '[{"id":1,"title":"Transformers Update"}]'Delete a document:
curl -X DELETE '{{MEILISEARCH_URL}}/indexes/movies/documents/1'Search Queries
Simple search:
curl -X POST '{{MEILISEARCH_URL}}/indexes/movies/search' \
-H 'Content-Type: application/json' \
--data-binary '{ "q": "Transformers" }'Paginated search (first 5 results):
curl -X POST '{{MEILISEARCH_URL}}/indexes/movies/search' \
-H 'Content-Type: application/json' \
--data-binary '{ "q": "Transformers", "offset": 0, "limit": 5 }'Sorted search (by release date descending):
curl -X POST '{{MEILISEARCH_URL}}/indexes/movies/search' \
-H 'Content-Type: application/json' \
--data-binary '{ "q": "Transformers", "offset": 0, "limit": 5, "sort": ["release_date:desc"] }'Filtered search (Action or Adventure genres):
curl -X POST '{{MEILISEARCH_URL}}/indexes/movies/search' \
-H 'Content-Type: application/json' \
--data-binary '{ "q": "Transformers", "offset": 0, "limit": 5, "sort": ["release_date:desc"], "filter": "genres = Action OR genres = Adventure" }'Repository
Official source code:
https://github.com/meilisearch/meilisearchSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Su San Talks Tech
Su San, former staff at several leading tech companies, is a top creator on Juejin and a premium creator on CSDN, and runs the free coding practice site www.susan.net.cn.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
