search
Query a Meilisearch index to retrieve documents, filter results, and customize attributes like sorting, highlighting, and faceting using defined parameters.
Instructions
Search for documents in a Meilisearch index
Input Schema
Name | Required | Description | Default |
---|---|---|---|
attributesToCrop | No | Attributes to crop | |
attributesToHighlight | No | Attributes to highlight | |
attributesToRetrieve | No | Attributes to include in results | |
cropLength | No | Length at which to crop cropped attributes | |
facets | No | Facets to return | |
filter | No | Filter query to apply | |
highlightPostTag | No | Tag to insert after highlighted text | |
highlightPreTag | No | Tag to insert before highlighted text | |
indexUid | Yes | Unique identifier of the index | |
limit | No | Maximum number of results to return (default: 20) | |
matchingStrategy | No | Matching strategy: 'all' or 'last' | |
offset | No | Number of results to skip (default: 0) | |
q | Yes | Search query | |
showMatchesPosition | No | Whether to include match positions in results | |
sort | No | Attributes to sort by, e.g. ["price:asc"] |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"attributesToCrop": {
"description": "Attributes to crop",
"items": {
"type": "string"
},
"type": "array"
},
"attributesToHighlight": {
"description": "Attributes to highlight",
"items": {
"type": "string"
},
"type": "array"
},
"attributesToRetrieve": {
"description": "Attributes to include in results",
"items": {
"type": "string"
},
"type": "array"
},
"cropLength": {
"description": "Length at which to crop cropped attributes",
"type": "number"
},
"facets": {
"description": "Facets to return",
"items": {
"type": "string"
},
"type": "array"
},
"filter": {
"description": "Filter query to apply",
"type": "string"
},
"highlightPostTag": {
"description": "Tag to insert after highlighted text",
"type": "string"
},
"highlightPreTag": {
"description": "Tag to insert before highlighted text",
"type": "string"
},
"indexUid": {
"description": "Unique identifier of the index",
"type": "string"
},
"limit": {
"description": "Maximum number of results to return (default: 20)",
"maximum": 1000,
"minimum": 1,
"type": "number"
},
"matchingStrategy": {
"description": "Matching strategy: 'all' or 'last'",
"type": "string"
},
"offset": {
"description": "Number of results to skip (default: 0)",
"minimum": 0,
"type": "number"
},
"q": {
"description": "Search query",
"type": "string"
},
"showMatchesPosition": {
"description": "Whether to include match positions in results",
"type": "boolean"
},
"sort": {
"description": "Attributes to sort by, e.g. [\"price:asc\"]",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"indexUid",
"q"
],
"type": "object"
}