---
title: "Create index for field in collection"
method: PUT
path: "/collections/{collection_name}/index"
tags: ["Indexes"]
---

# Create index for field in collection

`PUT /collections/{collection_name}/index`

Create index for field in collection

## Path parameters

- `collection_name` string, required

## Query parameters

- `wait` boolean
- `ordering` 'weak' | 'medium' | 'strong' — Defines write ordering guarantees for collection operations * `weak` - write operations may be reordered, works faster, default * `medium` - write operations go through dynamically selected leader, may be inconsistent for a short period of time in case of leader change * `strong` - Write operations go through the permanent leader, consistent, but may be unavailable if leader is down

## Request body

- CreateFieldIndex
  - `field_name` string, required
  - `field_schema` union
    - union
      - 'keyword' | 'integer' | 'float' | 'geo' | 'text' | 'bool' | 'datetime' | 'uuid' — All possible names of payload types
      - union — Payload type with parameters
        - KeywordIndexParams
          - `type` 'keyword', required
          - `is_tenant` boolean, nullable — If true - used for tenant optimization. Default: false.
          - `on_disk` boolean, nullable — If true, store the index on disk. Default: false.
        - IntegerIndexParams
          - `type` 'integer', required
          - `lookup` boolean, nullable — If true - support direct lookups.
          - `range` boolean, nullable — If true - support ranges filters.
          - `is_principal` boolean, nullable — If true - use this key to organize storage of the collection data. This option assumes that this key will be used in majority of filtered requests.
          - `on_disk` boolean, nullable — If true, store the index on disk. Default: false.
        - FloatIndexParams
          - `type` 'float', required
          - `is_principal` boolean, nullable — If true - use this key to organize storage of the collection data. This option assumes that this key will be used in majority of filtered requests.
          - `on_disk` boolean, nullable — If true, store the index on disk. Default: false.
        - GeoIndexParams
          - `type` 'geo', required
          - `on_disk` boolean, nullable — If true, store the index on disk. Default: false.
        - TextIndexParams
          - `type` 'text', required
          - `tokenizer` 'prefix' | 'whitespace' | 'word' | 'multilingual'
          - `min_token_len` integer, nullable — Minimum characters to be tokenized.
          - `max_token_len` integer, nullable — Maximum characters to be tokenized.
          - `lowercase` boolean, nullable — If true, lowercase all tokens. Default: true.
          - `on_disk` boolean, nullable — If true, store the index on disk. Default: false.
        - BoolIndexParams
          - `type` 'bool', required
          - `on_disk` boolean, nullable — If true, store the index on disk. Default: false.
        - DatetimeIndexParams
          - `type` 'datetime', required
          - `is_principal` boolean, nullable — If true - use this key to organize storage of the collection data. This option assumes that this key will be used in majority of filtered requests.
          - `on_disk` boolean, nullable — If true, store the index on disk. Default: false.
        - UuidIndexParams
          - `type` 'uuid', required
          - `is_tenant` boolean, nullable — If true - used for tenant optimization.
          - `on_disk` boolean, nullable — If true, store the index on disk. Default: false.
    - unknown

## Response `200`

successful operation

- object
  - `usage` union
    - HardwareUsage — Usage of the hardware resources, spent to process the request
      - `cpu` integer, required
      - `payload_io_read` integer, required
      - `payload_io_write` integer, required
      - `payload_index_io_read` integer, required
      - `payload_index_io_write` integer, required
      - `vector_io_read` integer, required
      - `vector_io_write` integer, required
    - unknown
  - `time` number, float — Time spent to process this request
  - `status` string
  - `result` UpdateResult
    - `operation_id` integer, nullable — Sequential number of the operation
    - `status` 'acknowledged' | 'completed', required — `Acknowledged` - Request is saved to WAL and will be process in a queue. `Completed` - Request is completed, changes are actual.

## Other responses

- `default` — error
- `4XX` — error

## Changes

- **2025-04-15** `5d330acca4cd` — 2 breaking, 6 info
  - removed the required property `usage/anyOf[#/components/schemas/HardwareUsage]/io_read` from the response with the `200` status
  - removed the required property `usage/anyOf[#/components/schemas/HardwareUsage]/io_write` from the response with the `200` status
  - added the required property `usage/anyOf[#/components/schemas/HardwareUsage]/payload_index_io_read` to the response with the `200` status
  - added the required property `usage/anyOf[#/components/schemas/HardwareUsage]/payload_index_io_write` to the response with the `200` status
  - …4 more
- **2025-01-17** `a7900f38a79d` — 4 info
  - api tag `Indexes` added
  - api tag `collections` removed
  - added the new optional request property `field_schema/anyOf[#/components/schemas/PayloadFieldSchema]/anyOf[#/components/schemas/PayloadSchemaParams]/anyOf[#/components/schemas/BoolIndexParams]/on_disk`
  - added the optional property `usage` to the response with the `200` status
- **2024-10-13** `32595103f462` — 2 info
  - added the new optional request property `field_schema/anyOf[#/components/schemas/PayloadFieldSchema]/anyOf[#/components/schemas/PayloadSchemaParams]/anyOf[#/components/schemas/GeoIndexParams]/on_disk`
  - added the new optional request property `field_schema/anyOf[#/components/schemas/PayloadFieldSchema]/anyOf[#/components/schemas/PayloadSchemaParams]/anyOf[#/components/schemas/TextIndexParams]/on_disk`
- …earlier changes not shown

[Full history](https://skmtc.dev/qdrant/apis/qdrant-api/changes/collections/:collection_name/index/put.md)

---

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