# Meilisearch

> Search and update Meilisearch indexes: search with filters and sorting, add, read and delete documents, and create and set up indexes. Start a workflow when Meilisearch fails to index something.

App · 12 actions. Web page: https://docs.lodol.com/docs/integrations/meilisearch

## Actions

### Add document

Add a document to an index, or change the one with the same ID.

**Inputs**

- Index (`index`, text, required): The index. Pick one, or type its name.
- Document (`document`, object, required): Its fields and values, including its ID (such as id: 42).
- If it exists (`mode`, text): Whether to change only the fields given or replace the whole document. Defaults to changing the fields given. One of: `update` (Add, or update the fields given), `replace` (Add, or replace the whole document). Default: `update`.
- Wait until done (`wait`, true/false): Wait up to 30 seconds for Meilisearch to finish, so the next step sees the change. On by default. Default: `true`.

**Outputs**

- `details` (object): What it did, such as receivedDocuments and indexedDocuments
- `duration` (text): How long it took (ISO 8601 duration, such as PT0.12S)
- `enqueued_at` (text): When it was asked for (ISO 8601)
- `error` (text): Why it failed; empty unless it failed
- `error_code` (text): Meilisearch's code for the failure, such as invalid_document_id
- `finished_at` (text): When it finished (ISO 8601); empty while it runs
- `index` (text): The index it works on
- `status` (text): enqueued, processing, succeeded, failed or canceled
- `task_uid` (number): The task's number, for 'Get task'
- `type` (text): What it does, such as documentAdditionOrUpdate

**Example output**

```json
{
  "details": {
    "indexedDocuments": 1,
    "receivedDocuments": 1
  },
  "duration": "PT0.12S",
  "enqueued_at": "2026-10-27T10:00:00.000000Z",
  "error": "",
  "error_code": "",
  "finished_at": "2026-10-27T10:00:00.120000Z",
  "index": "products",
  "status": "succeeded",
  "task_uid": 42,
  "type": "documentAdditionOrUpdate"
}
```

### Add documents

Add a list of documents to an index, such as rows from an earlier step, changing any with the same ID.

**Inputs**

- Index (`index`, text, required): The index. Pick one, or type its name.
- Documents (`documents`, list, required): The documents, each with its fields and ID. Up to 10000 at a time.
- If one exists (`mode`, text): Whether to change only the fields given or replace the whole document. Defaults to changing the fields given. One of: `update` (Add, or update the fields given), `replace` (Add, or replace the whole document). Default: `update`.
- ID field (`primary_key`, text): The field that holds each document's ID, for a new index Meilisearch cannot work it out for.
- Wait until done (`wait`, true/false): Wait up to 30 seconds for Meilisearch to finish, so the next step sees the change. On by default. Default: `true`.

**Outputs**

- `details` (object): What it did, such as receivedDocuments and indexedDocuments
- `duration` (text): How long it took (ISO 8601 duration, such as PT0.12S)
- `enqueued_at` (text): When it was asked for (ISO 8601)
- `error` (text): Why it failed; empty unless it failed
- `error_code` (text): Meilisearch's code for the failure, such as invalid_document_id
- `finished_at` (text): When it finished (ISO 8601); empty while it runs
- `index` (text): The index it works on
- `status` (text): enqueued, processing, succeeded, failed or canceled
- `task_uid` (number): The task's number, for 'Get task'
- `type` (text): What it does, such as documentAdditionOrUpdate

**Example output**

```json
{
  "details": {
    "indexedDocuments": 2,
    "receivedDocuments": 2
  },
  "duration": "PT0.12S",
  "enqueued_at": "2026-10-27T10:00:00.000000Z",
  "error": "",
  "error_code": "",
  "finished_at": "2026-10-27T10:00:00.120000Z",
  "index": "products",
  "status": "succeeded",
  "task_uid": 42,
  "type": "documentAdditionOrUpdate"
}
```

### Change index settings

Change which fields an index searches, filters and sorts by.

**Inputs**

