---
title: "Update collection parameters"
method: PATCH
path: "/collections/{collection_name}"
tags: ["collections"]
---

# Update collection parameters

`PATCH /collections/{collection_name}`

Update parameters of the existing collection

## Path parameters

- `collection_name` string, required

## Query parameters

- `timeout` integer

## Request body

- UpdateCollection — Operation for updating parameters of the existing collection
  - `vectors` union — Map of vector data parameters to update for each named vector. To update parameters in a collection having a single unnamed vector, use an empty string as name.
    - VectorsConfigDiff — Vector update params for multiple vectors { "vector_name": { "hnsw_config": { "m": 8 } } }
    - unknown
  - `optimizers_config` union — Custom params for Optimizers. If none - it is left unchanged. This operation is blocking, it will only proceed once all current optimizations are complete
    - OptimizersConfigDiff
      - `deleted_threshold` number, double, nullable — The minimal fraction of deleted vectors in a segment, required to perform segment optimization
      - `vacuum_min_vector_number` integer, nullable — The minimal number of vectors in a segment, required to perform segment optimization
      - `default_segment_number` integer, nullable — Target amount of segments optimizer will try to keep. Real amount of segments may vary depending on multiple parameters: - Amount of stored points - Current write RPS It is recommended to select default number of segments as a factor of the number of search threads, so that each segment would be handled evenly by one of the threads If `default_segment_number = 0`, will be automatically selected by the number of available CPUs
      - `max_segment_size` integer, nullable — Do not create segments larger this size (in kilobytes). Large segments might require disproportionately long indexation times, therefore it makes sense to limit the size of segments. If indexation speed have more priority for your - make this parameter lower. If search speed is more important - make this parameter higher. Note: 1Kb = 1 vector of size 256
      - `memmap_threshold` integer, nullable — Maximum size (in kilobytes) of vectors to store in-memory per segment. Segments larger than this threshold will be stored as read-only memmaped file. Memmap storage is disabled by default, to enable it, set this threshold to a reasonable value. To disable memmap storage, set this to `0`. Note: 1Kb = 1 vector of size 256
      - `indexing_threshold` integer, nullable — Maximum size (in kilobytes) of vectors allowed for plain index, exceeding this threshold will enable vector indexing Default value is 20,000, based on <https://github.com/google-research/google-research/blob/master/scann/docs/algorithms.md>. To disable vector indexing, set to `0`. Note: 1kB = 1 vector of size 256.
      - `flush_interval_sec` integer, nullable — Minimum interval between forced flushes.
      - `max_optimization_threads` integer, nullable — Max number of threads (jobs) for running optimizations per shard. Note: each optimization job will also use `max_indexing_threads` threads by itself for index building. If null - have no limit and choose dynamically to saturate CPU. If 0 - no optimization threads, optimizations will be disabled.
    - unknown
  - `params` union — Collection base params. If none - it is left unchanged.
    - CollectionParamsDiff
      - `replication_factor` integer, nullable — Number of replicas for each shard
      - `write_consistency_factor` integer, nullable — Minimal number successful responses from replicas to consider operation successful
      - `read_fan_out_factor` integer, nullable — Fan-out every read request to these many additional remote nodes (and return first available response)
      - `on_disk_payload` boolean, nullable — If true - point's payload will not be stored in memory. It will be read from the disk every time it is requested. This setting saves RAM by (slightly) increasing the response time. Note: those payload values that are involved in filtering and are indexed - remain in RAM.
    - unknown
  - `hnsw_config` union — HNSW parameters to update for the collection index. If none - it is left unchanged.
    - HnswConfigDiff
      - `m` integer, nullable — Number of edges per node in the index graph. Larger the value - more accurate the search, more space required.
      - `ef_construct` integer, nullable — Number of neighbours to consider during the index building. Larger the value - more accurate the search, more time required to build the index.
      - `full_scan_threshold` integer, nullable — Minimal size (in kilobytes) of vectors for additional payload-based indexing. If payload chunk is smaller than `full_scan_threshold_kb` additional indexing won't be used - in this case full-scan search should be preferred by query planner and additional indexing is not required. Note: 1Kb = 1 vector of size 256
      - `max_indexing_threads` integer, nullable — Number of parallel threads used for background index building. If 0 - automatically select from 8 to 16. Best to keep between 8 and 16 to prevent likelihood of building broken/inefficient HNSW graphs. On small CPUs, less threads are used.
      - `on_disk` boolean, nullable — Store HNSW index on disk. If set to false, the index will be stored in RAM. Default: false
      - `payload_m` integer, nullable — Custom M param for additional payload-aware HNSW links. If not set, default M will be used.
    - unknown
  - `quantization_config` union — Quantization parameters to update. If none - it is left unchanged.
    - union
      - ScalarQuantization
        - `scalar` ScalarQuantizationConfig, required
          - `type` 'int8', required
          - `quantile` number, float, nullable — Quantile for quantization. Expected value range in [0.5, 1.0]. If not set - use the whole range of values
          - `always_ram` boolean, nullable — If true - quantized vectors always will be stored in RAM, ignoring the config of main storage
      - ProductQuantization
        - `product` ProductQuantizationConfig, required
          - `compression` 'x4' | 'x8' | 'x16' | 'x32' | 'x64', required
          - `always_ram` boolean, nullable
      - BinaryQuantization
        - `binary` BinaryQuantizationConfig, required
          - `always_ram` boolean, nullable
      - 'Disabled'
    - unknown
  - `sparse_vectors` union — Map of sparse vector data parameters to update for each sparse vector.
    - SparseVectorsConfig
    - unknown

## Response `200`

successful operation

- object
  - `time` number, float — Time spent to process this request
  - `status` string
  - `result` boolean

## Other responses

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

## Changes

- **2024-07-01** `e1a916176c14` — 1 info
  - added the new optional request property `sparse_vectors/anyOf[#/components/schemas/SparseVectorsConfig]/additionalProperties/index/anyOf[#/components/schemas/SparseIndexParams]/datatype`

[Change history](https://skmtc.dev/qdrant/apis/qdrant-api/changes/collections/:collection_name/patch.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/99f8ca65a207/schema)
