Meilisearch Python Client

0.40.0 · active · verified Wed Mar 25

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+.

Warnings

Install

Imports

Quickstart

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'])

view raw JSON →