- Index (`index`, text, required): The index. Pick one, or type its name.
- Search in (`searchable_attributes`, list): The fields searched, most important first. Leave empty to keep them.
- Filter by (`filterable_attributes`, list): The fields a filter may use. Leave empty to keep them.
- Sort by (`sortable_attributes`, list): The fields results may be sorted by. Leave empty to keep them.
- One result per (`distinct_attribute`, text): A field whose value appears only once in results, such as product_id. Leave empty to keep it.
- Wait until done (`wait`, true/false): Wait up to 30 seconds for Meilisearch to finish, so the next step sees the change. On by default. Default: `true`.

**Outputs**

- `details` (object): What it did, such as receivedDocuments and indexedDocuments
- `duration` (text): How long it took (ISO 8601 duration, such as PT0.12S)
- `enqueued_at` (text): When it was asked for (ISO 8601)
- `error` (text): Why it failed; empty unless it failed
- `error_code` (text): Meilisearch's code for the failure, such as invalid_document_id
- `finished_at` (text): When it finished (ISO 8601); empty while it runs
- `index` (text): The index it works on
- `status` (text): enqueued, processing, succeeded, failed or canceled
- `task_uid` (number): The task's number, for 'Get task'
- `type` (text): What it does, such as documentAdditionOrUpdate

**Example output**

```json
{
  "details": {
    "filterableAttributes": [
      "status"
    ],
    "sortableAttributes": [
      "price"
    ]
  },
  "duration": "PT0.12S",
  "enqueued_at": "2026-10-27T10:00:00.000000Z",
  "error": "",
  "error_code": "",
  "finished_at": "2026-10-27T10:00:00.120000Z",
  "index": "products",
  "status": "succeeded",
  "task_uid": 42,
  "type": "settingsUpdate"
}
```

### Create index

Create an empty index.

**Inputs**

- Name (`index`, text, required): The new index's name: letters, numbers, '-' and '_', such as products.
- ID field (`primary_key`, text): The field that holds each document's ID, such as id. Leave empty to let Meilisearch work it out from the first documents.
- Wait until done (`wait`, true/false): Wait up to 30 seconds for Meilisearch to finish, so the next step sees the change. On by default. Default: `true`.

**Outputs**

- `details` (object): What it did, such as receivedDocuments and indexedDocuments
- `duration` (text): How long it took (ISO 8601 duration, such as PT0.12S)
- `enqueued_at` (text): When it was asked for (ISO 8601)
- `error` (text): Why it failed; empty unless it failed
- `error_code` (text): Meilisearch's code for the failure, such as invalid_document_id
- `finished_at` (text): When it finished (ISO 8601); empty while it runs
- `index` (text): The index it works on
- `status` (text): enqueued, processing, succeeded, failed or canceled
- `task_uid` (number): The task's number, for 'Get task'
- `type` (text): What it does, such as documentAdditionOrUpdate

**Example output**

```json
{
  "details": {
    "primaryKey": "id"
  },
  "duration": "PT0.12S",
  "enqueued_at": "2026-10-27T10:00:00.000000Z",
  "error": "",
  "error_code": "",
  "finished_at": "2026-10-27T10:00:00.120000Z",
  "index": "products",
  "status": "succeeded",
  "task_uid": 42,
  "type": "indexCreation"
}
```

### Delete documents

Delete documents from an index by their IDs, or every document matching a filter.

**Inputs**

- Index (`index`, text, required): The index. Pick one, or type its name.
- Document IDs (`document_ids`, list): The IDs of the documents to delete. Or leave empty and give a filter.
- Filter (`filter`, text): Instead of IDs, delete every document matching this, such as status = archived.
- Wait until done (`wait`, true/false): Wait up to 30 seconds for Meilisearch to finish, so the next step sees the change. On by default. Default: `true`.

**Outputs**

- `details` (object): What it did, such as receivedDocuments and indexedDocuments
- `duration` (text): How long it took (ISO 8601 duration, such as PT0.12S)
- `enqueued_at` (text): When it was asked for (ISO 8601)
- `error` (text): Why it failed; empty unless it failed
- `error_code` (text): Meilisearch's code for the failure, such as invalid_document_id
- `finished_at` (text): When it finished (ISO 8601); empty while it runs
- `index` (text): The index it works on
- `status` (text): enqueued, processing, succeeded, failed or canceled
- `task_uid` (number): The task's number, for 'Get task'
- `type` (text): What it does, such as documentAdditionOrUpdate

