Registry / http-networking / meilisearch

meilisearch

JSON →
library0.43.0pypypi✓ verified 26d ago

Official Python client for Meilisearch — open source typo-tolerant search engine. Current version: 0.40.0 (Jan 2026). Still pre-1.0. Official 'meilisearch' package is SYNC ONLY. For async use the community 'meilisearch-python-sdk' package instead. Two different packages, two different imports. add_documents() is non-blocking — returns a Task object, not a confirmation. Must poll task status to confirm indexing completed. Compatible with Meilisearch server v1.2+.

pip install meilisearch
INSTALL
IMPORT
SIG · MEILISEARCH
M
meilisearch
http-networkingpythonv0.43.0
Install
4.7s avg
Import
760ms
Disk
59MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.43.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.778s · 88MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 4.7s · import 0.742s · 31MB
59MB installed
● package 59MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Client
from meilisearch import Client
import meilisearch

Meilisearch Python client — indexing, waiting for task, and search.

# pip install meilisearch import meilisearch import time client = meilisearch.Client('http://127.0.0.1:7700', 'masterKey') index = client.index('products') # Add documents (non-blocking) task = index.add_documents([ {'id': '1', 'name': 'Widget', 'price': 9.99}, {'id': '2', 'name': 'Gadget', 'price': 24.99}, ]) # Wait for indexing (dev only — use task polling in production) client.wait_for_task(task.task_uid) # Configure filterable attributes (triggers re-index) index.update_filterable_attributes(['price']) # Search result = index.search('widget') for hit in result['hits']: print(hit['name']) # Search with filter result = index.search('', {'filter': 'price < 15'}) print(result['hits'])
Debug
Known issues
breakingOfficial 'meilisearch' package is sync-only. No async support. For FastAPI/asyncio use 'meilisearch-python-sdk' (community package) which provides AsyncClient.
fix
pip install meilisearch-python-sdk; from meilisearch_python_sdk import AsyncClient
affects: all
gotchaadd_documents() is non-blocking — returns a Task object with task_uid. Documents are NOT immediately searchable. Searching immediately after add_documents may return empty results.
fix
Call client.wait_for_task(task.task_uid) after indexing to wait for completion. In production use task polling instead.
affects: all
gotchaUpdating filterableAttributes or sortableAttributes triggers a full index rebuild. On large datasets this can take minutes. Index is still searchable during rebuild but with old settings.
fix
Set filterableAttributes and sortableAttributes once at index creation time. Track the returned task and wait before querying with new filters.
affects: all
gotchaEvery document must have a primary key field. Default is 'id'. If no 'id' field exists and no primary key is specified, indexing fails silently or raises MeilisearchApiError.
fix
Always include 'id' field in documents, or specify primary_key when creating index: client.create_index('movies', {'primaryKey': 'movie_id'})
affects: all
gotchaclient.index('name') does NOT create the index — it returns an index reference object. Index is created on first add_documents() call or explicitly with client.create_index().
fix
Use client.get_index('name') to get an existing index (raises if not found). Use client.index('name') as a reference that auto-creates on first write.
affects: all
gotchaStill pre-1.0 (0.40.x). API may change across minor versions. Compatible with Meilisearch server v1.2+ only.
fix
Pin version: pip install meilisearch==0.40.0. Check server compatibility at github.com/meilisearch/meilisearch-python.
affects: all
breakingMeilisearch client failed to connect to the server (Connection refused). This typically means the Meilisearch server is not running or is not accessible at the specified host and port (default 127.0.0.1:7700).
fix
Ensure the Meilisearch server is running and accessible. If it's on a different host or port, initialize the client with `Client('http://your-meilisearch-host:port', 'your-master-key')`.
affects: all
breakingFailed to connect to Meilisearch server. A ConnectionRefusedError typically means the Meilisearch server process is not running, or it's not accessible at the configured host and port (default 127.0.0.1:7700).
fix
Ensure the Meilisearch server is running and accessible before initializing the client or making API calls. Check the server's listening address and port, and configure your Meilisearch client accordingly if it differs from the default.
affects: all
Upgrade
Version history
0.43.0latest on PyPI · released Jul 22, 2026
Audit
Dependencies
requestsrequiredRequired by official meilisearch package. Installed automatically.
Agent activity
17 hits · last 30 days
node
14
Resources
meilisearch — pip install meilisearch · libregistry