---
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
- `timeout` integer

## 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 — Deprecated: use `memory` instead. If true, store the index on disk. Default: false.
          - `memory` union — Memory placement of the index. Overrides the deprecated `on_disk` flag if both are set. Default: `pinned` (`cold` if `on_disk` is set to true).
            - 'cold' | 'cached' | 'pinned' — Memory placement of a component's data. Data is always persisted on disk regardless of this setting; it only controls how the data is held in RAM. Options: * `Cold` - Data is not pre-loaded from disk to RAM. Preferred for rarely queried components or components larger than RAM size. First request might be slow, but data is cached with usage. * `Cached` - Data is pre-loaded into disk-cache RAM on start. First request is fast, but data may be evicted if there is not enough memory and some other component's data is used more frequently. * `Pinned` - Data is loaded in RAM and never evicted. First request is fast, but the component must fit in RAM at all times. Recommended for frequently queried small components like quantized vectors or primary indexes.
            - unknown
          - `enable_hnsw` boolean, nullable — Enable HNSW graph building for this payload field. If true, builds additional HNSW links (Need payload_m > 0). Default: true.
          - `prefix` boolean, nullable — If true, enable prefix matching (`match: { "prefix": ... }`) on this field. Default: false.
        - IntegerIndexParams
          - `type` 'integer', required
          - `lookup` boolean, nullable — If true - support direct lookups. Default is true.
          - `range` boolean, nullable — If true - support ranges filters. Default is true.
          - `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. Default is false.
          - `on_disk` boolean, nullable — Deprecated: use `memory` instead. If true, store the index on disk. Default: false.
          - `memory` union — Memory placement of the index. Overrides the deprecated `on_disk` flag if both are set. Default: `pinned` (`cold` if `on_disk` is set to true).
            - 'cold' | 'cached' | 'pinned' — Memory placement of a component's data. Data is always persisted on disk regardless of this setting; it only controls how the data is held in RAM. Options: * `Cold` - Data is not pre-loaded from disk to RAM. Preferred for rarely queried components or components larger than RAM size. First request might be slow, but data is cached with usage. * `Cached` - Data is pre-loaded into disk-cache RAM on start. First request is fast, but data may be evicted if there is not enough memory and some other component's data is used more frequently. * `Pinned` - Data is loaded in RAM and never evicted. First request is fast, but the component must fit in RAM at all times. Recommended for frequently queried small components like quantized vectors or primary indexes.
            - unknown
          - `enable_hnsw` boolean, nullable — Enable HNSW graph building for this payload field. If true, builds additional HNSW links (Need payload_m > 0). Default: true.
        - 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 — Deprecated: use `memory` instead. If true, store the index on disk. Default: false.
          - `memory` union — Memory placement of the index. Overrides the deprecated `on_disk` flag if both are set. Default: `pinned` (`cold` if `on_disk` is set to true).
            - 'cold' | 'cached' | 'pinned' — Memory placement of a component's data. Data is always persisted on disk regardless of this setting; it only controls how the data is held in RAM. Options: * `Cold` - Data is not pre-loaded from disk to RAM. Preferred for rarely queried components or components larger than RAM size. First request might be slow, but data is cached with usage. * `Cached` - Data is pre-loaded into disk-cache RAM on start. First request is fast, but data may be evicted if there is not enough memory and some other component's data is used more frequently. * `Pinned` - Data is loaded in RAM and never evicted. First request is fast, but the component must fit in RAM at all times. Recommended for frequently queried small components like quantized vectors or primary indexes.
            - unknown
          - `enable_hnsw` boolean, nullable — Enable HNSW graph building for this payload field. If true, builds additional HNSW links (Need payload_m > 0). Default: true.
        - GeoIndexParams
          - `type` 'geo', required
          - `on_disk` boolean, nullable — Deprecated: use `memory` instead. If true, store the index on disk. Default: false.
          - `memory` union — Memory placement of the index. Overrides the deprecated `on_disk` flag if both are set. Default: `pinned` (`cold` if `on_disk` is set to true).
            - 'cold' | 'cached' | 'pinned' — Memory placement of a component's data. Data is always persisted on disk regardless of this setting; it only controls how the data is held in RAM. Options: * `Cold` - Data is not pre-loaded from disk to RAM. Preferred for rarely queried components or components larger than RAM size. First request might be slow, but data is cached with usage. * `Cached` - Data is pre-loaded into disk-cache RAM on start. First request is fast, but data may be evicted if there is not enough memory and some other component's data is used more frequently. * `Pinned` - Data is loaded in RAM and never evicted. First request is fast, but the component must fit in RAM at all times. Recommended for frequently queried small components like quantized vectors or primary indexes.
            - unknown
          - `enable_hnsw` boolean, nullable — Enable HNSW graph building for this payload field. If true, builds additional HNSW links (Need payload_m > 0). Default: true.
        - 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.
          - `ascii_folding` boolean, nullable — If true, normalize tokens by folding accented characters to ASCII (e.g., "ação" -> "acao"). Default: false.
          - `phrase_matching` boolean, nullable — If true, support phrase matching. Default: false.
          - `stopwords` union — Ignore this set of tokens. Can select from predefined languages and/or provide a custom set.
            - union
              - …
            - unknown
          - `on_disk` boolean, nullable — Deprecated: use `memory` instead. If true, store the index on disk. Default: false.
          - `memory` union — Memory placement of the index. Overrides the deprecated `on_disk` flag if both are set. Default: `pinned` (`cold` if `on_disk` is set to true).
            - 'cold' | 'cached' | 'pinned' — Memory placement of a component's data. Data is always persisted on disk regardless of this setting; it only controls how the data is held in RAM. Options: * `Cold` - Data is not pre-loaded from disk to RAM. Preferred for rarely queried components or components larger than RAM size. First request might be slow, but data is cached with usage. * `Cached` - Data is pre-loaded into disk-cache RAM on start. First request is fast, but data may be evicted if there is not enough memory and some other component's data is used more frequently. * `Pinned` - Data is loaded in RAM and never evicted. First request is fast, but the component must fit in RAM at all times. Recommended for frequently queried small components like quantized vectors or primary indexes.
            - unknown
          - `stemmer` union — Algorithm for stemming. Default: disabled.
            - union — Different stemming algorithms with their configs.
              - …
            - unknown
          - `enable_hnsw` boolean, nullable — Enable HNSW graph building for this payload field. If true, builds additional HNSW links (Need payload_m > 0). Default: true.
        - BoolIndexParams
          - `type` 'bool', required
          - `on_disk` boolean, nullable — Deprecated: use `memory` instead. If true, store the index on disk. Default: false.
          - `memory` union — Memory placement of the index. Overrides the deprecated `on_disk` flag if both are set. Default: `pinned` (`cold` if `on_disk` is set to true).
            - 'cold' | 'cached' | 'pinned' — Memory placement of a component's data. Data is always persisted on disk regardless of this setting; it only controls how the data is held in RAM. Options: * `Cold` - Data is not pre-loaded from disk to RAM. Preferred for rarely queried components or components larger than RAM size. First request might be slow, but data is cached with usage. * `Cached` - Data is pre-loaded into disk-cache RAM on start. First request is fast, but data may be evicted if there is not enough memory and some other component's data is used more frequently. * `Pinned` - Data is loaded in RAM and never evicted. First request is fast, but the component must fit in RAM at all times. Recommended for frequently queried small components like quantized vectors or primary indexes.
            - unknown
          - `enable_hnsw` boolean, nullable — Enable HNSW graph building for this payload field. If true, builds additional HNSW links (Need payload_m > 0). Default: true.
        - 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 — Deprecated: use `memory` instead. If true, store the index on disk. Default: false.
          - `memory` union — Memory placement of the index. Overrides the deprecated `on_disk` flag if both are set. Default: `pinned` (`cold` if `on_disk` is set to true).
            - 'cold' | 'cached' | 'pinned' — Memory placement of a component's data. Data is always persisted on disk regardless of this setting; it only controls how the data is held in RAM. Options: * `Cold` - Data is not pre-loaded from disk to RAM. Preferred for rarely queried components or components larger than RAM size. First request might be slow, but data is cached with usage. * `Cached` - Data is pre-loaded into disk-cache RAM on start. First request is fast, but data may be evicted if there is not enough memory and some other component's data is used more frequently. * `Pinned` - Data is loaded in RAM and never evicted. First request is fast, but the component must fit in RAM at all times. Recommended for frequently queried small components like quantized vectors or primary indexes.
            - unknown
          - `enable_hnsw` boolean, nullable — Enable HNSW graph building for this payload field. If true, builds additional HNSW links (Need payload_m > 0). Default: true.
        - UuidIndexParams
          - `type` 'uuid', required
          - `is_tenant` boolean, nullable — If true - used for tenant optimization.
          - `on_disk` boolean, nullable — Deprecated: use `memory` instead. If true, store the index on disk. Default: false.
          - `memory` union — Memory placement of the index. Overrides the deprecated `on_disk` flag if both are set. Default: `pinned` (`cold` if `on_disk` is set to true).
            - 'cold' | 'cached' | 'pinned' — Memory placement of a component's data. Data is always persisted on disk regardless of this setting; it only controls how the data is held in RAM. Options: * `Cold` - Data is not pre-loaded from disk to RAM. Preferred for rarely queried components or components larger than RAM size. First request might be slow, but data is cached with usage. * `Cached` - Data is pre-loaded into disk-cache RAM on start. First request is fast, but data may be evicted if there is not enough memory and some other component's data is used more frequently. * `Pinned` - Data is loaded in RAM and never evicted. First request is fast, but the component must fit in RAM at all times. Recommended for frequently queried small components like quantized vectors or primary indexes.
            - unknown
          - `enable_hnsw` boolean, nullable — Enable HNSW graph building for this payload field. If true, builds additional HNSW links (Need payload_m > 0). Default: true.
    - unknown

## Response `200`

successful operation

- object
  - `usage` union
    - Usage — Usage of the hardware resources, spent to process the request
      - `hardware` 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
      - `inference` union
        - InferenceUsage
          - `models` object, required
        - unknown
    - 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' | 'wait_timeout', required — `Acknowledged` - Request is saved to WAL and will be process in a queue. `Completed` - Request is completed, changes are actual. `WaitTimeout` - Request is waiting for timeout.

## Other responses

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

---

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