---
title: "Search an index"
method: GET
path: "/{index}/search"
---

# Search an index

`GET /{index}/search`

## Path parameters

- `index` string, required

## Query parameters

- `query` string, required
- `hits` integer
- `parse` boolean

## Response `200`

Search results.

- SearchResponse
  - `api` string, required
  - `index` string, required
  - `query` Query, required
    - `text` string, required
  - `candidates` Candidate[], required
    - `docid` string, required
    - `score` number, float, required
    - `rank` integer, required
    - `doc` union, required — May be null, a string, or a JSON object depending on index contents and setting of "parse" parameter.
      - string
      - object
      - unknown[]
        - unknown
      - number
      - boolean

## Other responses

- `400` — Invalid request parameters.
- `404` — Route not found.
- `405` — Method not allowed. Only GET is supported.
- `500` — Internal server error.

## Changes

- **2026-07-17** `a95dfd318781` — 5 info
  - added the new optional `query` request parameter `parse`
  - added the non-success response with the status `405`
  - added the non-success response with the status `500`
  - added `#/components/schemas/DocumentPayload` to the `candidates/items/doc` response property `allOf` list for the response status `200`
  - …1 more
- **2026-03-21** `a2b4397b7f05` — 1 info
  - endpoint added
- **2026-03-15** `70cb270260ea` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/castorini/apis/anserini-rest-api/changes/:index/search/get.md)

---

[API](https://skmtc.dev/castorini/apis/anserini-rest-api.md) · [All operations](https://skmtc.dev/castorini/apis/anserini-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/castorini/anserini-rest-api/revisions/a95dfd318781/schema)
