> This page is for version v1.19.x.
> For other versions, use one of these documentation indexes:
> - v1.20.x (default): https://api.qdrant.tech/v-1-20-x/llms.txt
> - v1.19.x: https://api.qdrant.tech/v-1-19-x/llms.txt
> - v1.18.x: https://api.qdrant.tech/v-1-18-x/llms.txt
> - v1.17.x: https://api.qdrant.tech/v-1-17-x/llms.txt
> - v1.16.x: https://api.qdrant.tech/v-1-16-x/llms.txt
> - v1.15.x: https://api.qdrant.tech/v-1-15-x/llms.txt
> - v1.14.x: https://api.qdrant.tech/v-1-14-x/llms.txt
> - v1.13.x: https://api.qdrant.tech/v-1-13-x/llms.txt
> - v1.12.x: https://api.qdrant.tech/v-1-12-x/llms.txt
> - v1.11.x: https://api.qdrant.tech/v-1-11-x/llms.txt
> - v1.10.x: https://api.qdrant.tech/v-1-10-x/llms.txt
> - v1.9.x: https://api.qdrant.tech/v-1-9-x/llms.txt
> - master: https://api.qdrant.tech/master/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://api.qdrant.tech/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.qdrant.tech/_mcp/server.

# Create payload index

PUT http://localhost:6333/collections/{collection_name}/index
Content-Type: application/json

Creates a payload index for a field in the specified collection.

Reference: https://api.qdrant.tech/api-reference/indexes/create-field-index

## Authentication

- `api-key` header (required) — Authorization key, either read-write or read-only
- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `collection_name` (string, required) — Name of the collection

### Query parameters

- `wait` (boolean, optional) — If true, wait for changes to actually happen
- `ordering` (enum, optional) — define ordering guarantees for the operation
  - Allowed values: `weak`, `medium`, `strong`
- `timeout` (integer, optional) — Timeout for the operation

### Body (application/json)

This endpoint expects a CreateFieldIndex.

- `field_name` (string, required)
- `field_schema` (CreateFieldIndexFieldSchema, optional)

## Response

### 200

successful operation

- `usage` (CollectionsCollectionNameIndexPutResponsesContentApplicationJsonSchemaUsage, optional)
- `time` (float, optional) — Time spent to process this request
- `status` (string, optional)
- `result` (UpdateResult, optional)

## Errors

### 400 Client Request Error

error

- `time` (float, optional) — Time spent to process this request
- `status` (ErrorResponseStatus, optional)
- `result` (ErrorResponseResult, optional, nullable)

## Types

### CreateFieldIndexFieldSchema

- PayloadFieldSchema: PayloadFieldSchema
- any

### CollectionsCollectionNameIndexPutResponsesContentApplicationJsonSchemaUsage

- Usage: Usage
- any

### UpdateResult

- `status` (enum, 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.
  - Allowed values: `acknowledged`, `completed`, `wait_timeout`
- `operation_id` (uint64, optional, nullable) — Sequential number of the operation

### ErrorResponseStatus

- `error` (string, optional) — Description of the occurred error.

### ErrorResponseResult

### PayloadFieldSchema

- PayloadSchemaType: enum
  - Allowed values: `keyword`, `integer`, `float`, `geo`, `text`, `bool`, `datetime`, `uuid`
- PayloadSchemaParams: PayloadSchemaParams

### Usage

Usage of the hardware resources, spent to process the request

- `hardware` (UsageHardware, optional)
- `inference` (UsageInference, optional)

### PayloadSchemaParams

Payload type with parameters

- KeywordIndexParams: KeywordIndexParams
- IntegerIndexParams: IntegerIndexParams
- FloatIndexParams: FloatIndexParams
- GeoIndexParams: GeoIndexParams
- TextIndexParams: TextIndexParams
- BoolIndexParams: BoolIndexParams
- DatetimeIndexParams: DatetimeIndexParams
- UuidIndexParams: UuidIndexParams

### UsageHardware

- HardwareUsage: HardwareUsage
- any

### UsageInference

- InferenceUsage: InferenceUsage
- any

### KeywordIndexParams

- `type` (enum, required)
  - Allowed values: `keyword`
- `is_tenant` (boolean, optional, nullable) — If true - used for tenant optimization. Default: false.
- `memory` (KeywordIndexParamsMemory, optional) — 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).
- `enable_hnsw` (boolean, optional, nullable) — Enable HNSW graph building for this payload field. If true, builds additional HNSW links (Need payload_m > 0). Default: true.
- `prefix` (boolean, optional, nullable) — If true, enable prefix matching (`match: { "prefix": ... }`) on this field. Default: false.
- `on_disk` (boolean, optional, nullable, deprecated) — Deprecated: use `memory` instead. If true, store the index on disk. Default: false.

