> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://api.qdrant.tech/v-1-10-x/api-reference/indexes/create-field-index/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) — API Key authentication via header ## Servers - `http://localhost:6333` (http, default) - `https://localhost:6333` (https) ## 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` ### Body (application/json) This endpoint expects a CreateFieldIndex. - `field_name` (string, required) - `field_schema` (CreateFieldIndexFieldSchema, optional) ## Response ### 200 successful operation - `time` (double, optional) — Time spent to process this request - `status` (string, optional) - `result` (UpdateResult, optional) ## Types ### CreateFieldIndexFieldSchema ### UpdateResult - `status` (enum, required) — `Acknowledged` - Request is saved to WAL and will be process in a queue. `Completed` - Request is completed, changes are actual. - Allowed values: `acknowledged`, `completed` - `operation_id` (uint64, optional, nullable) — Sequential number of the operation ## Examples **Request** ```json { "field_name": "string" } ``` **Response** ```json { "time": 1.1, "status": "string", "result": { "status": "acknowledged", "operation_id": 1 } } ``` **SDK Code** ```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?; ``` ```csharp using Qdrant.Client; var client = new QdrantClient("localhost", 6334); await client.CreatePayloadIndexAsync( collectionName: "{collection_name}", fieldName: "name_of_the_field_to_index" ); ``` ```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); ``` ```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", }); ``` ```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", ) ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "http://localhost:6333/collections/collection_name/index" payload := strings.NewReader("{\n \"field_name\": \"string\"\n}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("api-key", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```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"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"field_name\": \"string\"\n}" response = http.request(request) puts response.read_body ``` ```php request('PUT', 'http://localhost:6333/collections/collection_name/index', [ 'body' => '{ "field_name": "string" }', 'headers' => [ 'Content-Type' => 'application/json', 'api-key' => '', ], ]); echo $response->getBody(); ``` ```swift import Foundation let headers = [ "api-key": "", "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() ```