younifyd
Menu

Search with POST

Search with POST

POST/indexes/{index_uid}/search

Use it in a workflow

  1. Add a step and choose the Meilisearch connector.
  2. Pick the Search with POST action (under Search).
  3. Fill in the fields below, then reference the result from later steps as {{searchWithPost.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.

qstring | null

Sets the search terms. Meilisearch returns documents that match this query. The query supports [prefix search](https://www.meilisearch.com/docs/learn/engine/prefix) and [typo tolerance](https://www.meilisearch.com/docs/learn/relevancy/typo_tolerance_settings). Meilisearch only considers the first ten words; terms are normalized (lowercase, accents ignored). Omit or leave empty for a placeholder search: no query terms are applied, so Meilisearch returns all searchable documents in the index, ordered by [ranking rules](https://www.meilisearch.com/docs/learn/relevancy/ranking_rules). Enclose terms in double quotes (`"`) for phrase search: only documents containing that exact sequence of words are returned (e.g. `"Winter Feast"`). Use a minus sign (`-`) before a word or phrase to exclude it from results.

offsetinteger

Number of documents to skip at the start of the results. Use together with `limit` for [pagination](https://www.meilisearch.com/docs/guides/front_end/pagination) (e.g. offset=20 and limit=20 returns results 21–40). This parameter is ignored when `page` or `hitsPerPage` is set; in that case the response includes `totalHits` and `totalPages` instead of `estimatedTotalHits`.

Default 0

limitinteger

Maximum number of documents to return in the response. Use with `offset` for [pagination](https://www.meilisearch.com/docs/guides/front_end/pagination). This parameter is ignored when `page` or `hitsPerPage` is set. The value cannot exceed the index [maxTotalHits](https://www.meilisearch.com/docs/reference/api/settings/update-pagination#body-max-total-hits-one-of-0) setting.

Default 20

pageinteger | null

Request a specific results page (1-indexed). Use together with `hitsPerPage`. When this parameter is set, the response includes `totalHits` and `totalPages` instead of `estimatedTotalHits`. `page` and `hitsPerPage` take precedence over `offset` and `limit`.

hitsPerPageinteger | null

Maximum number of documents per page for [pagination](https://www.meilisearch.com/docs/guides/front_end/pagination). This value determines `totalPages`; use it together with `page`. When set, the response includes `totalHits` and `totalPages`. Set to 0 to obtain the exhaustive `totalHits` count without returning any documents.

attributesToRetrievearray | null

List of attributes to include in each returned document. Use `["*"]` to return all attributes; if not set, the index [displayed attributes](https://www.meilisearch.com/docs/learn/relevancy/displayed_searchable_attributes) list is used. Attributes that are not in [displayedAttributes](https://www.meilisearch.com/docs/reference/api/settings/update-all-settings#body-displayed-attributes-one-of-0) are omitted from the response.

attributesToCroparray | null

Attributes whose values should be cropped to a short excerpt. The cropped text appears in each hit's `_formatted` object. Length is controlled by `cropLength`, or you can override it per attribute with the `attribute:length` syntax. Use `["*"]` to crop all attributes in `attributesToRetrieve`. When possible, the crop is centered around the matching terms.

cropLengthinteger

Maximum number of words to include in cropped values. This parameter only applies when `attributesToCrop` is set. Both query terms and [stop words](https://www.meilisearch.com/docs/reference/api/settings/update-all-settings#body-stop-words-one-of-0) count toward this length.

Default 10

cropMarkerstring

String used to mark crop boundaries in cropped text. If null or empty, no markers are inserted. Markers are only added where content was actually removed.

Default "…"

attributesToHighlightarray | null

Attributes in which matching query terms should be highlighted. The highlighted text appears in each hit's `_formatted` object. Use `["*"]` to highlight in all attributes from `attributesToRetrieve`. By default, matches are wrapped in `<em>` and `</em>`; you can override this with `highlightPreTag` and `highlightPostTag`. Highlighting also applies to [synonyms](https://www.meilisearch.com/docs/learn/relevancy/synonyms) and [stop words](https://www.meilisearch.com/docs/reference/api/settings/update-all-settings#body-stop-words-one-of-0). Supported value types are string, number, array, and object. Note: highlights matches within all listed attributes, even those not in `searchableAttributes`.

highlightPreTagstring

String to insert before each highlighted term. Can be any string (e.g. `<strong>`, `*`). If null or empty, nothing is inserted at the start of a match.

Default "<em>"

highlightPostTagstring

String to insert after each highlighted term. Should be used together with `highlightPreTag` to avoid malformed output (e.g. unclosed HTML tags).

Default "</em>"

showMatchesPositionboolean

When true, each hit includes a `_matchesPosition` object with the byte offset (`start` and `length`) of each matched term. This is useful when you need custom highlighting. Note: reports match positions in all attributes, even non-searchable ones. Positions are measured in bytes, not characters.

filterany

A [filter](https://www.meilisearch.com/docs/learn/filtering_and_sorting/filter_search_results) expression to narrow results. All attributes used in the expression must be in [filterableAttributes](https://www.meilisearch.com/docs/reference/api/settings/update-all-settings#body-filterable-attributes-one-of-0). You can pass a string (e.g. `"(genres = horror OR genres = mystery) AND director = 'Jordan Peele'"`) or an array (e.g. `[["genres = horror", "genres = mystery"], "director = 'Jordan Peele'"]`). For [geo search](https://www.meilisearch.com/docs/learn/filtering_and_sorting/geosearch), use `_geoRadius(lat, lng, distance_in_meters)`, `_geoBoundingBox([lat,lng],[lat,lng])`, or `_geoPolygon([lat,lng], ...)` (GeoJSON only for polygon).

sortarray | null

Sort results by one or more attributes and their order. Use the format `["attribute:asc", "attribute:desc"]`; only attributes in [sortableAttributes](https://www.meilisearch.com/docs/reference/api/settings/update-all-settings#body-sortable-attributes-one-of-0) can be used. For [geo search](https://www.meilisearch.com/docs/learn/filtering_and_sorting/geosearch), use `_geoPoint(lat,lng):asc` or `:desc`; the response then includes `_geoDistance` in meters. The first attribute in the list has precedence. See [sorting search results](https://www.meilisearch.com/docs/learn/filtering_and_sorting/sort_search_results).

distinctstring | null

Return only one document per distinct value of the given attribute (e.g. deduplicate by product_id). The attribute must be in [filterableAttributes](https://www.meilisearch.com/docs/reference/api/settings/update-all-settings#body-filterable-attributes-one-of-0). This overrides the index [distinctAttribute](https://www.meilisearch.com/docs/reference/api/settings/update-all-settings#body-distinct-attribute-one-of-0) setting for this request. See [distinct attribute](https://www.meilisearch.com/docs/learn/relevancy/distinct_attribute).

facetsoneOf
matchingStrategyoneOf
attributesToSearchOnarray | null

Restrict the search to the listed attributes only. Each attribute must be in the index [searchable attributes](https://www.meilisearch.com/docs/learn/relevancy/displayed_searchable_attributes) list. The order of attributes in this parameter does not affect relevancy.

rankingScoreThresholdnumber | null

Stop the search at the first document whose [ranking score](https://www.meilisearch.com/docs/learn/relevancy/ranking_score) is below this value (between 0.0 and 1.0). All the documents after this document are excluded from the hits. Excluded hits do not count toward `estimatedTotalHits`, `totalHits`, or facet distribution. When used together with `page` and `hitsPerPage`, this parameter may reduce performance because Meilisearch must score all matching documents.

localesarray | null

Explicitly specify the language(s) of the query. Pass an array of [supported ISO-639 locales](https://www.meilisearch.com/docs/reference/api/settings/update-all-settings#body-localized-attributes-one-of-0). This overrides auto-detection; use it when auto-detection is wrong for the query or the documents. See also the [localizedAttributes](https://www.meilisearch.com/docs/reference/api/settings/list-all-settings#response-localized-attributes-one-of-0) settings and [Language](https://www.meilisearch.com/docs/learn/resources/language).

hybridoneOf
vectorarray | null

Custom query vector for [vector or hybrid search](https://www.meilisearch.com/docs/learn/ai_powered_search/getting_started_with_ai_search). The array length must match the dimensions of the embedder configured in the index. This parameter is mandatory when using a [user-provided embedder](https://www.meilisearch.com/docs/learn/ai_powered_search/search_with_user_provided_embeddings). When used with `hybrid`, documents are ranked by vector similarity. You can also use it to override an embedder's automatic vector generation.

retrieveVectorsboolean

When true, the response includes document and query embeddings in each hit's `_vectors` field. The `_vectors` field must be listed in [displayedAttributes](https://www.meilisearch.com/docs/reference/api/settings/update-all-settings#body-displayed-attributes-one-of-0) for it to appear.

mediaany

For [multimodal search](https://www.meilisearch.com/docs/learn/ai_powered_search/image_search_with_multimodal_embeddings): provide data (e.g. image, text) that populates a single search fragment configured in index settings. A search fragment is a named slot that defines which media or fields are sent to the embedder. An embedder is required; this parameter is incompatible with `vector`. POST only.

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

showRankingScoreboolean

When true, each document includes a `_rankingScore` between 0.0 and 1.0; a higher value means the document is more relevant. See [ranking score](https://www.meilisearch.com/docs/learn/relevancy/ranking_score). The `sort` ranking rule does not affect the value of `_rankingScore`.

showRankingScoreDetailsboolean

When true, each document includes `_rankingScoreDetails`, which breaks down the score contribution of each [ranking rule](https://www.meilisearch.com/docs/learn/relevancy/ranking_rules). Useful for debugging relevancy.

showPerformanceDetailsboolean

When true, the response includes a `performanceDetails` object with a timing breakdown of the query processing.

inlineRuleoneOf
json
{
  "q": "string",
  "offset": 0,
  "limit": 20,
  "page": 0,
  "hitsPerPage": 0,
  "attributesToRetrieve": null,
  "attributesToCrop": null,
  "cropLength": 10,
  "cropMarker": "…",
  "attributesToHighlight": null,
  "highlightPreTag": "<em>",
  "highlightPostTag": "</em>"
}

Response

Returns 200 with a any. Read it in later steps with {{searchWithPost.response.data.<field>}}.

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

Search with POST — Meilisearch — Documentation