### IntegerIndexParams

- `type` (enum, required)
  - Allowed values: `integer`
- `lookup` (boolean, optional, nullable) — If true - support direct lookups. Default is true.
- `range` (boolean, optional, nullable) — If true - support ranges filters. Default is true.
- `is_principal` (boolean, optional, 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.
- `memory` (IntegerIndexParamsMemory, optional) — 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).
- `enable_hnsw` (boolean, optional, nullable) — Enable HNSW graph building for this payload field. If true, builds additional HNSW links (Need payload_m > 0). Default: true.
- `on_disk` (boolean, optional, nullable, deprecated) — Deprecated: use `memory` instead. If true, store the index on disk. Default: false.

### FloatIndexParams

- `type` (enum, required)
  - Allowed values: `float`
- `is_principal` (boolean, optional, 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.
- `memory` (FloatIndexParamsMemory, optional) — 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).
- `enable_hnsw` (boolean, optional, nullable) — Enable HNSW graph building for this payload field. If true, builds additional HNSW links (Need payload_m > 0). Default: true.
- `on_disk` (boolean, optional, nullable, deprecated) — Deprecated: use `memory` instead. If true, store the index on disk. Default: false.

### GeoIndexParams

- `type` (enum, required)
  - Allowed values: `geo`
- `memory` (GeoIndexParamsMemory, optional) — 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).
- `enable_hnsw` (boolean, optional, nullable) — Enable HNSW graph building for this payload field. If true, builds additional HNSW links (Need payload_m > 0). Default: true.
- `on_disk` (boolean, optional, nullable, deprecated) — Deprecated: use `memory` instead. If true, store the index on disk. Default: false.

### TextIndexParams

- `type` (enum, required)
  - Allowed values: `text`
- `tokenizer` (enum, optional)
  - Allowed values: `prefix`, `whitespace`, `word`, `multilingual`
- `min_token_len` (integer, optional, nullable) — Minimum characters to be tokenized.
- `max_token_len` (integer, optional, nullable) — Maximum characters to be tokenized.
- `lowercase` (boolean, optional, nullable) — If true, lowercase all tokens. Default: true.
- `ascii_folding` (boolean, optional, nullable) — If true, normalize tokens by folding accented characters to ASCII (e.g., "ação" -> "acao"). Default: false.
- `phrase_matching` (boolean, optional, nullable) — If true, support phrase matching. Default: false.
- `stopwords` (TextIndexParamsStopwords, optional) — Ignore this set of tokens. Can select from predefined languages and/or provide a custom set.
- `memory` (TextIndexParamsMemory, optional) — 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).
- `stemmer` (TextIndexParamsStemmer, optional) — Algorithm for stemming. Default: disabled.
- `enable_hnsw` (boolean, optional, nullable) — Enable HNSW graph building for this payload field. If true, builds additional HNSW links (Need payload_m > 0). Default: true.
- `on_disk` (boolean, optional, nullable, deprecated) — Deprecated: use `memory` instead. If true, store the index on disk. Default: false.

### BoolIndexParams

- `type` (enum, required)
  - Allowed values: `bool`
