object rankingScoreDetails
{
  "type": "object",
  "examples": {
    "With sort": {
      "typo": {
        "order": 1,
        "score": 1,
        "typoCount": 0,
        "maxTypoCount": 0
      },
      "words": {
        "order": 0,
        "score": 1,
        "matchingWords": 7,
        "maxMatchingWords": 7
      },
      "attribute": {
        "order": 3,
        "score": 1,
        "query_word_distance_score": 1,
        "attribute_ranking_order_score": 1
      },
      "exactness": {
        "order": 6,
        "score": 1,
        "matchType": "exactMatch"
      },
      "proximity": {
        "order": "2,",
        "score": 1
      },
      "title:asc": {
        "order": 4,
        "value": "batman: the dark knight returns, part 1"
      },
      "release_date:desc": {
        "order": 5,
        "value": 1345507200
      }
    }
  },
  "properties": {
    "typo": {
      "type": "object",
      "required": [
        "order",
        "typoCount",
        "maxTypoCount",
        "score"
      ],
      "properties": {
        "order": {
          "$ref": "#/components/schemas/order"
        },
        "score": {
          "$ref": "#/components/schemas/score"
        },
        "typoCount": {
          "type": "integer",
          "description": "The number of typos to correct in the query to match that document."
        },
        "maxTypoCount": {
          "type": "integer",
          "description": "The maximum number of typos that can be corrected in the query to match a document."
        }
      }
    },
    "words": {
      "type": "object",
      "required": [
        "order",
        "matchingWords",
        "maxMatchingWords",
        "score"
      ],
      "properties": {
        "order": {
          "$ref": "#/components/schemas/order"
        },
        "score": {
          "$ref": "#/components/schemas/score"
        },
        "matchingWords": {
          "type": "integer",
          "description": "number of words in the query that match in the document. The higher the better."
        },
        "maxMatchingWords": {
          "type": "integer",
          "description": "max number of words in the query that can match in the document for this iteration of the words ranking rule."
        }
      }
    },
    "attribute": {
      "type": "object",
      "required": [
        "order",
        "attributeRankingOrderScore",
        "queryWordDistanceScore",
        "score"
      ],
      "properties": {
        "order": {
          "$ref": "#/components/schemas/order"
        },
        "score": {
          "$ref": "#/components/schemas/score"
        },
        "queryWordDistanceScore": {
          "type": "number",
          "description": "Score computed depending on the position the attributes where each word of the query appears in.\n\nWords appearing in an attribute at the same position as in the query yield the highest score. The greater the distance to the position\nin the query, the lower the score.\n"
        },
        "attributeRankingOrderScore": {
          "type": "number",
          "description": "Score computed depending on the first attribute each word of the query appears in.\n\nThe first attribute in the `searchableAttributes` list yields the highest score, the last attribute the lowest.\n"
        }
      }
    },
    "exactness": {
      "type": "object",
      "required": [
        "order",
        "matchType",
        "score"
      ],
      "properties": {
        "order": {
          "$ref": "#/components/schemas/order"
        },
        "score": {
          "$ref": "#/components/schemas/score"
        },
        "matchType": {
          "type": "string",
          "description": "One of `exactMatch`, `matchesStart` or `noExactMatch`.\n- `exactMatch`: the document contains an attribute that exactly matches the query.\n- `matchesStart`: the document contains an attribute that exactly starts with the query.\n- `noExactMatch`: any other document.\n"
        },
        "matchingWords": {
          "type": "integer",
          "description": "for `noExactMatch`, the number of exact words contained in an attribute. The higher the better.\n"
        },
        "maxMatchingWords": {
          "type": "integer",
          "description": "for `noExactMatch`, the maximum number of exact words contained in an attribute\n"
        }
      }
    },
    "proximity": {
      "type": "object",
      "required": [
        "order",
        "score"
      ],
      "properties": {
        "order": {
          "$ref": "#/components/schemas/order"
        },
        "score": {
          "$ref": "#/components/schemas/score"
        }
      }
    }
  },
  "description": "The ranking score per ranking rule.",
  "additionalProperties": {
    "$ref": "#/components/schemas/customRankingRuleDetails"
  }
}
number score
{
  "type": "number",
  "description": "The relevancy score of a document according to a ranking rule and relative to a search query. Higher is better.\n\n`1.0` indicates a perfect match, `0.0` no match at all (Meilisearch should not return documents that don't match the query).\n"
}
object searchQuery
{
  "type": "object",
  "examples": {
    "Example": {
      "value": {
        "q": "Harry",
        "limit": 20,
        "facets": [
          "genres",
          "author"
        ],
        "filter": "(genres = Horror AND genres = Mystery) OR release_date > 523242000",
        "offset": 0,
        "cropLength": 20,
        "attributesToCrop": [
          "overview"
        ],
        "matchingStrategy": "all",
        "showRankingScore": true,
        "showMatchesPosition": true,
        "attributesToRetrieve": [
          "title",
          "overview"
        ],
        "attributesToHighlight": [
          "overview"
        ],
        "wordsMatchingStrategy": "all"
      }
    }
  },
  "properties": {
    "q": {
      "type": "string",
      "default": "\"\"",
      "example": "\"Back to the future\"",
      "description": "Query string."
    },
    "page": {
      "type": "number",
      "example": 1,
      "description": "The specific search results page to fetch."
    },
    "sort": {
      "$ref": "#/components/schemas/sort"
    },
    "limit": {
      "type": "number",
      "default": 20,
      "description": "Maximum number of documents returned."
    },
    "facets": {
      "type": "array",
      "items": {
        "type": "string",
        "default": "[]",
        "example": "[\"genres\", \"author\"]"
      },
      "description": "Array of attributes whose fields will be distributed as a facet. If you have [set up filterableAttributes](https://docs.meilisearch.com/reference/features/settings.html#filterable-attributes), you can retrieve the count of matching terms for each [facets](https://docs.meilisearch.com/reference/features/filtering_and_faceted_search.html#faceted-search).[Learn more about facet distribution in the dedicated guide](https://docs.meilisearch.com/reference/features/search_parameters.html#facet-distribution)"
    },
    "filter": {
      "$ref": "#/components/schemas/filter"
    },
    "offset": {
      "type": "number",
      "default": 0,
      "description": "Number of documents to skip."
    },
    "vector": {
      "type": "array",
      "items": {
        "description": "WARNING: Missing items property in array schema. Missing items property has been filled with this AnyType schema."
      },
      "default": "null",
      "example": "[0.8, 0.145, 0.26, 0.3]",
      "description": "Query vector."
    },
    "cropLength": {
      "type": "number",
      "default": 10,
      "description": "Sets the total number of **words** to keep for the cropped part of an attribute specified in the `attributesToCrop` parameter."
    },
    "cropMarker": {
      "type": "string",
      "default": "…",
      "description": "Sets the crop marker to apply before and/or after cropped part selected within an attribute defined in `attributesToCrop` parameter."
    },
    "hitsPerPage": {
      "type": "number",
      "example": 20,
      "description": "Number of returned results per page."
    },
    "highlightPreTag": {
      "type": "string",
      "default": "<em>",
      "example": "<mark>",
      "description": "Specify the tag to put before the highlighted query terms."
    },
    "attributesToCrop": {
      "type": "array",
      "items": {
        "type": "string",
        "default": "[]",
        "example": "[\"overview\", \"author\"]"
      },
      "description": "Array of attributes whose values have to be cropped. Cropped attributes are returned in `_formatted` response object."
    },
    "highlightPostTag": {
      "type": "string",
      "default": "</em>",
      "example": "</mark>",
      "description": "Specify the tag to put after the highlighted query terms."
    },
    "matchingStrategy": {
      "type": "string",
      "default": "last",
      "description": "Defines which strategy to use to match the query terms within the documents as search results. Two different strategies are available, `last` and `all`. By default, the `last` strategy is chosen."
    },
    "showRankingScore": {
      "type": "boolean",
      "default": false,
      "description": "Defines whether a `_rankingScore` number representing the relevancy score of that document should be returned or not."
    },
    "showMatchesPosition": {
      "type": "boolean",
      "default": false,
      "description": "Defines whether an `_matchesPosition` object that contains information about the matches should be returned or not."
    },
    "attributesToRetrieve": {
      "type": "array",
      "items": {
        "type": "string",
        "default": "[\"*\"]",
        "example": "[\"title\", \"overview\"]"
      },
      "description": "Array of attributes whose fields will be present in the returned documents. Defaults to the [displayedAttributes list](https://docs.meilisearch.com/reference/features/settings.html#displayed-attributes) which contains by default all attributes found in the documents."
    },
    "attributesToSearchOn": {
      "type": "array",
      "items": {
        "description": "WARNING: Missing items property in array schema. Missing items property has been filled with this AnyType schema."
      },
      "default": "[\"*\"]",
      "description": "Defines which `searchableAttributes` the query will search on."
    },
    "attributesToHighlight": {
      "type": "array",
      "items": {
        "type": "string",
        "default": "[]",
        "example": "[\"title\", \"overview\"]"
      },
      "description": "Array of attributes whose values will contain highlighted matching terms. Highlighted attributes are returned in `_formatted` response object."
    },
    "showRankingScoreDetails": {
      "type": "boolean",
      "default": false,
      "description": "Defines whether a `_rankingScoreDetails` object containing information about the score of that document for each ranking rule should be returned or not."
    }
  }
}
object searchResponse
{
  "type": "object",
  "title": "",
  "required": [
    "hits",
    "processingTimeMs",
    "query"
  ],
  "properties": {
    "hits": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/hit"
      },
      "description": "Array of documents matching the search."
    },
    "page": {
      "type": "integer",
      "description": "The specific search results page to fetch."
    },
    "limit": {
      "type": "integer",
      "description": "Number of returned documents."
    },
    "query": {
      "type": "string",
      "example": "ninja",
      "description": "Query originating the response."
    },
    "offset": {
      "type": "integer",
      "description": "Number of documents skipped."
    },
    "totalHits": {
      "type": "integer",
      "description": "Exhaustive total number of search results for the search query."
    },
    "facetStats": {
      "type": "object",
      "example": {
        "price": {
          "max": 4999.99,
          "min": 1
        }
      },
      "description": "When using the facets parameter, the distributed facets that contain some numeric values are displayed in a facetStats object that contains, per facet, the numeric min and max values of the hits returned by the search query. If none of the hits returned by the search query have a numeric value for a facet, this facet is not part of the facetStats object.\n",
      "additionalProperties": {
        "max": {
          "type": "number",
          "description": "The maximum value for the numerical facet being distributed."
        },
        "min": {
          "type": "number",
          "description": "The minimum value for the numerical facet being distributed."
        },
        "type": "object"
      }
    },
    "totalPages": {
      "type": "integer",
      "description": "Number of navigatable results pages for the search query."
    },
    "hitsPerPage": {
      "type": "integer",
      "description": "Number of returned results per page."
    },
    "processingTimeMs": {
      "type": "integer",
      "description": "Processing time of the query."
    },
    "facetDistribution": {
      "type": "object",
      "example": {
        "genres": {
          "action": 273,
          "comedy": 475,
          "fantasy": 67,
          "mystery": 70,
          "thriller": 217,
          "adventure": 132,
          "animation": 118
        }
      },
      "description": "[Distribution of the given facets](https://docs.meilisearch.com/reference/features/search_parameters.html#facet-distribution).\n",
      "additionalProperties": {
        "type": "object",
        "additionalProperties": {
          "type": "integer"
        }
      }
    },
    "estimatedTotalHits": {
      "type": "integer",
      "description": "Estimated number of candidates for the search query."
    }
  }
}
array searchableAttributes
{
  "type": "array",
  "items": {
    "type": "string"
  },
  "example": [
    "title",
    "description",
    "genre"
  ],
  "description": "Fields in which to search for matching query words sorted by order of importance."
}
array separatorTokens
{
  "type": "array",
  "items": {
    "type": "string"
  },
  "example": [
    "&",
    "</br>",
    "@"
  ],
  "description": "List of tokens that will be considered as word separators by Meilisearch."
}
object settings
{
  "type": "object",
  "required": [
    "synonyms",
    "stopWords",
    "rankingRules",
    "filterableAttributes",
    "distinctAttribute",
    "searchableAttributes",
    "displayedAttributes",
    "typoTolerance"
  ],
  "properties": {
    "synonyms": {
      "$ref": "#/components/schemas/synonyms"
    },
    "stopWords": {
      "$ref": "#/components/schemas/stopWords"
    },
    "rankingRules": {
      "$ref": "#/components/schemas/rankingRules"
    },
    "typoTolerance": {
      "$ref": "#/components/schemas/typoTolerance"
    },
    "distinctAttribute": {
      "$ref": "#/components/schemas/distinctAttribute"
    },
    "displayedAttributes": {
      "$ref": "#/components/schemas/displayedAttributes"
    },
    "filterableAttributes": {
      "$ref": "#/components/schemas/filterableAttributes"
    },
    "searchableAttributes": {
      "$ref": "#/components/schemas/searchableAttributes"
    }
  },
  "description": "[Learn more about the settings in this guide](https://docs.meilisearch.com/reference/features/settings.html).\n"
}
object sort
{
  "oneOf": [
    {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  ],
  "title": "sort",
  "example": [
    "price:desc"
  ],
  "description": "Fields on which you want to sort the results.\n\n> warn\n> Attribute(s) used in `sort` should be declared as sortable attributes. See [Sorting](https://docs.meilisearch.com/reference/features/sorting.html).\n\n> info\n> _geoPoint({lat}, {long}) built-in sort rule can be used to sort documents around a geo point.\n"
}
array sortableAttributes
{
  "type": "array",
  "items": {
    "type": "string"
  },
  "example": [
    "price",
    "author",
    "title"
  ],
  "description": "List of attributes to sort on at search."
}
object stats
{
  "type": "object",
  "title": "",
  "example": {
    "isIndexing": true,
    "fieldDistribution": {
      "genre": 10,
      "author": 9
    },
    "numberOfDocuments": 10
  },
  "required": [
    "numberOfDocuments",
    "isIndexing",
    "fieldDistribution"
  ],
  "properties": {
    "isIndexing": {
      "type": "boolean",
      "description": "Whether or not the index is currently ingesting document"
    },
    "fieldDistribution": {
      "type": "object",
      "description": "How many documents contains a field",
      "additionalProperties": {
        "type": "integer"
      }
    },
    "numberOfDocuments": {
      "type": "integer",
      "description": "Number of documents contained in the index."
    }
  },
  "x-examples": [
    {
      "isIndexing": true,
      "fieldDistribution": {
        "genre": 10,
        "author": 9
      },
      "numberOfDocuments": 10
    }
  ]
}
array stopWords
{
  "type": "array",
  "items": {
    "type": "string"
  },
  "example": [
    "of",
    "the",
    "to"
  ],
  "description": "List of words ignored when present in search queries."
}
object summarizedTask
{
  "type": "object",
  "examples": {
    "documentAdditionOrUpdate": {
      "$ref": "#/components/examples/202_documentAdditionOrUpdate"
    }
  },
  "required": [
    "uid",
    "indexUid",
    "status",
    "type",
    "enqueuedAt"
  ],
  "properties": {
    "type": {
      "enum": [
        "documentAdditionOrUpdate",
        "documentDeletion",
        "indexCreation",
        "indexUpdate",
        "indexDeletion",
        "indexSwap",
        "settingsUpdate",
        "dumpCreation",
        "taskCancelation",
        "taskDeletion"
      ],
      "type": "string",
      "description": "The type of the task"
    },
    "status": {
      "enum": [
        "enqueued"
      ],
      "type": "string",
      "description": "The status of the task"
    },
    "taskUid": {
      "type": "integer",
      "description": "The unique sequential identifier of the task. This `taskUid` allows you to [track the current task](https://docs.meilisearch.com/reference/api/tasks.html)."
    },
    "indexUid": {
      "type": "string",
      "description": "The unique identifier of the index where this task is operated"
    },
    "enqueuedAt": {
      "$ref": "#/components/schemas/timestamp",
      "description": "Represent the date and time as a `RFC 3339` format when the task has been enqueued"
    }
  },
  "description": "A summarized version of an asynchronous task. Summarized task representation are given for the 202 Accepted HTTP response. [Learn More](https://docs.meilisearch.com/learn/advanced/asynchronous_operations.html)."
}
array swapIndexes
{
  "type": "array",
  "items": {
    "$ref": "#/components/schemas/swapOperation"
  },
  "description": "Array of swap operations that will be processed atomically."
}
object swapOperation
{
  "type": "object",
  "required": [
    "indexes"
  ],
  "properties": {
    "indexes": {
      "type": "array",
      "items": {
        "description": "WARNING: Missing items property in array schema. Missing items property has been filled with this AnyType schema."
      },
      "description": "The two indexUids to swap in the given operation."
    }
  }
}
object synonyms
{
  "type": "object",
  "example": {
    "wow": [
      "world of warcraft"
    ],
    "logan": [
      "wolverine",
      "xmen"
    ],
    "wolverine": [
      "xmen",
      "logan"
    ]
  },
  "properties": {
    "wow": {
      "type": "array",
      "items": {
        "type": "string",
        "example": "world of warcraft"
      }
    },
    "logan": {
      "type": "array",
      "items": {
        "type": "string",
        "example": "wolverine"
      }
    },
    "wolverine": {
      "type": "array",
      "items": {
        "type": "string",
        "example": "xmen"
      }
    }
  },
  "description": "List of associated words treated similarly. A word associated to an array of word as synonyms."
}
object task
{
  "type": "object",
  "example": {
    "uid": 0,
    "type": "documentAdditionOrUpdate",
    "status": "succeeded",
    "details": {
      "indexedDocuments": 10,
      "receivedDocuments": 10
    },
    "duration": "PT5S",
    "indexUid": "movies",
    "startedAt": "2021-01-01T09:40:00.000000Z",
    "canceledBy": null,
    "enqueuedAt": "2021-01-01T09:39:00.000000Z",
    "finishedAt": "2021-01-01T09:40:05.000000Z"
  },
  "required": [
    "uid",
    "indexUid",
    "status",
    "type",
    "canceledBy",
    "details",
    "error",
    "enqueuedAt",
    "startedAt",
    "finishedAt"
  ],
  "properties": {
    "uid": {
      "type": "integer",
      "description": "The unique sequential identifier of the task"
    },
    "type": {
      "enum": [
        "documentAdditionOrUpdate",
        "documentDeletion",
        "indexCreation",
        "indexUpdate",
        "indexDeletion",
        "indexSwap",
        "settingsUpdate",
        "dumpCreation",
        "taskCancelation",
        "taskDeletion",
        "snapshotCreation"
      ],
      "type": "string",
      "description": "The type of the task"
    },
    "error": {
      "$ref": "#/components/schemas/error",
      "description": "Error object containing error details and context when a task has a failed status."
    },
    "status": {
      "enum": [
        "enqueued",
        "processing",
        "succeeded",
        "failed"
      ],
      "type": "string",
      "example": "succeeded",
      "description": "The status of the task"
    },
    "details": {
      "type": "object",
      "properties": {
        "dumpUid": {
          "type": "string",
          "description": "Identifier generated for the dump for dumpCreation task."
        },
        "settings": {
          "$ref": "#/components/schemas/settings"
        },
        "primaryKey": {
          "type": "string",
          "description": "Value for the primaryKey field encountered if any for indexCreation or indexUpdate task."
        },
        "providedIds": {
          "type": "integer",
          "description": "Number of provided document ids for the documentDeletion task."
        },
        "deletedTasks": {
          "type": "integer",
          "description": "Number of tasks deleted for taskDeletion."
        },
        "matchedTasks": {
          "type": "integer",
          "description": "Number of tasks that match the request for taskCancelation or taskDeletion tasks."
        },
        "canceledTasks": {
          "type": "integer",
          "description": "Number of tasks canceled for taskCancelation."
        },
        "originalFilter": {
          "type": "string",
          "description": "Original filter query for taskCancelation or taskDeletion tasks."
        },
        "deletedDocuments": {
          "type": "integer",
          "description": "Number of documents finally deleted for documentDeletion and indexDeletion tasks."
        },
        "indexedDocuments": {
          "type": "integer",
          "description": "Number of documents finally indexed for documentAdditionOrUpdate task or a documentAdditionOrUpdate batch of tasks."
        },
        "receivedDocuments": {
          "type": "integer",
          "description": "Number of documents received for documentAdditionOrUpdate task."
        }
      },
      "description": "Details information of the task payload."
    },
    "duration": {
      "type": "string",
      "nullable": true,
      "description": "Total elasped time the engine was in processing state expressed as a `ISO-8601` duration format. Default is set to `null`"
    },
    "indexUid": {
      "type": "string",
      "description": "The unique identifier of the index where this task is operated"
    },
    "startedAt": {
      "$ref": "#/components/schemas/timestamp",
      "nullable": true,
      "description": "Represent the date and time as a `RFC 3339` format when the task has been dequeued and started to be processed. Default is set to `null`"
    },
    "canceledBy": {
      "type": "integer",
      "description": "The uid of the task that performed the taskCancelation if the task has been canceled."
    },
    "enqueuedAt": {
      "$ref": "#/components/schemas/timestamp",
      "description": "Represent the date and time as a `RFC 3339` format when the task has been enqueued"
    },
    "finishedAt": {
      "$ref": "#/components/schemas/timestamp",
      "nullable": true,
      "description": "Represent the date and time as a `RFC 3339` format when the task has failed or succeeded. Default is set to `null`"
    }
  },
  "x-examples": [
    {
      "uid": 0,
      "type": "documentAdditionOrUpdate",
      "status": "succeeded",
      "details": {
        "indexedDocuments": 10,
        "receivedDocuments": 10
      },
      "duration": "PT5S",
      "indexUid": "movies",
      "startedAt": "2021-01-01T09:40:00.000000Z",
      "canceledBy": null,
      "enqueuedAt": "2021-01-01T09:39:00.000000Z",
      "finishedAt": "2021-01-01T09:40:05.000000Z"
    }
  ],
  "description": "Meilisearch is an asynchronous API. It means that the API does not behave as you would typically expect when handling the request's responses.\n\nSome operations are put in a queue and will be executed in turn (asynchronously). In this case, the server response contains the identifier to track the execution of the operation.\n\n[Learn More](https://docs.meilisearch.com/learn/advanced/asynchronous_operations.html).\n"
}
string timestamp
{
  "type": "string",
  "example": "2019-11-20T09:40:33.711324Z",
  "description": "An `RFC 3339` format for date/time/duration."
}
integer total
{
  "type": "integer",
  "example": 50,
  "description": "Total number of browsable results using offset/limit parameters for the given resource."
}
integer totalHits
{
  "type": "integer",
  "example": 20,
  "description": "Returns the total number of search results. Computed if either `page` or `hitsPerPage` is provided as a query parameter."
}
integer totalPages
{
  "type": "integer",
  "example": 20,
  "description": "Returns the total number of navigatable results pages for the search query. Computed if either `page` or `hitsPerPage` is provided as a query parameter."
}
object typoTolerance
{
  "type": "object",
  "properties": {
    "enabled": {
      "type": "boolean",
      "default": true,
      "nullable": false,
      "description": "Enable the typo tolerance feature."
    },
    "disableOnWords": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": [],
      "nullable": false,
      "description": "Disable the typo tolerance feature for a set of query terms given for a search query."
    },
    "disableOnAttributes": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": [],
      "nullable": false,
      "description": "Disable the typo tolerance feature on the specified attributes."
    },
    "minWordSizeForTypos": {
      "type": "object",
      "properties": {
        "oneTypo": {
          "type": "integer",
          "default": 5,
          "nullable": false,
          "description": "Customize the minimum size for a word to tolerate 1 typo."
        },
        "twoTypos": {
          "type": "integer",
          "default": 9,
          "nullable": false,
          "description": "Customize the minimum size for a word to tolerate 2 typos."
        }
      }
    }
  },
  "description": "Customize typo tolerance feature."
}