younifyd
Menu

List documents with POST

List documents with POST

POST/indexes/{index_uid}/documents/fetch

Use it in a workflow

  1. Add a step and choose the Meilisearch connector.
  2. Pick the List documents with POST action (under Documents).
  3. Fill in the fields below, then reference the result from later steps as {{listDocumentsWithPost.response.data}}.

Request

Path parameters

index_uidstringrequired

Unique identifier of the index.

Request body

Enter the body as JSON in the step's Body field.

offsetinteger

Number of documents to skip in the response. Use together with `limit` for pagination through large document sets. For example, to get documents 151-170, set `offset=150` and `limit=20`. Defaults to `0`.

Default 0

limitinteger

Maximum number of documents to return in a single response. Use together with `offset` for pagination. Higher values return more results but may increase response time and memory usage. Defaults to `20`.

Default 20

fieldsarray | null

Array of document attributes to include in the response. If not specified, all attributes listed in the `displayedAttributes` setting are returned. Use this to reduce response size by only requesting the fields you need. Example: `["title", "description", "price"]`.

retrieveVectorsboolean

When `true`, includes the vector embeddings in the response for documents that have them. This is useful when you need to inspect or export vector data. Note that this can significantly increase response size. Defaults to `false`.

idsarray | null

Array of specific document IDs to retrieve. Only documents with matching [primary key](https://www.meilisearch.com/docs/learn/getting_started/primary_key) values will be returned. If not specified, all documents matching other criteria are returned. This is useful for fetching specific known documents.

filterany

Filter expression to select which documents to return. Attributes must be added to the `filterableAttributes` index setting before they can be used in filters. Accepts a string or an array of arrays of strings for AND/OR combinations. Example string: `"genres = action AND rating > 4"`. Example array: `[["genres = action", "genres = comedy"], "rating > 4"]` (inner array = OR, outer = AND).

sortarray | null

Array of attributes to sort the documents by. Each entry should be in the format `attribute:direction` where direction is either `asc` (ascending) or `desc` (descending). Example: `["price:asc", "rating:desc"]` sorts by price ascending, then by rating descending.

useNetworkboolean | null

When `true`, runs the query on the whole network (all shards covered exactly once). When `false`, the query runs locally. When omitted or `null`, the default value depends on whether the sharding is enabled for the instance: - If the instance has sharding enabled (has a leader), defaults to `true`. - Otherwise defaults to `false`. It also requires the `network` [experimental feature](http://localhost:3000/reference/api/experimental-features/configure-experimental-features). Values: `true` = use the whole network; `false` = local, default = see above. When using the network, the index must exist with compatible settings on all remotes.

json
{
  "offset": 150,
  "limit": 1,
  "fields": [
    "title, description"
  ],
  "retrieveVectors": true,
  "ids": [
    "cody",
    "finn",
    "brandy",
    "gambit"
  ],
  "filter": null,
  "sort": [
    "title:asc",
    "rating:desc"
  ],
  "useNetwork": false
}

Response

Returns 200 with an object. Read it in later steps with {{listDocumentsWithPost.response.data.<field>}}.

resultsarray<any>

Items for the current page.

offsetinteger

Number of items skipped.

limitinteger

Maximum number of items returned.

totalinteger

Total number of items matching the query.

json
{
  "results": [
    null
  ],
  "offset": 0,
  "limit": 0,
  "total": 0
}

Need more? See the Meilisearch guide for connection setup and behaviour shared by every action.