Get Documents

GET /indexes/{indexUid}/documents

Get documents by batch.

Path parameters

  • indexUid string Required

    Index Unique Identifier

Query parameters

  • limit number

    Maximum number of results to return.

    Default value is 20.

  • offset number

    Number of results to skip.

    Default value is 0.

  • fields string

    Comma-separated list of fields to display for an API resource. By default it contains all fields of an API resource.

    Default value is *.

  • Attribute(s) to filter on.

    Can be made of 3 syntaxes

    • Nested Array: ["something > 1", "genres=comedy", ["genres=horror", "title=batman"]]
    • String: something > 1 AND genres=comedy AND (genres=horror OR title=batman)
    • Mixed: ["something > 1 AND genres=comedy", "genres=horror OR title=batman"]


    _geoRadius({lat}, {lng}, {distance_in_meters}) and _geoBoundingBox([{lat, lng}], [{lat}, {lng}]) built-in filter rules can be used to filter documents within geo shapes.


    Attribute(s) used in filter should be declared as filterable attributes. See Filtering and Faceted Search.

Responses

  • 200 application/json

    Ok

    Hide response attributes Show response attributes object
    • results array[object] Required

      A document made of attribute. The maximum number of attribute for a document is 65,535.

      Hide results attribute Show results attribute object
    • limit integer Required

      Limit given for the query. If limit is not provided as a query parameter, this parameter displays the default limit value.

    • offset integer Required

      Offset given for the query. If offset is not provided as a query parameter, this parameter displays the default offset value.

    • total integer Required

      Total number of browsable results using offset/limit parameters for the given resource.

  • 401 application/json

    Unauthorized

    Hide response attributes Show response attributes object
  • 404

    Not Found

GET /indexes/{indexUid}/documents
curl \
 -X GET https://example.meilisearch.com:7700/indexes/movies/documents \
 -H "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "results": [
    {
      "id": 25684,
      "title": "American Ninja 5",
      "poster": "https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg",
      "overview": "When a scientists daughter is kidnapped, American Ninja, attempts to find her, but this time he teams up with a youngster he has trained in the ways of the ninja.",
      "release_date": 725846400
    },
    {
      "id": 45881,
      "title": "The Bridge of San Luis Rey",
      "poster": "https://image.tmdb.org/t/p/w500/4X7quIcdkc24Cveg5XdpfRqxtYA.jpg",
      "overview": "The Bridge of San Luis Rey is American author Thornton Wilder's second novel, first published in 1927 to worldwide acclaim. It tells the story of several interrelated people who die in the collapse of an Inca rope-fiber suspension bridge in Peru, and the events that lead up to their being on the bridge.[ A friar who has witnessed the tragic accident then goes about inquiring into the lives of the victims, seeking some sort of cosmic answer to the question of why each had to die. The novel won the Pulitzer Prize in 1928.",
      "release_date": 1072915200
    }
  ],
  "limit": 20,
  "offset": 0,
  "total": 2
}
Response examples (401)
{
  "message": "The Authorization header is missing. It must use the bearer authorization method.",
  "code": "missing_authorization_header",
  "type": "auth",
  "link": "https://docs.meilisearch.com/errors#missing_authorization_header"
}