**Example output**

```json
{
  "details": {
    "deletedDocuments": 1,
    "originalFilter": null,
    "providedIds": 1
  },
  "duration": "PT0.12S",
  "enqueued_at": "2026-10-27T10:00:00.000000Z",
  "error": "",
  "error_code": "",
  "finished_at": "2026-10-27T10:00:00.120000Z",
  "index": "products",
  "status": "succeeded",
  "task_uid": 42,
  "type": "documentDeletion"
}
```

### Delete index

Delete an index and every document in it. It cannot be undone.

**Inputs**

- Index (`index`, text, required): The index. Pick one, or type its name.
- Wait until done (`wait`, true/false): Wait up to 30 seconds for Meilisearch to finish, so the next step sees the change. On by default. Default: `true`.

**Outputs**

- `details` (object): What it did, such as receivedDocuments and indexedDocuments
- `duration` (text): How long it took (ISO 8601 duration, such as PT0.12S)
- `enqueued_at` (text): When it was asked for (ISO 8601)
- `error` (text): Why it failed; empty unless it failed
- `error_code` (text): Meilisearch's code for the failure, such as invalid_document_id
- `finished_at` (text): When it finished (ISO 8601); empty while it runs
- `index` (text): The index it works on
- `status` (text): enqueued, processing, succeeded, failed or canceled
- `task_uid` (number): The task's number, for 'Get task'
- `type` (text): What it does, such as documentAdditionOrUpdate

**Example output**

```json
{
  "details": {
    "deletedDocuments": 1
  },
  "duration": "PT0.12S",
  "enqueued_at": "2026-10-27T10:00:00.000000Z",
  "error": "",
  "error_code": "",
  "finished_at": "2026-10-27T10:00:00.120000Z",
  "index": "products",
  "status": "succeeded",
  "task_uid": 42,
  "type": "indexDeletion"
}
```

### Get document

Get one document from an index by its ID.

**Inputs**

- Index (`index`, text, required): The index. Pick one, or type its name.
- Document ID (`document_id`, text, required): The document's ID: the value of its ID field.
- Fields to return (`fields`, list): Only these fields. Defaults to every field.

**Outputs**

- `document` (object): The document's fields
- `document_id` (text): The document's ID
- `index` (text): The index

**Example output**

```json
{
  "document": {
    "id": 1,
    "price": 79.99,
    "status": "published",
    "title": "Wireless headphones"
  },
  "document_id": "1",
  "index": "products"
}
```

### Get index

Get an index's document count, fields, and which fields it searches, filters and sorts by.

**Inputs**

- Index (`index`, text, required): The index. Pick one, or type its name.

**Outputs**

- `created_at` (text): When it was made (ISO 8601)
- `displayed_attributes` (list): The fields results show; * for all
- `distinct_attribute` (text): The field that keeps results distinct; empty if none
- `documents` (number): How many documents it holds
- `fields` (list): The fields its documents have
- `filterable_attributes` (list): The fields a filter may use
- `is_indexing` (true/false): True while it is taking in changes
- `primary_key` (text): Its ID field
- `searchable_attributes` (list): The fields it searches; * for all
- `sortable_attributes` (list): The fields results may be sorted by
- `uid` (text): Its name
- `updated_at` (text): When it last changed (ISO 8601)

**Example output**

```json
{
  "created_at": "2026-10-01T09:00:00.000000Z",
  "displayed_attributes": [
    "*"
  ],
  "distinct_attribute": "",
  "documents": 1,
  "fields": [
    "id",
    "price",
    "status",
    "title"
  ],
  "filterable_attributes": [
    "status"
  ],
  "is_indexing": false,
  "primary_key": "id",
  "searchable_attributes": [
    "*"
  ],
  "sortable_attributes": [
    "price"
  ],
  "uid": "products",
  "updated_at": "2026-10-27T10:00:00.120000Z"
}
```

