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 meilisearchVerified import paths — ran on the pinned version, not inferred.
Meilisearch Python client — indexing, waiting for task, and search.
pip install meilisearch-python-sdk; from meilisearch_python_sdk import AsyncClient
Call client.wait_for_task(task.task_uid) after indexing to wait for completion. In production use task polling instead.
Set filterableAttributes and sortableAttributes once at index creation time. Track the returned task and wait before querying with new filters.
Always include 'id' field in documents, or specify primary_key when creating index: client.create_index('movies', {'primaryKey': 'movie_id'})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.Pin version: pip install meilisearch==0.40.0. Check server compatibility at github.com/meilisearch/meilisearch-python.
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')`.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.