- `memory` (BoolIndexParamsMemory, optional) — 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).
- `enable_hnsw` (boolean, optional, nullable) — Enable HNSW graph building for this payload field. If true, builds additional HNSW links (Need payload_m > 0). Default: true.
- `on_disk` (boolean, optional, nullable, deprecated) — Deprecated: use `memory` instead. If true, store the index on disk. Default: false.

### DatetimeIndexParams

- `type` (enum, required)
  - Allowed values: `datetime`
- `is_principal` (boolean, optional, 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.
- `memory` (DatetimeIndexParamsMemory, optional) — 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).
- `enable_hnsw` (boolean, optional, nullable) — Enable HNSW graph building for this payload field. If true, builds additional HNSW links (Need payload_m > 0). Default: true.
- `on_disk` (boolean, optional, nullable, deprecated) — Deprecated: use `memory` instead. If true, store the index on disk. Default: false.

### UuidIndexParams

- `type` (enum, required)
  - Allowed values: `uuid`
- `is_tenant` (boolean, optional, nullable) — If true - used for tenant optimization.
- `memory` (UuidIndexParamsMemory, optional) — 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).
- `enable_hnsw` (boolean, optional, nullable) — Enable HNSW graph building for this payload field. If true, builds additional HNSW links (Need payload_m > 0). Default: true.
- `on_disk` (boolean, optional, nullable, deprecated) — Deprecated: use `memory` instead. If true, store the index on disk. Default: false.

### 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)

### InferenceUsage

- `models` (map from string to ModelUsage, required)

### KeywordIndexParamsMemory

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).

- Memory: enum
  - Allowed values: `cold`, `cached`, `pinned`
- any

### IntegerIndexParamsMemory

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).

- Memory: enum
  - Allowed values: `cold`, `cached`, `pinned`
- any

### FloatIndexParamsMemory

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).

- Memory: enum
  - Allowed values: `cold`, `cached`, `pinned`
- any

### GeoIndexParamsMemory

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).

- Memory: enum
  - Allowed values: `cold`, `cached`, `pinned`
- any

### TextIndexParamsStopwords

Ignore this set of tokens. Can select from predefined languages and/or provide a custom set.

- StopwordsInterface: StopwordsInterface
- any

### TextIndexParamsMemory

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).

- Memory: enum
  - Allowed values: `cold`, `cached`, `pinned`
- any

### TextIndexParamsStemmer

Algorithm for stemming. Default: disabled.

- StemmingAlgorithm: StemmingAlgorithm
- any

### BoolIndexParamsMemory

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).

- Memory: enum
  - Allowed values: `cold`, `cached`, `pinned`
- any

### DatetimeIndexParamsMemory

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).

- Memory: enum
  - Allowed values: `cold`, `cached`, `pinned`
- any

### UuidIndexParamsMemory

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).

- Memory: enum
  - Allowed values: `cold`, `cached`, `pinned`
- any

### ModelUsage

- `tokens` (uint64, required)

### StopwordsInterface

- Language: enum
  - Allowed values: `arabic`, `azerbaijani`, `basque`, `bengali`, `catalan`, `chinese`, `danish`, `dutch`, `english`, `finnish`, `french`, `german`, `greek`, `hebrew`, `hinglish`, `hungarian`, `indonesian`, `italian`, `japanese`, `kazakh`, `nepali`, `norwegian`, `portuguese`, `romanian`, `russian`, `slovene`, `spanish`, `swedish`, `tajik`, `turkish`
- StopwordsSet: StopwordsSet

### StemmingAlgorithm

Different stemming algorithms with their configs.

- SnowballParams: SnowballParams
- DisabledStemmerParams: DisabledStemmerParams

### StopwordsSet

- `languages` (list of enum, optional, nullable) — Set of languages to use for stopwords. Multiple pre-defined lists of stopwords can be combined.
  - Allowed values: `arabic`, `azerbaijani`, `basque`, `bengali`, `catalan`, `chinese`, `danish`, `dutch`, `english`, `finnish`, `french`, `german`, `greek`, `hebrew`, `hinglish`, `hungarian`, `indonesian`, `italian`, `japanese`, `kazakh`, `nepali`, `norwegian`, `portuguese`, `romanian`, `russian`, `slovene`, `spanish`, `swedish`, `tajik`, `turkish`