### Get task

Get a task a write started: whether it finished, and why it failed if it did.

**Inputs**

- Task number (`task_uid`, number, required): The task number a write step returned. At least 0.

**Outputs**

- `details` (object): What it did, such as receivedDocuments and indexedDocuments
- `duration` (text): How long it took (ISO 8601 duration, such as PT0.12S)
- `enqueued_at` (text): When it was asked for (ISO 8601)
- `error` (text): Why it failed; empty unless it failed
- `error_code` (text): Meilisearch's code for the failure, such as invalid_document_id
- `finished_at` (text): When it finished (ISO 8601); empty while it runs
- `index` (text): The index it works on
- `status` (text): enqueued, processing, succeeded, failed or canceled
- `task_uid` (number): The task's number, for 'Get task'
- `type` (text): What it does, such as documentAdditionOrUpdate

**Example output**

```json
{
  "details": {
    "indexedDocuments": 1,
    "receivedDocuments": 1
  },
  "duration": "PT0.12S",
  "enqueued_at": "2026-10-27T10:00:00.000000Z",
  "error": "",
  "error_code": "",
  "finished_at": "2026-10-27T10:00:00.120000Z",
  "index": "products",
  "status": "succeeded",
  "task_uid": 42,
  "type": "documentAdditionOrUpdate"
}
```

### List documents

List an index's documents, optionally only those matching a filter.

**Inputs**

- Index (`index`, text, required): The index. Pick one, or type its name.
- Filter (`filter`, text): Only documents matching this, such as status = draft. The fields must be filterable.
- Fields to return (`fields`, list): Only these fields. Defaults to every field.
- How many (`limit`, number): How many documents. Defaults to 20. From 1 to 1000.
- Skip (`offset`, number): How many to skip first, to read the next page. Defaults to 0. At least 0.

**Outputs**

- `count` (number): How many were returned
- `documents` (list): The documents
- `index` (text): The index
- `total` (number): How many match in all

**Example output**

```json
{
  "count": 1,
  "documents": [
    {
      "id": 1,
      "price": 79.99,
      "status": "published",
      "title": "Wireless headphones"
    }
  ],
  "index": "products",
  "total": 1
}
```

### List indexes

List every index on the server with its ID field.

**Inputs**: None.

**Outputs**

- `count` (number): How many indexes
- `indexes` (list): The indexes

**Example output**

```json
{
  "count": 1,
  "indexes": [
    {
      "created_at": "2026-10-01T09:00:00.000000Z",
      "primary_key": "id",
      "uid": "products",
      "updated_at": "2026-10-27T10:00:00.120000Z"
    }
  ]
}
```

### Search

Search an index for documents matching words, with an optional filter and sort.

**Inputs**

- Index (`index`, text, required): The index. Pick one, or type its name.
- Search for (`query`, text): The words to look for. Leave empty to match every document the filter allows.
- Filter (`filter`, text): Only documents matching this, such as genre = horror. The fields must be filterable.
- Sort by (`sort`, list): The order of results. The fields must be sortable. Defaults to best match.
- Fields to return (`fields`, list): Only these fields of each result. Defaults to every field.
- Match (`matching`, text): How many of the words a result must have. Defaults to dropping the last ones if needed. One of: `last` (All words, dropping the last ones if needed), `all` (All words), `frequency` (All words, dropping the most common ones if needed). Default: `last`.
- How many (`limit`, number): How many results. Defaults to 20. From 1 to 1000.
- Skip (`offset`, number): How many to skip first, to read the next page. Defaults to 0. At least 0.

**Outputs**

- `count` (number): How many results were returned
- `estimated_total` (number): About how many documents match in all
- `hits` (list): The results, best first
- `index` (text): The index searched
- `processing_ms` (number): How long the search took, in milliseconds
- `query` (text): The words searched for

**Example output**

```json
{
  "count": 1,
  "estimated_total": 1,
  "hits": [
    {
      "id": 1,
      "price": 79.99,
      "status": "published",
      "title": "Wireless headphones"
    }
  ],
  "index": "products",
  "processing_ms": 2,
  "query": "headphones"
}
```