- `custom` (list of string, optional, nullable) — Custom stopwords set. Will be merged with the languages set.

### SnowballParams

- `type` (enum, required)
  - Allowed values: `snowball`
- `language` (enum, required) — Languages supported by snowball stemmer.
  - Allowed values: `arabic`, `armenian`, `danish`, `dutch`, `english`, `finnish`, `french`, `german`, `greek`, `hungarian`, `italian`, `norwegian`, `portuguese`, `romanian`, `russian`, `spanish`, `swedish`, `tamil`, `turkish`

### DisabledStemmerParams

- `type` (enum, required) — Tag selecting the explicit "no stemming" algorithm.
  - Allowed values: `none`

## Examples

**Request**

```json
{
  "field_name": "string"
}
```

**Response**

```json
{
  "usage": {
    "hardware": {
      "cpu": 1,
      "payload_index_io_read": 1,
      "payload_index_io_write": 1,
      "payload_io_read": 1,
      "payload_io_write": 1,
      "vector_io_read": 1,
      "vector_io_write": 1
    },
    "inference": {
      "models": {}
    }
  },
  "time": 0.002,
  "status": "ok",
  "result": {
    "status": "acknowledged",
    "operation_id": 1
  }
}
```

**SDK Code**

```java
import io.qdrant.client.QdrantClient;
import io.qdrant.client.QdrantGrpcClient;

import io.qdrant.client.grpc.Collections.PayloadSchemaType;

QdrantClient client = new QdrantClient(
                QdrantGrpcClient.newBuilder("localhost", 6334, false).build());

client.createPayloadIndexAsync(
                "{collection_name}",
                "{field_name}",
                PayloadSchemaType.Keyword,
                null,
                true,
                null,
                null);

```

```go
package client

import (
	"context"

	"github.com/qdrant/go-client/qdrant"
)

func createFieldIndex() {
	client, err := qdrant.NewClient(&qdrant.Config{
		Host: "localhost",
		Port: 6334,
	})
	if err != nil {
		panic(err)
	}

	_, err = client.CreateFieldIndex(context.Background(), &qdrant.CreateFieldIndexCollection{
		CollectionName: "{collection_name}",
		FieldName:      "name_of_the_field_to_index",
		FieldType:      qdrant.FieldType_FieldTypeKeyword.Enum(),
	})
	if err != nil {
		panic(err)
	}
}

```

```csharp
using Qdrant.Client;

var client = new QdrantClient("localhost", 6334);

await client.CreatePayloadIndexAsync(
  collectionName: "{collection_name}",
  fieldName: "name_of_the_field_to_index"
);

```

```typescript
import { QdrantClient } from "@qdrant/js-client-rest";

const client = new QdrantClient({ host: "localhost", port: 6333 });

client.createPayloadIndex("{collection_name}", {
  field_name: "{field_name}",
  field_schema: "keyword",
});

```

```rust
use qdrant_client::qdrant::{CreateFieldIndexCollectionBuilder, FieldType};
use qdrant_client::Qdrant;

let client = Qdrant::from_url("http://localhost:6334").build()?;

client
    .create_field_index(
        CreateFieldIndexCollectionBuilder::new(
            "{collection_name}",
            "{field_name}",
            FieldType::Keyword,
        ),
    )
    .await?;

```

```python
from qdrant_client import QdrantClient

client = QdrantClient(url="http://localhost:6333")

client.create_payload_index(
    collection_name="{collection_name}",
    field_name="name_of_the_field_to_index",
    field_schema="keyword",
)

```

```ruby
require 'uri'
require 'net/http'

url = URI("http://localhost:6333/collections/collection_name/index")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Put.new(url)
request["api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"field_name\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'http://localhost:6333/collections/collection_name/index', [
  'body' => '{
  "field_name": "string"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```swift
import Foundation

let headers = [
  "api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["field_name": "string"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:6333/collections/collection_name/index")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```