From bbf8b3c85dcaef0c22439334c9d3f7c913677992 Mon Sep 17 00:00:00 2001 From: George Panchuk Date: Wed, 29 Jan 2025 17:38:28 +0100 Subject: [PATCH 01/14] wip: try deprecating a field --- fern/apis/master/openapi.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fern/apis/master/openapi.json b/fern/apis/master/openapi.json index 2105033..68d159f 100644 --- a/fern/apis/master/openapi.json +++ b/fern/apis/master/openapi.json @@ -578,6 +578,7 @@ "summary": "Search points", "description": "Retrieve closest points based on vector similarity and given filtering conditions", "operationId": "search_points", + "availability": "deprecated", "requestBody": { "description": "Search request with optional filtering", "content": { @@ -4876,6 +4877,7 @@ "Search" ], "summary": "Search batch points", + "deprecated": true, "description": "Retrieve by batch the closest points based on vector similarity and given filtering conditions", "operationId": "search_batch_points", "requestBody": { From 97b6379de19017c3338aab43eac12055a646fa9f Mon Sep 17 00:00:00 2001 From: joein <22641570+joein@users.noreply.github.com> Date: Wed, 29 Jan 2025 16:39:03 +0000 Subject: [PATCH 02/14] Sync OpenAPI --- fern/apis/master/openapi-overrides.yml | 944 +++++----- fern/apis/master/openapi.json | 60 +- fern/apis/v1.13.x/openapi-overrides.yml | 2228 +++++++++++------------ 3 files changed, 1644 insertions(+), 1588 deletions(-) diff --git a/fern/apis/master/openapi-overrides.yml b/fern/apis/master/openapi-overrides.yml index 1a5e44c..d885f8f 100644 --- a/fern/apis/master/openapi-overrides.yml +++ b/fern/apis/master/openapi-overrides.yml @@ -10,6 +10,20 @@ paths: /aliases: get: x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ListAliasesAsync(); + +' + language: csharp + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/aliases' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'use qdrant_client::Qdrant; @@ -33,36 +47,22 @@ paths: ' language: python - code-samples: - - code: 'using Qdrant.Client; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - var client = new QdrantClient("localhost", 6334); + const client = new QdrantClient({ host: "localhost", port: 6333 }); - await client.ListAliasesAsync(); + client.getAliases(); ' - language: csharp - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/aliases' \\\n --header 'api-key: '" - language: curl + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listAliasesAsync().get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc listAliases() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\taliases, err := client.ListAliases(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Aliases: \", aliases)\n}\n" language: go - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.getAliases(); - -' - language: typescript description: Retrieves a list of all existing aliases. summary: List all aliases tags: @@ -70,6 +70,20 @@ paths: /collections: get: x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ListCollectionsAsync(); + +' + language: csharp + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/collections' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'use qdrant_client::Qdrant; @@ -93,36 +107,22 @@ paths: ' language: python - code-samples: - - code: 'using Qdrant.Client; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - var client = new QdrantClient("localhost", 6334); + const client = new QdrantClient({ host: "localhost", port: 6333 }); - await client.ListCollectionsAsync(); + client.getCollections(); ' - language: csharp - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections' \\\n --header 'api-key: '" - language: curl + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listCollectionsAsync().get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc listCollections() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tcollections, err := client.ListCollections(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Collections: \", collections)\n}\n" language: go - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.getCollections(); - -' - language: typescript description: Returns a list of all existing collections. summary: List all collections tags: @@ -130,12 +130,6 @@ paths: /collections/aliases: post: x-fern-examples: - - code-samples: - - code: "use qdrant_client::qdrant::{CreateAliasBuilder, DeleteAlias};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .create_alias(CreateAliasBuilder::new(\n \"example_collection\",\n \"production_collection\",\n ))\n .await?;\n\nclient\n .delete_alias(DeleteAlias {\n alias_name: \"production_collection\".to_string(),\n })\n .await?;\n" - language: rust - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.update_collection_aliases(\n change_aliases_operations=[\n models.CreateAliasOperation(\n create_alias=models.CreateAlias(\n collection_name=\"example_collection\", alias_name=\"production_collection\"\n )\n )\n ]\n)\n\nclient.update_collection_aliases(\n change_aliases_operations=[\n models.DeleteAliasOperation(\n delete_alias=models.DeleteAlias(alias_name=\"production_collection\")\n ),\n ]\n)\n" - language: python - code-samples: - code: 'using Qdrant.Client; @@ -153,15 +147,21 @@ paths: - code-samples: - code: "# Create an alias\ncurl -X POST \\\n 'http://localhost:6333/collections/aliases' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"actions\": [\n {\n \"create_alias\": {\n \"collection_name\": \"{collection_name}\",\n \"alias_name\": \"{alias_name}\"\n }\n }\n ]\n}'\n\n# Delete an alias\ncurl -X POST \\\n 'http://localhost:6333/collections/aliases' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"actions\": [\n {\n \"delete_alias\": {\n \"alias_name\": \"{alias_name}\"\n }\n }\n ]\n}'\n\n# Rename an alias\ncurl -X POST \\\n 'http://localhost:6333/collections/aliases' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"actions\": [\n {\n \"rename_alias\": {\n \"old_alias_name\": \"{old_alias_name}\",\n \"new_alias_name\": \"{new_alias_name}\"\n }\n }\n ]\n}'\n" language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{CreateAliasBuilder, DeleteAlias};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .create_alias(CreateAliasBuilder::new(\n \"example_collection\",\n \"production_collection\",\n ))\n .await?;\n\nclient\n .delete_alias(DeleteAlias {\n alias_name: \"production_collection\".to_string(),\n })\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.update_collection_aliases(\n change_aliases_operations=[\n models.CreateAliasOperation(\n create_alias=models.CreateAlias(\n collection_name=\"example_collection\", alias_name=\"production_collection\"\n )\n )\n ]\n)\n\nclient.update_collection_aliases(\n change_aliases_operations=[\n models.DeleteAliasOperation(\n delete_alias=models.DeleteAlias(alias_name=\"production_collection\")\n ),\n ]\n)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.updateCollectionAliases({\n actions: [\n {\n create_alias: {\n collection_name: \"example_collection\",\n alias_name: \"production_collection\",\n },\n },\n ],\n});\n\nclient.updateCollectionAliases({\n actions: [\n {\n delete_alias: {\n alias_name: \"production_collection\",\n },\n },\n ],\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.DeleteShardKey;\nimport io.qdrant.client.grpc.Collections.DeleteShardKeyRequest;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createAliasAsync(\"production_collection\", \"example_collection\").get();\n\nclient.deleteAliasAsync(\"production_collection\").get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc updateAlias() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.CreateAlias(context.Background(), \"production_collection\", \"example_collection\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteAlias(context.Background(), \"production_collection\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.RenameAlias(context.Background(), \"production_collection\", \"legacy_collection\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.updateCollectionAliases({\n actions: [\n {\n create_alias: {\n collection_name: \"example_collection\",\n alias_name: \"production_collection\",\n },\n },\n ],\n});\n\nclient.updateCollectionAliases({\n actions: [\n {\n delete_alias: {\n alias_name: \"production_collection\",\n },\n },\n ],\n});\n" - language: typescript description: Updates aliases for the specified collections. summary: Update collection aliases tags: @@ -169,6 +169,20 @@ paths: /collections/{collection_name}: delete: x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.DeleteCollectionAsync("{collection_name}"); + +' + language: csharp + - code-samples: + - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'use qdrant_client::Qdrant; @@ -192,42 +206,42 @@ paths: ' language: python - code-samples: - - code: 'using Qdrant.Client; + - code: 'import { QdrantClient } from ''@qdrant/qdrant-js''; - var client = new QdrantClient("localhost", 6334); + const client = new QdrantClient({url: ''http://127.0.0.1:6333''}); - await client.DeleteCollectionAsync("{collection_name}"); + client.deleteCollection("{collection_name}"); ' - language: csharp - - code-samples: - - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: '" - language: curl + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteCollectionAsync(\"{collection_name}\").get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteCollection(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go + description: Drops the specified collection and all associated data in it. + summary: Delete a collection + tags: + - Collections + get: + x-fern-examples: - code-samples: - - code: 'import { QdrantClient } from ''@qdrant/qdrant-js''; + - code: 'using Qdrant.Client; - const client = new QdrantClient({url: ''http://127.0.0.1:6333''}); + var client = new QdrantClient("localhost", 6334); - client.deleteCollection("{collection_name}"); + await client.GetCollectionInfoAsync("{collection_name}"); ' - language: typescript - description: Drops the specified collection and all associated data in it. - summary: Delete a collection - tags: - - Collections - get: - x-fern-examples: + language: csharp + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'use qdrant_client::Qdrant; @@ -251,42 +265,34 @@ paths: ' language: python - code-samples: - - code: 'using Qdrant.Client; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - var client = new QdrantClient("localhost", 6334); + const client = new QdrantClient({ host: "localhost", port: 6333 }); - await client.GetCollectionInfoAsync("{collection_name}"); + client.getCollection("{collection_name}"); ' - language: csharp - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: '" - language: curl + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.getCollectionInfoAsync(\"{collection_name}\").get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc getCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tinfo, err := client.GetCollectionInfo(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Collection info: \", info)\n}\n" language: go - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.getCollection("{collection_name}"); - -' - language: typescript description: Retrieves parameters from the specified collection. summary: Get collection details tags: - Collections patch: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateCollectionAsync(\n collectionName: \"{collection_name}\",\n optimizersConfig: new OptimizersConfigDiff { IndexingThreshold = 10000 }\n);\n" + language: csharp + - code-samples: + - code: "curl -X PATCH \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"optimizers_config\": {\n \"indexing_threshold\": 10000\n }\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{OptimizersConfigDiffBuilder, UpdateCollectionBuilder};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .update_collection(\n UpdateCollectionBuilder::new(\"{collection_name}\").optimizers_config(\n OptimizersConfigDiffBuilder::default().indexing_threshold(10_000),\n ),\n )\n .await?;\n" language: rust @@ -294,26 +300,26 @@ paths: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.update_collection(\n collection_name=\"{collection_name}\",\n optimizer_config=models.OptimizersConfigDiff(indexing_threshold=10000),\n)\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateCollectionAsync(\n collectionName: \"{collection_name}\",\n optimizersConfig: new OptimizersConfigDiff { IndexingThreshold = 10000 }\n);\n" - language: csharp - - code-samples: - - code: "curl -X PATCH \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"optimizers_config\": {\n \"indexing_threshold\": 10000\n }\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.updateCollection(\"{collection_name}\", {\n optimizers_config: {\n indexing_threshold: 10000,\n },\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.OptimizersConfigDiff;\nimport io.qdrant.client.grpc.Collections.UpdateCollection;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.updateCollectionAsync(\n UpdateCollection.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setOptimizersConfig(\n OptimizersConfigDiff.newBuilder().setIndexingThreshold(10000).build())\n .build());\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc updateCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tthreshold := uint64(10000)\n\terr = client.UpdateCollection(context.Background(), &qdrant.UpdateCollection{\n\t\tCollectionName: \"{collection_name}\",\n\t\tOptimizersConfig: &qdrant.OptimizersConfigDiff{\n\t\t\tIndexingThreshold: &threshold,\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.updateCollection(\"{collection_name}\", {\n optimizers_config: {\n indexing_threshold: 10000,\n },\n});\n" - language: typescript description: Updates the parameters of the specified collection. summary: Update collection parameters tags: - Collections put: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.CreateCollectionAsync(\n\tcollectionName: \"{collection_name}\",\n\tvectorsConfig: new VectorParams { Size = 100, Distance = Distance.Cosine }\n);\n\n// Or with sparse vectors\n\nawait client.CreateCollectionAsync(\n\tcollectionName: \"{collection_name}\",\n\tsparseVectorsConfig: (\"splade-model-name\", new SparseVectorParams{\n Index = new SparseIndexConfig {\n OnDisk = false,\n }\n })\n);" + language: csharp + - code-samples: + - code: "# Create a collection with default dense vector\ncurl -X PUT \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"vectors\": {\n \"size\": 384,\n \"distance\": \"Cosine\"\n }\n}'\n\n# Create a collection with named dense and sparse vectors\ncurl -X PUT \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"vectors\": {\n \"dense-vector-name\": {\n \"size\": 1536,\n \"distance\": \"Cosine\"\n },\n \"sparse_vectors\": {\n \"sparse-vector-name\": {\n \"index\": {\n \"on_disk\": true\n }\n }\n }\n }\n}'\n" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{CreateCollectionBuilder, Distance, VectorParamsBuilder};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .create_collection(\n CreateCollectionBuilder::new(\"{collection_name}\")\n .vectors_config(VectorParamsBuilder::new(100, Distance::Cosine)),\n )\n .await?;\n" language: rust @@ -321,20 +327,14 @@ paths: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.create_collection(\n collection_name=\"{collection_name}\",\n vectors_config=models.VectorParams(size=100, distance=models.Distance.COSINE),\n)\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.CreateCollectionAsync(\n\tcollectionName: \"{collection_name}\",\n\tvectorsConfig: new VectorParams { Size = 100, Distance = Distance.Cosine }\n);\n\n// Or with sparse vectors\n\nawait client.CreateCollectionAsync(\n\tcollectionName: \"{collection_name}\",\n\tsparseVectorsConfig: (\"splade-model-name\", new SparseVectorParams{\n Index = new SparseIndexConfig {\n OnDisk = false,\n }\n })\n);" - language: csharp - - code-samples: - - code: "# Create a collection with default dense vector\ncurl -X PUT \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"vectors\": {\n \"size\": 384,\n \"distance\": \"Cosine\"\n }\n}'\n\n# Create a collection with named dense and sparse vectors\ncurl -X PUT \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"vectors\": {\n \"dense-vector-name\": {\n \"size\": 1536,\n \"distance\": \"Cosine\"\n },\n \"sparse_vectors\": {\n \"sparse-vector-name\": {\n \"index\": {\n \"on_disk\": true\n }\n }\n }\n }\n}'\n" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.createCollection(\"{collection_name}\", {\n vectors: { size: 100, distance: \"Cosine\" },\n});\n\n// or with sparse vectors\n\nclient.createCollection(\"{collection_name}\", {\n vectors: { size: 100, distance: \"Cosine\" },\n sparse_vectors: {\n \"splade-model-name\": {\n index: {\n on_disk: false\n }\n }\n }\n});" + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.Distance;\nimport io.qdrant.client.grpc.Collections.VectorParams;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createCollectionAsync(\"{collection_name}\",\n VectorParams.newBuilder().setDistance(Distance.Cosine).setSize(100).build()).get();\n\n// Or with sparse vectors\n\nclient.createCollectionAsync(\n CreateCollection.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setSparseVectorsConfig(\n Collections.SparseVectorConfig.newBuilder().putMap(\n \"splade-model-name\",\n Collections.SparseVectorParams.newBuilder()\n .setIndex(\n Collections.SparseIndexConfig\n .newBuilder()\n .setOnDisk(false)\n .build()\n ).build()\n ).build()\n ).build()\n).get();" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc createCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.CreateCollection(context.Background(), &qdrant.CreateCollection{\n\t\tCollectionName: \"{collection_name}\",\n\t\tVectorsConfig: qdrant.NewVectorsConfig(&qdrant.VectorParams{\n\t\t\tSize: 100,\n\t\t\tDistance: qdrant.Distance_Cosine,\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.createCollection(\"{collection_name}\", {\n vectors: { size: 100, distance: \"Cosine\" },\n});\n\n// or with sparse vectors\n\nclient.createCollection(\"{collection_name}\", {\n vectors: { size: 100, distance: \"Cosine\" },\n sparse_vectors: {\n \"splade-model-name\": {\n index: {\n on_disk: false\n }\n }\n }\n});" - language: typescript description: Creates a new collection with the given parameters. summary: Create a collection tags: @@ -342,6 +342,20 @@ paths: /collections/{collection_name}/aliases: get: x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ListCollectionAliasesAsync("{collection_name}"); + +' + language: csharp + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/aliases' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'use qdrant_client::Qdrant; @@ -365,36 +379,22 @@ paths: ' language: python - code-samples: - - code: 'using Qdrant.Client; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - var client = new QdrantClient("localhost", 6334); + const client = new QdrantClient({ host: "localhost", port: 6333 }); - await client.ListCollectionAliasesAsync("{collection_name}"); + client.getCollectionAliases("{collection_name}"); ' - language: csharp - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/aliases' \\\n --header 'api-key: '" - language: curl + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listCollectionAliasesAsync(\"{collection_name}\").get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc listCollectionAliases() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\taliases, err := client.ListCollectionAliases(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Collection aliases: \", aliases)\n}\n" language: go - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.getCollectionAliases("{collection_name}"); - -' - language: typescript description: Retrieves a list of all aliases for the specified collection. summary: List collection aliases tags: @@ -402,6 +402,20 @@ paths: /collections/{collection_name}/exists: get: x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.CollectionExistsAsync("{collection_name}"); + +' + language: csharp + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/exists' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'use qdrant_client::Qdrant; @@ -423,19 +437,16 @@ paths: client.collection_exists(collection_name="{collection_name}")' language: python - code-samples: - - code: 'using Qdrant.Client; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - var client = new QdrantClient("localhost", 6334); + const client = new QdrantClient({ host: "localhost", port: 6333 }); - await client.CollectionExistsAsync("{collection_name}"); + client.collectionExists("{collection_name}"); ' - language: csharp - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/exists' \\\n --header 'api-key: '" - language: curl + language: typescript - code-samples: - code: 'import static io.qdrant.client.ConditionFactory.matchKeyword; @@ -458,17 +469,6 @@ paths: - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc collectionExists() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\texists, err := client.CollectionExists(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Collection exists: \", exists)\n}\n" language: go - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.collectionExists("{collection_name}"); - -' - language: typescript description: Checks whether the specified collection exists. summary: Check collection existence tags: @@ -476,6 +476,9 @@ paths: /collections/{collection_name}/facet: post: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.FacetAsync(\n\t\"{collection_name}\",\n\tfilter: MatchKeyword(\"color\", \"red\"),\n\tkey: \"my-payload-key\",\n\tlimit: 10\n);" + language: csharp - code-samples: - code: "use qdrant_client::qdrant::{Condition, FacetCountsBuilder, Filter};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .facet(\n FacetCountsBuilder::new(\"{collection_name}\", \"my-payload-key\")\n .limit(10)\n .filter(Filter::must(vec![Condition::matches(\n \"color\",\n \"red\".to_string(),\n )])),\n )\n .await?;" language: rust @@ -483,17 +486,14 @@ paths: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.facet(\n collection_name=\"{collection_name}\",\n key=\"my-payload-key\",\n facet_filter=models.Filter(must=[models.Match(\"color\", \"red\")]),\n limit=10,\n)\n\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.FacetAsync(\n\t\"{collection_name}\",\n\tfilter: MatchKeyword(\"color\", \"red\"),\n\tkey: \"my-payload-key\",\n\tlimit: 10\n);" - language: csharp + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.facet(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n key: \"my-payload-key\",\n limit: 10,\n});\n" + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\nimport io.qdrant.client.grpc.Points;\nimport io.qdrant.client.grpc.Filter;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .facetAsync(\n Points.FacetCounts.newBuilder()\n .setCollectionName(collection_name)\n .setKey(\"my-payload-key\")\n .setFilter(\n Filter.newBuilder()\n .addMust(matchKeyword(\"color\", \"red\"))\n .build())\n .build())\n .get();" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc facet() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tlimit := uint64(10)\n\tresults, err := client.Facet(context.Background(), &qdrant.FacetCounts{\n\t\tCollectionName: \"{collection_name}\",\n\t\tKey: \"my-payload-key\",\n\t\tLimit: &limit,\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.facet(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n key: \"my-payload-key\",\n limit: 10,\n});\n" - language: typescript description: Retrieves facets for the specified payload field. summary: Payload field facets tags: @@ -501,6 +501,12 @@ paths: /collections/{collection_name}/index: put: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.CreatePayloadIndexAsync(\n collectionName: \"{collection_name}\",\n fieldName: \"name_of_the_field_to_index\"\n);\n" + language: csharp + - code-samples: + - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/index' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"field_name\": \"field_name\",\n \"field_schema\": \"keyword\"\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{CreateFieldIndexCollectionBuilder, FieldType};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .create_field_index(\n CreateFieldIndexCollectionBuilder::new(\n \"{collection_name}\",\n \"{field_name}\",\n FieldType::Keyword,\n ),\n )\n .await?;\n" language: rust @@ -508,20 +514,14 @@ paths: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.create_payload_index(\n collection_name=\"{collection_name}\",\n field_name=\"name_of_the_field_to_index\",\n field_schema=\"keyword\",\n)\n" language: python - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.CreatePayloadIndexAsync(\n collectionName: \"{collection_name}\",\n fieldName: \"name_of_the_field_to_index\"\n);\n" - language: csharp - - code-samples: - - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/index' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"field_name\": \"field_name\",\n \"field_schema\": \"keyword\"\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.createPayloadIndex(\"{collection_name}\", {\n field_name: \"{field_name}\",\n field_schema: \"keyword\",\n});\n" + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.PayloadSchemaType;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createPayloadIndexAsync(\n \"{collection_name}\",\n \"{field_name}\",\n PayloadSchemaType.Keyword,\n null,\n true,\n null,\n null);\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc createFieldIndex() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.CreateFieldIndex(context.Background(), &qdrant.CreateFieldIndexCollection{\n\t\tCollectionName: \"{collection_name}\",\n\t\tFieldName: \"name_of_the_field_to_index\",\n\t\tFieldType: qdrant.FieldType_FieldTypeKeyword.Enum(),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.createPayloadIndex(\"{collection_name}\", {\n field_name: \"{field_name}\",\n field_schema: \"keyword\",\n});\n" - language: typescript description: Creates a payload index for a field in the specified collection. summary: Create payload index tags: @@ -529,6 +529,12 @@ paths: /collections/{collection_name}/index/{field_name}: delete: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.DeletePayloadIndexAsync(\n collectionName: \"{collection_name}\",\n fieldName: \"name_of_the_field_to_index\"\n);\n" + language: csharp + - code-samples: + - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/index/field_name' \\\n --header 'api-key: '" + language: curl - code-samples: - code: "use qdrant_client::qdrant::DeleteFieldIndexCollectionBuilder;\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .delete_field_index(DeleteFieldIndexCollectionBuilder::new(\n \"{collection_name}\",\n \"{field_name}\",\n ))\n .await?;\n" language: rust @@ -543,18 +549,6 @@ paths: ' language: python - - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.DeletePayloadIndexAsync(\n collectionName: \"{collection_name}\",\n fieldName: \"name_of_the_field_to_index\"\n);\n" - language: csharp - - code-samples: - - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/index/field_name' \\\n --header 'api-key: '" - language: curl - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deletePayloadIndexAsync(\"{collection_name}\", \"{field_name}\", true, null, null).get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteFieldIndex() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.DeleteFieldIndex(context.Background(), &qdrant.DeleteFieldIndexCollection{\n\t\tCollectionName: \"{collection_name}\",\n\t\tFieldName: \"{field_name}\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -566,6 +560,12 @@ paths: ' language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deletePayloadIndexAsync(\"{collection_name}\", \"{field_name}\", true, null, null).get();\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteFieldIndex() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.DeleteFieldIndex(context.Background(), &qdrant.DeleteFieldIndexCollection{\n\t\tCollectionName: \"{collection_name}\",\n\t\tFieldName: \"{field_name}\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go description: Deletes a payload index for a field in the specified collection. summary: Delete payload index tags: @@ -573,6 +573,12 @@ paths: /collections/{collection_name}/points: post: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RetrieveAsync(\n collectionName: \"{collection_name}\",\n ids: [0, 30, 100],\n withPayload: false,\n withVectors: false\n);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"ids\": [\n 0,\n 3,\n 100\n ]\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::GetPointsBuilder;\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .get_points(GetPointsBuilder::new(\n \"{collection_name}\",\n vec![0.into(), 30.into(), 100.into()],\n ))\n .await?;\n" language: rust @@ -580,26 +586,26 @@ paths: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.retrieve(\n collection_name=\"{collection_name}\",\n ids=[0, 3, 100],\n)\n" language: python - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RetrieveAsync(\n collectionName: \"{collection_name}\",\n ids: [0, 30, 100],\n withPayload: false,\n withVectors: false\n);\n" - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"ids\": [\n 0,\n 3,\n 100\n ]\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.retrieve(\"{collection_name}\", {\n ids: [0, 3, 100],\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .retrieveAsync(\"{collection_name}\", List.of(id(0), id(30), id(100)), false, false, null)\n .get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc getPoints() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tpoints, err := client.Get(context.Background(), &qdrant.GetPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tIds: []*qdrant.PointId{\n\t\t\tqdrant.NewIDNum(0), qdrant.NewID(\"3\"), qdrant.NewIDNum(100),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Points: \", points)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.retrieve(\"{collection_name}\", {\n ids: [0, 3, 100],\n});\n" - language: typescript description: Retrieves all details from multiple points. summary: Retrieve points tags: - Points put: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.UpsertAsync(\n collectionName: \"{collection_name}\",\n points: new List\n {\n new()\n {\n Id = 1,\n Vectors = new[] { 0.9f, 0.1f, 0.1f },\n Payload = { [\"city\"] = \"red\" }\n },\n new()\n {\n Id = 2,\n Vectors = new[] { 0.1f, 0.9f, 0.1f },\n Payload = { [\"city\"] = \"green\" }\n },\n new()\n {\n Id = 3,\n Vectors = new[] { 0.1f, 0.1f, 0.9f },\n Payload = { [\"city\"] = \"blue\" }\n }\n }\n);\n" + language: csharp + - code-samples: + - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"points\": [\n {\n \"id\": \"76874cce-1fb9-4e16-9b0b-f085ac06ed6f\",\n \"payload\": {\n \"color\": \"red\"\n },\n \"vector\": [\n 0.9,\n 0.1,\n 0.1\n ]\n },\n {\n \"id\": 1,\n \"payload\": {\n \"color\": \"green\"\n },\n \"vector\": [\n 0.1,\n 0.9,\n 0.1\n ]\n },\n {\n \"id\": 2,\n \"payload\": {\n \"color\": \"blue\"\n },\n \"vector\": [\n 0.1,\n 0.1,\n 0.9\n ]\n }\n ]\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{PointStruct, UpsertPointsBuilder};\nuse qdrant_client::{Qdrant, Payload};\nuse serde_json::json;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .upsert_points(\n UpsertPointsBuilder::new(\n \"{collection_name}\",\n vec![\n PointStruct::new(\n 1,\n vec![0.9, 0.1, 0.1],\n Payload::try_from(json!(\n {\"color\": \"red\"}\n ))\n .unwrap(),\n ),\n PointStruct::new(\n 2,\n vec![0.1, 0.9, 0.1],\n Payload::try_from(json!(\n {\"color\": \"green\"}\n ))\n .unwrap(),\n ),\n PointStruct::new(\n 3,\n vec![0.1, 0.1, 0.9],\n Payload::try_from(json!(\n {\"color\": \"blue\"}\n ))\n .unwrap(),\n ),\n ],\n )\n .wait(true),\n )\n .await?;\n" language: rust @@ -607,20 +613,14 @@ paths: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.upsert(\n collection_name=\"{collection_name}\",\n points=[\n models.PointStruct(\n id=1,\n payload={\n \"color\": \"red\",\n },\n vector=[0.9, 0.1, 0.1],\n ),\n models.PointStruct(\n id=2,\n payload={\n \"color\": \"green\",\n },\n vector=[0.1, 0.9, 0.1],\n ),\n models.PointStruct(\n id=3,\n payload={\n \"color\": \"blue\",\n },\n vector=[0.1, 0.1, 0.9],\n ),\n ],\n)\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.UpsertAsync(\n collectionName: \"{collection_name}\",\n points: new List\n {\n new()\n {\n Id = 1,\n Vectors = new[] { 0.9f, 0.1f, 0.1f },\n Payload = { [\"city\"] = \"red\" }\n },\n new()\n {\n Id = 2,\n Vectors = new[] { 0.1f, 0.9f, 0.1f },\n Payload = { [\"city\"] = \"green\" }\n },\n new()\n {\n Id = 3,\n Vectors = new[] { 0.1f, 0.1f, 0.9f },\n Payload = { [\"city\"] = \"blue\" }\n }\n }\n);\n" - language: csharp - - code-samples: - - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"points\": [\n {\n \"id\": \"76874cce-1fb9-4e16-9b0b-f085ac06ed6f\",\n \"payload\": {\n \"color\": \"red\"\n },\n \"vector\": [\n 0.9,\n 0.1,\n 0.1\n ]\n },\n {\n \"id\": 1,\n \"payload\": {\n \"color\": \"green\"\n },\n \"vector\": [\n 0.1,\n 0.9,\n 0.1\n ]\n },\n {\n \"id\": 2,\n \"payload\": {\n \"color\": \"blue\"\n },\n \"vector\": [\n 0.1,\n 0.1,\n 0.9\n ]\n }\n ]\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.upsert(\"{collection_name}\", {\n points: [\n {\n id: 1,\n payload: { color: \"red\" },\n vector: [0.9, 0.1, 0.1],\n },\n {\n id: 2,\n payload: { color: \"green\" },\n vector: [0.1, 0.9, 0.1],\n },\n {\n id: 3,\n payload: { color: \"blue\" },\n vector: [0.1, 0.1, 0.9],\n },\n ],\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.PointStruct;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .upsertAsync(\n \"{collection_name}\",\n List.of(\n PointStruct.newBuilder()\n .setId(id(1))\n .setVectors(\n namedVectors(\n Map.of(\n \"image\",\n vector(List.of(0.9f, 0.1f, 0.1f, 0.2f)),\n \"text\",\n vector(List.of(0.4f, 0.7f, 0.1f, 0.8f, 0.1f, 0.1f, 0.9f, 0.2f)))))\n .build(),\n PointStruct.newBuilder()\n .setId(id(2))\n .setVectors(\n namedVectors(\n Map.of(\n \"image\",\n List.of(0.2f, 0.1f, 0.3f, 0.9f),\n \"text\",\n List.of(0.5f, 0.2f, 0.7f, 0.4f, 0.7f, 0.2f, 0.3f, 0.9f))))\n .build()))\n .get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc upsert() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresponse, err := client.Upsert(context.Background(), &qdrant.UpsertPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: []*qdrant.PointStruct{\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(1),\n\t\t\t\tVectors: qdrant.NewVectors(0.9, 0.1, 0.1),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\t\t\"color\": \"red\",\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(2),\n\t\t\t\tVectors: qdrant.NewVectors(0.1, 0.9, 0.1),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\t\t\"color\": \"green\",\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(3),\n\t\t\t\tVectors: qdrant.NewVectors(0.1, 0.1, 0.9),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\t\t\"color\": \"blue\",\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Upsert status: \", response.GetStatus())\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.upsert(\"{collection_name}\", {\n points: [\n {\n id: 1,\n payload: { color: \"red\" },\n vector: [0.9, 0.1, 0.1],\n },\n {\n id: 2,\n payload: { color: \"green\" },\n vector: [0.1, 0.9, 0.1],\n },\n {\n id: 3,\n payload: { color: \"blue\" },\n vector: [0.1, 0.1, 0.9],\n },\n ],\n});\n" - language: typescript description: Performs the insert + update action on specified points. Any point with an existing {id} will be overwritten. summary: Upsert points tags: @@ -628,6 +628,12 @@ paths: /collections/{collection_name}/points/batch: post: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateBatchAsync(\n \"{collection_name}\",\n [\n new()\n {\n Upsert = new()\n {\n Points =\n {\n new PointStruct { Id = 1, Vectors = new[] { 0.9f, 0.1f, 0.1f } },\n }\n }\n },\n new()\n {\n UpdateVectors = new()\n {\n Points =\n {\n new PointVectors { Id = 1, Vectors = new[] { 0.9f, 0.1f, 0.1f } },\n }\n }\n },\n new()\n {\n SetPayload = new()\n {\n PointsSelector = new PointsSelector { Points = new PointsIdsList { Ids = { 1 } } },\n Payload = { [\"test_payload_2\"] = 2, [\"test_payload_3\"] = 3 }\n }\n }\n ]\n);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/batch' \\\n --header 'Content-Type: application/json' \\\n --header 'api-key: ' \\\n --data-raw '{\n \"operations\": [\n {\n \"upsert\": {\n \"points\": [\n {\n \"id\": 1,\n \"vector\": [\n 0.4,\n 0.3,\n 0.2,\n 0.1\n ]\n }\n ]\n }\n },\n {\n \"update_vectors\": {\n \"points\": [\n {\n \"id\": 1,\n \"vector\": [\n 0.11,\n 0.22,\n 0.33,\n 0.44\n ]\n }\n ]\n }\n },\n {\n \"set_payload\": {\n \"payload\": {\n \"test_payload_2\": 2,\n \"test_payload_3\": 3\n },\n \"points\": [\n 1\n ]\n }\n }\n ]\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{\n points_selector::PointsSelectorOneOf,\n points_update_operation::{\n Operation, OverwritePayload, PointStructList, UpdateVectors,\n },\n PointStruct, PointVectors, PointsIdsList, PointsSelector, PointsUpdateOperation,\n UpdateBatchPointsBuilder,\n};\nuse qdrant_client::{Qdrant, Payload};\nuse serde_json::json;\nuse std::collections::HashMap;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .update_points_batch(\n UpdateBatchPointsBuilder::new(\n \"{collection_name}\",\n vec![\n PointsUpdateOperation {\n operation: Some(Operation::Upsert(PointStructList {\n points: vec![PointStruct::new(\n 1,\n vec![1.0, 2.0, 3.0, 4.0],\n Payload::try_from(json!({})).unwrap(),\n )],\n ..Default::default()\n })),\n },\n PointsUpdateOperation {\n operation: Some(Operation::UpdateVectors(UpdateVectors {\n points: vec![PointVectors {\n id: Some(1.into()),\n vectors: Some(vec![1.0, 2.0, 3.0, 4.0].into()),\n }],\n ..Default::default()\n })),\n },\n PointsUpdateOperation {\n operation: Some(Operation::OverwritePayload(OverwritePayload {\n points_selector: Some(PointsSelector {\n points_selector_one_of: Some(PointsSelectorOneOf::Points(\n PointsIdsList {\n ids: vec![1.into()],\n },\n )),\n }),\n payload: HashMap::from([(\"test_payload\".to_string(), 1.into())]),\n ..Default::default()\n })),\n },\n ],\n )\n .wait(true),\n )\n .await?;\n" language: rust @@ -635,20 +641,14 @@ paths: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.batch_update_points(\n collection_name=\"{collection_name}\",\n update_operations=[\n models.UpsertOperation(\n upsert=models.PointsList(\n points=[\n models.PointStruct(\n id=1,\n vector=[1.0, 2.0, 3.0, 4.0],\n payload={},\n ),\n ]\n )\n ),\n models.UpdateVectorsOperation(\n update_vectors=models.UpdateVectors(\n points=[\n models.PointVectors(\n id=1,\n vector=[1.0, 2.0, 3.0, 4.0],\n )\n ]\n )\n ),\n models.SetPayloadOperation(\n set_payload=models.SetPayload(\n payload={\n \"test_payload_2\": 2,\n \"test_payload_3\": 3,\n },\n points=[1],\n )\n ),\n ],\n)\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateBatchAsync(\n \"{collection_name}\",\n [\n new()\n {\n Upsert = new()\n {\n Points =\n {\n new PointStruct { Id = 1, Vectors = new[] { 0.9f, 0.1f, 0.1f } },\n }\n }\n },\n new()\n {\n UpdateVectors = new()\n {\n Points =\n {\n new PointVectors { Id = 1, Vectors = new[] { 0.9f, 0.1f, 0.1f } },\n }\n }\n },\n new()\n {\n SetPayload = new()\n {\n PointsSelector = new PointsSelector { Points = new PointsIdsList { Ids = { 1 } } },\n Payload = { [\"test_payload_2\"] = 2, [\"test_payload_3\"] = 3 }\n }\n }\n ]\n);\n" - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/batch' \\\n --header 'Content-Type: application/json' \\\n --header 'api-key: ' \\\n --data-raw '{\n \"operations\": [\n {\n \"upsert\": {\n \"points\": [\n {\n \"id\": 1,\n \"vector\": [\n 0.4,\n 0.3,\n 0.2,\n 0.1\n ]\n }\n ]\n }\n },\n {\n \"update_vectors\": {\n \"points\": [\n {\n \"id\": 1,\n \"vector\": [\n 0.11,\n 0.22,\n 0.33,\n 0.44\n ]\n }\n ]\n }\n },\n {\n \"set_payload\": {\n \"payload\": {\n \"test_payload_2\": 2,\n \"test_payload_3\": 3\n },\n \"points\": [\n 1\n ]\n }\n }\n ]\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.batchUpdate(\"{collection_name}\", {\n operations: [\n {\n upsert: {\n points: [\n {\n id: 1,\n vector: [1.0, 2.0, 3.0, 4.0],\n payload: {},\n },\n ],\n },\n },\n {\n update_vectors: {\n points: [\n {\n id: 1,\n vector: [1.0, 2.0, 3.0, 4.0],\n },\n ],\n },\n },\n {\n set_payload: {\n payload: {\n test_payload_2: 2,\n test_payload_3: 3,\n },\n points: [1],\n },\n },\n ],\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\nimport java.util.Map;\n\nimport static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.ValueFactory.value;\nimport static io.qdrant.client.VectorsFactory.vectors;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.PointStruct;\nimport io.qdrant.client.grpc.Points.PointVectors;\nimport io.qdrant.client.grpc.Points.PointsIdsList;\nimport io.qdrant.client.grpc.Points.PointsSelector;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation.PointStructList;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation.SetPayload;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation.UpdateVectors;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .batchUpdateAsync(\n \"{collection_name}\",\n List.of(\n PointsUpdateOperation.newBuilder()\n .setUpsert(\n PointStructList.newBuilder()\n .addPoints(\n PointStruct.newBuilder()\n .setId(id(1))\n .setVectors(vectors(\n 1.0 f,\n 2.0 f,\n 3.0 f,\n 4.0 f))\n .build())\n .build())\n .build(),\n PointsUpdateOperation.newBuilder()\n .setUpdateVectors(\n UpdateVectors.newBuilder()\n .addPoints(\n PointVectors.newBuilder()\n .setId(id(1))\n .setVectors(vectors(\n 1.0 f,\n 2.0 f,\n 3.0 f,\n 4.0 f))\n .build())\n .build())\n .build(),\n PointsUpdateOperation.newBuilder()\n .setSetPayload(\n SetPayload.newBuilder()\n .setPointsSelector(\n PointsSelector.newBuilder()\n .setPoints(PointsIdsList\n .newBuilder()\n .addIds(id(1))\n .build())\n .build())\n .putAllPayload(\n Map.of(\"test_payload_2\",\n value(2),\n \"test_payload_3\",\n value(3)))\n .build())\n .build()))\n .get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc batchUpdate() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.UpdateBatch(context.Background(), &qdrant.UpdateBatchPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tOperations: []*qdrant.PointsUpdateOperation{\n\t\t\tqdrant.NewPointsUpdateUpsert(&qdrant.PointsUpdateOperation_PointStructList{\n\t\t\t\tPoints: []*qdrant.PointStruct{{\n\t\t\t\t\tId: qdrant.NewIDNum(1),\n\t\t\t\t\tVectors: qdrant.NewVectors(1.0, 2.0, 3.0, 4.0),\n\t\t\t\t}},\n\t\t\t}),\n\t\t\tqdrant.NewPointsUpdateUpdateVectors(&qdrant.PointsUpdateOperation_UpdateVectors{\n\t\t\t\tPoints: []*qdrant.PointVectors{\n\t\t\t\t\t{\n\t\t\t\t\t\tId: qdrant.NewIDNum(1),\n\t\t\t\t\t\tVectors: qdrant.NewVectors(0.1, 0.2, 0.3, 0.4),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t\tqdrant.NewPointsUpdateSetPayload(&qdrant.PointsUpdateOperation_SetPayload{\n\t\t\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(1)),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\t\t\"test_payload_2\": 2,\n\t\t\t\t\t\"test_payload_3\": 3,\n\t\t\t\t}),\n\t\t\t}),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.batchUpdate(\"{collection_name}\", {\n operations: [\n {\n upsert: {\n points: [\n {\n id: 1,\n vector: [1.0, 2.0, 3.0, 4.0],\n payload: {},\n },\n ],\n },\n },\n {\n update_vectors: {\n points: [\n {\n id: 1,\n vector: [1.0, 2.0, 3.0, 4.0],\n },\n ],\n },\n },\n {\n set_payload: {\n payload: {\n test_payload_2: 2,\n test_payload_3: 3,\n },\n points: [1],\n },\n },\n ],\n});\n" - language: typescript description: Batch updates points, including their respective vectors and payloads. summary: Batch update points tags: @@ -656,6 +656,12 @@ paths: /collections/{collection_name}/points/count: post: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.CountAsync(\n collectionName: \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"),\n exact: true\n);\n" + language: csharp + - code-samples: + - code: "# Count total number of points in a collection\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/count' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"exact\": true\n}'\n\n# Count points satisfying a filter condition\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/count' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n },\n \"exact\": true\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{Condition, CountPointsBuilder, Filter};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .count(\n CountPointsBuilder::new(\"{collection_name}\")\n .filter(Filter::must([Condition::matches(\n \"color\",\n \"red\".to_string(),\n )]))\n .exact(true),\n )\n .await?;\n" language: rust @@ -663,20 +669,14 @@ paths: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.count(\n collection_name=\"{collection_name}\",\n count_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n exact=True,\n)\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.CountAsync(\n collectionName: \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"),\n exact: true\n);\n" - language: csharp - - code-samples: - - code: "# Count total number of points in a collection\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/count' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"exact\": true\n}'\n\n# Count points satisfying a filter condition\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/count' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n },\n \"exact\": true\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.count(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n exact: true,\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\n\nQdrantClient client = new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .countAsync(\n \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"color\", \"red\")).build(),\n true)\n .get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc count() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tcount, err := client.Count(context.Background(), &qdrant.CountPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Count:\", count)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.count(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n exact: true,\n});\n" - language: typescript description: Counts the number of points that match a specified filtering condition. summary: Count points tags: @@ -684,12 +684,6 @@ paths: /collections/{collection_name}/points/delete: post: x-fern-examples: - - code-samples: - - code: "use qdrant_client::qdrant::{Condition, DeletePointsBuilder, Filter, PointsIdsList};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .delete_points(\n DeletePointsBuilder::new(\"{collection_name}\")\n .points(PointsIdsList {\n ids: vec![0.into(), 3.into(), 100.into()],\n })\n .wait(true),\n )\n .await?;\n\nclient\n .delete_points(\n DeletePointsBuilder::new(\"{collection_name}\")\n .points(Filter::must([Condition::matches(\n \"color\",\n \"red\".to_string(),\n )]))\n .wait(true),\n )\n .await?;\n" - language: rust - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete(\n collection_name=\"{collection_name}\",\n points_selector=models.PointIdsList(\n points=[0, 3, 100],\n ),\n)\n\nclient.delete(\n collection_name=\"{collection_name}\",\n points_selector=models.FilterSelector(\n filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"color\",\n match=models.MatchValue(value=\"red\"),\n ),\n ],\n )\n ),\n)\n" - language: python - code-samples: - code: 'using Qdrant.Client; @@ -707,15 +701,21 @@ paths: - code-samples: - code: "# Delete points by IDs\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"points\": [\n 0,\n 3,\n 100\n ]\n}'\n\n# Delete points by filter \ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n }\n}'\n" language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{Condition, DeletePointsBuilder, Filter, PointsIdsList};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .delete_points(\n DeletePointsBuilder::new(\"{collection_name}\")\n .points(PointsIdsList {\n ids: vec![0.into(), 3.into(), 100.into()],\n })\n .wait(true),\n )\n .await?;\n\nclient\n .delete_points(\n DeletePointsBuilder::new(\"{collection_name}\")\n .points(Filter::must([Condition::matches(\n \"color\",\n \"red\".to_string(),\n )]))\n .wait(true),\n )\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete(\n collection_name=\"{collection_name}\",\n points_selector=models.PointIdsList(\n points=[0, 3, 100],\n ),\n)\n\nclient.delete(\n collection_name=\"{collection_name}\",\n points_selector=models.FilterSelector(\n filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"color\",\n match=models.MatchValue(value=\"red\"),\n ),\n ],\n )\n ),\n)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.delete(\"{collection_name}\", {\n points: [0, 3, 100],\n});\n\nclient.delete(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteAsync(\"{collection_name}\", List.of(id(0), id(3), id(100)));\n\nclient\n .deleteAsync(\n \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"color\", \"red\")).build())\n .get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc delete() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.Delete(context.Background(), &qdrant.DeletePoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: qdrant.NewPointsSelectorIDs([]*qdrant.PointId{\n\t\t\tqdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(100),\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.Delete(context.Background(), &qdrant.DeletePoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: qdrant.NewPointsSelectorFilter(&qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.delete(\"{collection_name}\", {\n points: [0, 3, 100],\n});\n\nclient.delete(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n});\n" - language: typescript description: Deletes specified points from the collection. summary: Delete points tags: @@ -723,6 +723,12 @@ paths: /collections/{collection_name}/points/discover: post: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.DiscoverAsync(\n collectionName: \"{collection_name}\",\n target: new TargetVector\n {\n Single = new VectorExample { Vector = new float[] { 0.2f, 0.1f, 0.9f, 0.7f }, }\n },\n context:\n [\n new()\n {\n Positive = new VectorExample { Id = 100 },\n Negative = new VectorExample { Id = 718 }\n },\n new()\n {\n Positive = new VectorExample { Id = 200 },\n Negative = new VectorExample { Id = 300 }\n }\n ],\n limit: 10\n);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/discover' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"target\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"context\": [\n {\n \"positive\": \"7f6652c4-89bd-40e0-ab1d-510f7fcddd2b\",\n \"negative\": \"2c2c9f86-0171-4bd2-9ab0-b4754682cddd\"\n }\n ],\n \"limit\": 10\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{\n target_vector::Target, vector_example::Example, ContextExamplePairBuilder,\n DiscoverPointsBuilder, VectorExample,\n};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .discover(\n DiscoverPointsBuilder::new(\n \"{collection_name}\",\n vec![\n ContextExamplePairBuilder::default()\n .positive(Example::Id(100.into()))\n .negative(Example::Id(718.into()))\n .build(),\n ContextExamplePairBuilder::default()\n .positive(Example::Id(200.into()))\n .negative(Example::Id(300.into()))\n .build(),\n ],\n 10,\n )\n .target(Target::Single(VectorExample {\n example: Some(Example::Vector(vec![0.2, 0.1, 0.9, 0.7].into())),\n })),\n )\n .await?;\n" language: rust @@ -730,20 +736,14 @@ paths: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.discover(\n \"{collection_name}\",\n target=[0.2, 0.1, 0.9, 0.7],\n context=[\n models.ContextExamplePair(positive=100, negative=718),\n models.ContextExamplePair(positive=200, negative=300),\n ],\n limit=10,\n)\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.DiscoverAsync(\n collectionName: \"{collection_name}\",\n target: new TargetVector\n {\n Single = new VectorExample { Vector = new float[] { 0.2f, 0.1f, 0.9f, 0.7f }, }\n },\n context:\n [\n new()\n {\n Positive = new VectorExample { Id = 100 },\n Negative = new VectorExample { Id = 718 }\n },\n new()\n {\n Positive = new VectorExample { Id = 200 },\n Negative = new VectorExample { Id = 300 }\n }\n ],\n limit: 10\n);\n" - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/discover' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"target\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"context\": [\n {\n \"positive\": \"7f6652c4-89bd-40e0-ab1d-510f7fcddd2b\",\n \"negative\": \"2c2c9f86-0171-4bd2-9ab0-b4754682cddd\"\n }\n ],\n \"limit\": 10\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.discover(\"{collection_name}\", {\n target: [0.2, 0.1, 0.9, 0.7],\n context: [\n {\n positive: 100,\n negative: 718,\n },\n {\n positive: 200,\n negative: 300,\n },\n ],\n limit: 10,\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.ContextExamplePair;\nimport io.qdrant.client.grpc.Points.DiscoverPoints;\nimport io.qdrant.client.grpc.Points.TargetVector;\nimport io.qdrant.client.grpc.Points.VectorExample;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .discoverAsync(\n DiscoverPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setTarget(\n TargetVector.newBuilder()\n .setSingle(\n VectorExample.newBuilder()\n .setVector(vector(0.2f, 0.1f, 0.9f, 0.7f))\n .build()))\n .addAllContext(\n List.of(\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample.newBuilder().setId(id(100)))\n .setNegative(VectorExample.newBuilder().setId(id(718)))\n .build(),\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample.newBuilder().setId(id(200)))\n .setNegative(VectorExample.newBuilder().setId(id(300)))\n .build()))\n .setLimit(10)\n .build())\n .get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc discover() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresults, err := client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQueryDiscover(&qdrant.DiscoverInput{\n\t\t\tTarget: qdrant.NewVectorInput(0.2, 0.1, 0.9, 0.7),\n\t\t\tContext: &qdrant.ContextInput{\n\t\t\t\tPairs: []*qdrant.ContextInputPair{{\n\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\t\t\t\t}, {\n\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(300)),\n\t\t\t\t}},\n\t\t\t},\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.discover(\"{collection_name}\", {\n target: [0.2, 0.1, 0.9, 0.7],\n context: [\n {\n positive: 100,\n negative: 718,\n },\n {\n positive: 200,\n negative: 300,\n },\n ],\n limit: 10,\n});\n" - language: typescript description: > Retrieves the most similar points to a given target, constrained by the provided context. @@ -757,6 +757,12 @@ paths: /collections/{collection_name}/points/discover/batch: post: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar discoverPoints = new List\n{\n new DiscoverPoints\n {\n CollectionName = \"{collection_name}\",\n Target = new TargetVector\n {\n Single = new VectorExample { Vector = new float[] { 0.2f, 0.1f, 0.9f, 0.7f }, }\n },\n Context =\n {\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 100 },\n Negative = new VectorExample { Id = 718 }\n },\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 200 },\n Negative = new VectorExample { Id = 300 }\n }\n },\n Limit = 10\n },\n new DiscoverPoints\n {\n CollectionName = \"{collection_name}\",\n Target = new TargetVector\n {\n Single = new VectorExample { Vector = new float[] { 0.5f, 0.3f, 0.2f, 0.3f }, }\n },\n Context =\n {\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 342 },\n Negative = new VectorExample { Id = 213 }\n },\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 100 },\n Negative = new VectorExample { Id = 200 }\n }\n },\n Limit = 10\n }\n};\nawait client.DiscoverBatchAsync(\"{collection_name}\", discoverPoints);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/discover/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"target\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"context\": [\n {\n \"positive\": \"7f6652c4-89bd-40e0-ab1d-510f7fcddd2b\",\n \"negative\": \"2c2c9f86-0171-4bd2-9ab0-b4754682cddd\"\n }\n ],\n \"limit\": 1\n },\n {\n \"target\": [\n 0.5,\n 0.3,\n 0.2,\n 0.3\n ],\n \"context\": [\n {\n \"positive\": 342,\n \"negative\": 213\n }\n ],\n \"limit\": 1\n }\n ]\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{\n vector_example::Example, ContextExamplePairBuilder, DiscoverBatchPointsBuilder,\n DiscoverPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet discover_points = DiscoverBatchPointsBuilder::new(\n \"{collection_name}\",\n vec![\n DiscoverPointsBuilder::new(\n \"{collection_name}\",\n vec![\n ContextExamplePairBuilder::default()\n .positive(Example::Id(100.into()))\n .negative(Example::Id(718.into()))\n .build(),\n ContextExamplePairBuilder::default()\n .positive(Example::Id(200.into()))\n .negative(Example::Id(300.into()))\n .build(),\n ],\n 10,\n )\n .build(),\n DiscoverPointsBuilder::new(\n \"{collection_name}\",\n vec![\n ContextExamplePairBuilder::default()\n .positive(Example::Id(342.into()))\n .negative(Example::Id(213.into()))\n .build(),\n ContextExamplePairBuilder::default()\n .positive(Example::Id(100.into()))\n .negative(Example::Id(200.into()))\n .build(),\n ],\n 10,\n )\n .build(),\n ],\n);\n\nclient.discover_batch(&discover_points.build()).await?;\n" language: rust @@ -764,20 +770,14 @@ paths: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\ndiscover_queries = [\n models.DiscoverRequest(\n target=[0.2, 0.1, 0.9, 0.7],\n context=[\n models.ContextExamplePair(\n positive=100,\n negative=718,\n ),\n models.ContextExamplePair(\n positive=200,\n negative=300,\n ),\n ],\n limit=10,\n ),\n models.DiscoverRequest(\n target=[0.5, 0.3, 0.2, 0.3],\n context=[\n models.ContextExamplePair(\n positive=342,\n negative=213,\n ),\n models.ContextExamplePair(\n positive=100,\n negative=200,\n ),\n ],\n limit=5,\n ),\n]\n\nclient.discover_batch(\"{collection_name}\", discover_queries)\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar discoverPoints = new List\n{\n new DiscoverPoints\n {\n CollectionName = \"{collection_name}\",\n Target = new TargetVector\n {\n Single = new VectorExample { Vector = new float[] { 0.2f, 0.1f, 0.9f, 0.7f }, }\n },\n Context =\n {\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 100 },\n Negative = new VectorExample { Id = 718 }\n },\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 200 },\n Negative = new VectorExample { Id = 300 }\n }\n },\n Limit = 10\n },\n new DiscoverPoints\n {\n CollectionName = \"{collection_name}\",\n Target = new TargetVector\n {\n Single = new VectorExample { Vector = new float[] { 0.5f, 0.3f, 0.2f, 0.3f }, }\n },\n Context =\n {\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 342 },\n Negative = new VectorExample { Id = 213 }\n },\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 100 },\n Negative = new VectorExample { Id = 200 }\n }\n },\n Limit = 10\n }\n};\nawait client.DiscoverBatchAsync(\"{collection_name}\", discoverPoints);\n" - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/discover/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"target\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"context\": [\n {\n \"positive\": \"7f6652c4-89bd-40e0-ab1d-510f7fcddd2b\",\n \"negative\": \"2c2c9f86-0171-4bd2-9ab0-b4754682cddd\"\n }\n ],\n \"limit\": 1\n },\n {\n \"target\": [\n 0.5,\n 0.3,\n 0.2,\n 0.3\n ],\n \"context\": [\n {\n \"positive\": 342,\n \"negative\": 213\n }\n ],\n \"limit\": 1\n }\n ]\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nconst searches = [\n {\n target: [0.2, 0.1, 0.9, 0.7],\n context: [\n {\n positive: 100,\n negative: 718,\n },\n {\n positive: 200,\n negative: 300,\n },\n ],\n limit: 10,\n },\n {\n target: [0.5, 0.3, 0.2, 0.3],\n context: [\n {\n positive: 342,\n negative: 213,\n },\n {\n positive: 100,\n negative: 200,\n },\n ],\n limit: 5,\n },\n];\n\nclient.discoverBatchPoints(\"{collection_name}\", {\n searches,\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\nimport java.util.Arrays;\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.ContextExamplePair;\nimport io.qdrant.client.grpc.Points.DiscoverPoints;\nimport io.qdrant.client.grpc.Points.TargetVector;\nimport io.qdrant.client.grpc.Points.VectorExample;\n\nQdrantClient client = new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nList discoverPoints = Arrays.asList(\n DiscoverPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setTarget(\n TargetVector.newBuilder()\n .setSingle(\n VectorExample.newBuilder()\n .setVector(vector(\n 0.2 f,\n 0.1 f,\n 0.9 f,\n 0.7 f))\n .build()))\n .addAllContext(\n List.of(\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample\n .newBuilder()\n .setId(id(100)))\n .setNegative(VectorExample\n .newBuilder()\n .setId(id(718)))\n .build(),\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample\n .newBuilder()\n .setId(id(200)))\n .setNegative(VectorExample\n .newBuilder()\n .setId(id(300)))\n .build()))\n .setLimit(10)\n .build(),\n DiscoverPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setTarget(\n TargetVector.newBuilder()\n .setSingle(\n VectorExample.newBuilder()\n .setVector(vector(\n 0.5 f, 0.3 f, 0.2 f, 0.3 f))\n .build()))\n .addAllContext(\n List.of(\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample\n .newBuilder()\n .setId(id(342)))\n .setNegative(VectorExample\n .newBuilder()\n .setId(id(213)))\n .build(),\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample\n .newBuilder()\n .setId(id(100)))\n .setNegative(VectorExample\n .newBuilder()\n .setId(id(200)))\n .build()))\n .setLimit(10)\n .build());\nclient.discoverBatchAsync(\"{collection_name}\", discoverPoints, null);\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc discoverBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresults, err := client.QueryBatch(context.Background(), &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryDiscover(&qdrant.DiscoverInput{\n\t\t\t\t\tTarget: qdrant.NewVectorInput(0.2, 0.1, 0.9, 0.7),\n\t\t\t\t\tContext: &qdrant.ContextInput{\n\t\t\t\t\t\tPairs: []*qdrant.ContextInputPair{{\n\t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(300)),\n\t\t\t\t\t\t}},\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryDiscover(&qdrant.DiscoverInput{\n\t\t\t\t\tTarget: qdrant.NewVectorInput(0.5, 0.3, 0.2, 0.3),\n\t\t\t\t\tContext: &qdrant.ContextInput{\n\t\t\t\t\t\tPairs: []*qdrant.ContextInputPair{{\n\t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(342)),\n\t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(213)),\n\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\t\t\t\t\t\t}},\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nconst searches = [\n {\n target: [0.2, 0.1, 0.9, 0.7],\n context: [\n {\n positive: 100,\n negative: 718,\n },\n {\n positive: 200,\n negative: 300,\n },\n ],\n limit: 10,\n },\n {\n target: [0.5, 0.3, 0.2, 0.3],\n context: [\n {\n positive: 342,\n negative: 213,\n },\n {\n positive: 100,\n negative: 200,\n },\n ],\n limit: 5,\n },\n];\n\nclient.discoverBatchPoints(\"{collection_name}\", {\n searches,\n});\n" - language: typescript description: Retrieves points in batches based on the target and/or positive and negative example pairs. summary: Discover batch points tags: @@ -785,6 +785,12 @@ paths: /collections/{collection_name}/points/payload: post: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SetPayloadAsync(\n collectionName: \"{collection_name}\",\n payload: new Dictionary { { \"property1\", \"string\" }, { \"property2\", \"string\" } },\n ids: new ulong[] { 0, 3, 10 }\n);\n" + language: csharp + - code-samples: + - code: "# Set payload by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"payload\": {\n \"property1\": \"some_value\",\n \"property2\": 32,\n \"property3\": true\n },\n \"points\": [\n 0,\n 3,\n 10\n ]\n}'\n\n# Set payload by filter\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n },\n \"payload\": {\n \"property1\": \"some_value\",\n \"property2\": 32,\n \"property3\": true\n }\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{PointsIdsList, SetPayloadPointsBuilder};\nuse qdrant_client::{Qdrant, Payload};\nuse serde_json::json;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet payload: Payload = json!({\n \"property1\": \"string\",\n \"property2\": \"string\",\n})\n.try_into()\n.unwrap();\n\nclient\n .set_payload(\n SetPayloadPointsBuilder::new(\"{collection_name}\", payload)\n .points_selector(PointsIdsList {\n ids: vec![0.into(), 3.into(), 10.into()],\n })\n .wait(true),\n )\n .await?;\n" language: rust @@ -792,26 +798,26 @@ paths: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.set_payload(\n collection_name=\"{collection_name}\",\n payload={\n \"property1\": \"string\",\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n)\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SetPayloadAsync(\n collectionName: \"{collection_name}\",\n payload: new Dictionary { { \"property1\", \"string\" }, { \"property2\", \"string\" } },\n ids: new ulong[] { 0, 3, 10 }\n);\n" - language: csharp - - code-samples: - - code: "# Set payload by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"payload\": {\n \"property1\": \"some_value\",\n \"property2\": 32,\n \"property3\": true\n },\n \"points\": [\n 0,\n 3,\n 10\n ]\n}'\n\n# Set payload by filter\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n },\n \"payload\": {\n \"property1\": \"some_value\",\n \"property2\": 32,\n \"property3\": true\n }\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.setPayload(\"{collection_name}\", {\n payload: {\n property1: \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.ValueFactory.value;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .setPayloadAsync(\n \"{collection_name}\",\n Map.of(\"property1\", value(\"string\"), \"property2\", value(\"string\")),\n List.of(id(0), id(3), id(10)),\n true,\n null,\n null)\n .get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc setPayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresults, err := client.SetPayload(context.Background(), &qdrant.SetPayloadPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\"property1\": \"string\",\n\t\t\t\"property2\": \"string\",\n\t\t}),\n\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(10)),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.setPayload(\"{collection_name}\", {\n payload: {\n property1: \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n});\n" - language: typescript description: Sets payload values for specified points. summary: Set payload tags: - Points put: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.OverwritePayloadAsync(\n collectionName: \"{collection_name}\",\n payload: new Dictionary { { \"property1\", \"string\" }, { \"property2\", \"string\" } },\n ids: new ulong[] { 0, 3, 10 }\n);\n" + language: csharp + - code-samples: + - code: "# Overwrite payload by ID\ncurl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points/payload' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"payload\": {\n \"property1\": \"string\",\n \"property2\": \"string\"\n },\n \"points\": [\n 0,\n 3,\n 10\n ]\n}'\n\n# Overwrite payload by filter\ncurl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points/payload' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"payload\": {\n \"property1\": \"string\",\n \"property2\": \"string\"\n },\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n }\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{\n points_selector::PointsSelectorOneOf, PointsIdsList, SetPayloadPointsBuilder,\n};\nuse qdrant_client::{Qdrant, Payload};\nuse serde_json::json;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet payload: Payload = json!({\n \"property1\": \"string\",\n \"property2\": \"string\",\n})\n.try_into()\n.unwrap();\n\nclient\n .overwrite_payload(\n SetPayloadPointsBuilder::new(\"{collection_name}\", payload)\n .points_selector(PointsSelectorOneOf::Points(PointsIdsList {\n ids: vec![0.into(), 3.into(), 10.into()],\n }))\n .wait(true),\n )\n .await?;\n" language: rust @@ -819,20 +825,14 @@ paths: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.overwrite_payload(\n collection_name=\"{collection_name}\",\n payload={\n \"property1\": \"string\",\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n)\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.OverwritePayloadAsync(\n collectionName: \"{collection_name}\",\n payload: new Dictionary { { \"property1\", \"string\" }, { \"property2\", \"string\" } },\n ids: new ulong[] { 0, 3, 10 }\n);\n" - language: csharp - - code-samples: - - code: "# Overwrite payload by ID\ncurl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points/payload' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"payload\": {\n \"property1\": \"string\",\n \"property2\": \"string\"\n },\n \"points\": [\n 0,\n 3,\n 10\n ]\n}'\n\n# Overwrite payload by filter\ncurl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points/payload' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"payload\": {\n \"property1\": \"string\",\n \"property2\": \"string\"\n },\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n }\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.overwritePayload(\"{collection_name}\", {\n payload: {\n property1: \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.ValueFactory.value;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .overwritePayloadAsync(\n \"{collection_name}\",\n Map.of(\"property1\", value(\"string\"), \"property2\", value(\"string\")),\n List.of(id(0), id(3), id(10)),\n true,\n null,\n null)\n .get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc overwritePayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.OverwritePayload(context.Background(), &qdrant.SetPayloadPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\"property1\": \"string\",\n\t\t\t\"property2\": \"string\",\n\t\t}),\n\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(10)),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.overwritePayload(\"{collection_name}\", {\n payload: {\n property1: \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n});\n" - language: typescript description: Replaces the entire payload of a specified point with a new payload. summary: Overwrite payload tags: @@ -840,12 +840,6 @@ paths: /collections/{collection_name}/points/payload/clear: post: x-fern-examples: - - code-samples: - - code: "use qdrant_client::qdrant::{ClearPayloadPointsBuilder, PointsIdsList};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .clear_payload(ClearPayloadPointsBuilder::new(\"{collection_name}\").points(\n PointsIdsList {\n ids: vec![0.into(), 3.into(), 100.into()],\n },\n ))\n .await?;\n" - language: rust - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.clear_payload(\n collection_name=\"{collection_name}\",\n points_selector=[0, 3, 100],\n)\n" - language: python - code-samples: - code: 'using Qdrant.Client; @@ -860,15 +854,21 @@ paths: - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload/clear' \\\n --header 'Content-Type: application/json' \\\n --header 'api-key: ' \\\n --data-raw '{\n \"points\": [\n 0,\n 3,\n 100\n ]\n}'" language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{ClearPayloadPointsBuilder, PointsIdsList};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .clear_payload(ClearPayloadPointsBuilder::new(\"{collection_name}\").points(\n PointsIdsList {\n ids: vec![0.into(), 3.into(), 100.into()],\n },\n ))\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.clear_payload(\n collection_name=\"{collection_name}\",\n points_selector=[0, 3, 100],\n)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.clearPayload(\"{collection_name}\", {\n points: [0, 3, 100],\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.clearPayloadAsync(\"{collection_name}\", List.of(id(0), id(3), id(100)), null, null, null)\n .get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc clearPayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.ClearPayload(context.Background(), &qdrant.ClearPayloadPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewID(\"3\"), qdrant.NewIDNum(100)),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.clearPayload(\"{collection_name}\", {\n points: [0, 3, 100],\n});\n" - language: typescript description: Removes the entire payload for specified points. summary: Clear payload tags: @@ -876,12 +876,6 @@ paths: /collections/{collection_name}/points/payload/delete: post: x-fern-examples: - - code-samples: - - code: "use qdrant_client::qdrant::{DeletePayloadPointsBuilder, PointsIdsList};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .delete_payload(\n DeletePayloadPointsBuilder::new(\n \"{collection_name}\",\n vec![\"color\".to_string(), \"price\".to_string()],\n )\n .points_selector(PointsIdsList {\n ids: vec![0.into(), 3.into(), 100.into()],\n })\n .wait(true),\n )\n .await?;\n" - language: rust - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete_payload(\n collection_name=\"{collection_name}\",\n keys=[\"color\", \"price\"],\n points=[0, 3, 100],\n)\n" - language: python - code-samples: - code: 'using Qdrant.Client; @@ -896,15 +890,21 @@ paths: - code-samples: - code: "# Delete payload by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"keys\": [\n \"color\",\n \"price\"\n ],\n \"points\": [\n 0,\n 3,\n 100\n ]\n}'\n\n# Delete payload by filter\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"keys\": [\n \"color\",\n \"price\"\n ],\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n }\n}'" language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{DeletePayloadPointsBuilder, PointsIdsList};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .delete_payload(\n DeletePayloadPointsBuilder::new(\n \"{collection_name}\",\n vec![\"color\".to_string(), \"price\".to_string()],\n )\n .points_selector(PointsIdsList {\n ids: vec![0.into(), 3.into(), 100.into()],\n })\n .wait(true),\n )\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete_payload(\n collection_name=\"{collection_name}\",\n keys=[\"color\", \"price\"],\n points=[0, 3, 100],\n)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.deletePayload(\"{collection_name}\", {\n keys: [\"color\", \"price\"],\n points: [0, 3, 100],\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .deletePayloadAsync(\n \"{collection_name}\",\n List.of(\"color\", \"price\"),\n List.of(id(0), id(3), id(100)),\n true,\n null,\n null)\n .get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deletePayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.DeletePayload(context.Background(), &qdrant.DeletePayloadPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(100)),\n\t\tKeys: []string{\"color\", \"price\"},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.deletePayload(\"{collection_name}\", {\n keys: [\"color\", \"price\"],\n points: [0, 3, 100],\n});\n" - language: typescript description: Deletes a specified key payload for points. summary: Delete payload tags: @@ -912,6 +912,12 @@ paths: /collections/{collection_name}/points/query: post: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\n// Query nearest by ID\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tquery: Guid.Parse(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")\n);\n\n// Recommend on the average of these vectors\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tquery: new RecommendInput\n\t{\n\t\tPositive =\n\t\t{\n\t\t\tGuid.Parse(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"),\n\t\t\tnew float[] { 0.11f, 0.35f, 0.6f }\n\t\t},\n\t\tNegative = { new float[] { 0.01f, 0.45f, 0.67f } }\n\t}\n);\n\n// Fusion query\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tprefetch: new List\n\t{\n\t\tnew()\n\t\t{\n\t\t\tQuery = new (float, uint)[] { (0.22f, 1), (0.8f, 42), },\n\t\t\tUsing = \"sparse\",\n\t\t\tLimit = 20\n\t\t},\n\t\tnew()\n\t\t{\n\t\t\tQuery = new float[] { 0.01f, 0.45f, 0.67f },\n\t\t\tUsing = \"dense\",\n\t\t\tLimit = 20\n\t\t}\n\t},\n\tquery: Fusion.Rrf\n);\n\n// 2-stage query\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tprefetch: new List\n\t{\n\t\tnew() { Query = new float[] { 0.01f, 0.45f, 0.67f }, Limit = 100 }\n\t},\n\tquery: new float[][] { [0.1f, 0.2f], [0.2f, 0.1f], [0.8f, 0.9f] },\n\tusingVector: \"colbert\",\n\tlimit: 10\n);\n\n// Random sampling (as of 1.11.0)\nawait client.QueryAsync(\n collectionName: \"{collection_name}\",\n query: Sample.Random\n);\n" + language: csharp + - code-samples: + - code: "# Query nearest by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"query\": \"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\n}'\n\n# Recommend on the average of these vectors\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"query\": {\n \"recommend\": {\n \"positive\": [\n [\n 0.11,\n 0.35,\n 0.6\n ]\n ],\n \"negative\": [\n \"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\",\n [\n 0.01,\n 0.45,\n 0.67\n ]\n ]\n }\n }\n}'\n\n# Fusion query\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"prefetch\": [\n {\n \"query\": {\n \"values\": [\n 0.22,\n 0.8\n ],\n \"indices\": [\n 1,\n 42\n ]\n },\n \"using\": \"sparse\",\n \"limit\": 20\n },\n {\n \"query\": [\n 0.01,\n 0.45,\n 0.67\n ],\n \"using\": \"dense\",\n \"limit\": 20\n }\n ],\n \"query\": {\n \"fusion\": \"rrf\"\n }\n}'\n\n# 2-stage query\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"prefetch\": {\n \"query\": [\n 1,\n 23,\n 45,\n 67\n ],\n \"limit\": 100\n },\n \"query\": [\n [\n 0.1,\n 0.2,\n 0.3\n ],\n [\n 0.2,\n 0.1,\n 0.35\n ],\n [\n 0.8,\n 0.9,\n 0.53\n ]\n ],\n \"using\": \"colbert\",\n \"limit\": 10\n}'\n\n# Random sampling (as of 1.11.0)\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"query\": {\n \"sample\": \"random\"\n }\n}'\n" + language: curl - code-samples: - code: "use qdrant_client::Qdrant;\nuse qdrant_client::qdrant::{Condition, Filter, PointId, PrefetchQueryBuilder, Query, QueryPointsBuilder};\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\n// Query nearest by ID\nlet _nearest = client.query(\n QueryPointsBuilder::new(\"{collection_name}\")\n .query(Query::new_nearest(PointId::new(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")))\n).await?;\n\n// Recommend on the average of these vectors\nlet _recommendations = client.query(\n QueryPointsBuilder::new(\"{collection_name}\")\n .query(Query::new_recommend(\n RecommendInputBuilder::default()\n .add_positive(vec![0.1; 8])\n .add_negative(PointId::from(0))\n ))\n).await?;\n\n// Fusion query\nlet _hybrid = client.query(\n QueryPointsBuilder::new(\"{collection_name}\")\n .add_prefetch(PrefetchQueryBuilder::default()\n .query(Query::new_nearest([(1, 0.22), (42, 0.8)].as_slice()))\n .using(\"sparse\")\n .limit(20u64)\n )\n .add_prefetch(PrefetchQueryBuilder::default()\n .query(Query::new_nearest(vec![0.01, 0.45, 0.67]))\n .using(\"dense\")\n .limit(20u64)\n )\n .query(Query::new_fusion(Fusion::Rrf))\n).await?;\n\n// 2-stage query\nlet _refined = client.query(\n QueryPointsBuilder::new(\"{collection_name}\")\n .add_prefetch(PrefetchQueryBuilder::default()\n .query(Query::new_nearest(vec![0.01, 0.45, 0.67]))\n .limit(100u64)\n )\n .query(Query::new_nearest(vec![\n vec![0.1, 0.2],\n vec![0.2, 0.1],\n vec![0.8, 0.9],\n ]))\n .using(\"colbert\")\n .limit(10u64)\n).await?;\n\n// Random sampling (as of 1.11.0)\nlet _sampled = client\n .query(\n QueryPointsBuilder::new(\"{collection_name}\")\n .query(Query::new_sample(Sample::Random))\n )\n .await?;\n" language: rust @@ -919,20 +925,14 @@ paths: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\n# Query nearest by ID\nnearest = client.query_points(\n collection_name=\"{collection_name}\",\n query=\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\",\n)\n\n# Recommend on the average of these vectors\nrecommended = client.query_points(\n collection_name=\"{collection_name}\",\n query=models.RecommendQuery(recommend=models.RecommendInput(\n positive=[\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\", [0.11, 0.35, 0.6, ...]],\n negative=[[0.01, 0.45, 0.67, ...]]\n ))\n)\n\n# Fusion query\nhybrid = client.query_points(\n collection_name=\"{collection_name}\",\n prefetch=[\n models.Prefetch(\n query=models.SparseVector(indices=[1, 42], values=[0.22, 0.8]),\n using=\"sparse\",\n limit=20,\n ),\n models.Prefetch(\n query=[0.01, 0.45, 0.67, ...], # <-- dense vector\n using=\"dense\",\n limit=20,\n ),\n ],\n query=models.FusionQuery(fusion=models.Fusion.RRF),\n)\n\n# 2-stage query\nrefined = client.query_points(\n collection_name=\"{collection_name}\",\n prefetch=models.Prefetch(\n query=[0.01, 0.45, 0.67, ...], # <-- dense vector\n limit=100,\n ),\n query=[\n [0.1, 0.2, ...], # <─┐\n [0.2, 0.1, ...], # < ├─ multi-vector\n [0.8, 0.9, ...], # < ┘\n ],\n using=\"colbert\",\n limit=10,\n)\n\n# Random sampling (as of 1.11.0)\nsampled = client.query_points(\n collection_name=\"{collection_name}\",\n query=models.SampleQuery(sample=models.Sample.Random)\n)\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\n// Query nearest by ID\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tquery: Guid.Parse(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")\n);\n\n// Recommend on the average of these vectors\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tquery: new RecommendInput\n\t{\n\t\tPositive =\n\t\t{\n\t\t\tGuid.Parse(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"),\n\t\t\tnew float[] { 0.11f, 0.35f, 0.6f }\n\t\t},\n\t\tNegative = { new float[] { 0.01f, 0.45f, 0.67f } }\n\t}\n);\n\n// Fusion query\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tprefetch: new List\n\t{\n\t\tnew()\n\t\t{\n\t\t\tQuery = new (float, uint)[] { (0.22f, 1), (0.8f, 42), },\n\t\t\tUsing = \"sparse\",\n\t\t\tLimit = 20\n\t\t},\n\t\tnew()\n\t\t{\n\t\t\tQuery = new float[] { 0.01f, 0.45f, 0.67f },\n\t\t\tUsing = \"dense\",\n\t\t\tLimit = 20\n\t\t}\n\t},\n\tquery: Fusion.Rrf\n);\n\n// 2-stage query\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tprefetch: new List\n\t{\n\t\tnew() { Query = new float[] { 0.01f, 0.45f, 0.67f }, Limit = 100 }\n\t},\n\tquery: new float[][] { [0.1f, 0.2f], [0.2f, 0.1f], [0.8f, 0.9f] },\n\tusingVector: \"colbert\",\n\tlimit: 10\n);\n\n// Random sampling (as of 1.11.0)\nawait client.QueryAsync(\n collectionName: \"{collection_name}\",\n query: Sample.Random\n);\n" - language: csharp - - code-samples: - - code: "# Query nearest by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"query\": \"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\n}'\n\n# Recommend on the average of these vectors\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"query\": {\n \"recommend\": {\n \"positive\": [\n [\n 0.11,\n 0.35,\n 0.6\n ]\n ],\n \"negative\": [\n \"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\",\n [\n 0.01,\n 0.45,\n 0.67\n ]\n ]\n }\n }\n}'\n\n# Fusion query\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"prefetch\": [\n {\n \"query\": {\n \"values\": [\n 0.22,\n 0.8\n ],\n \"indices\": [\n 1,\n 42\n ]\n },\n \"using\": \"sparse\",\n \"limit\": 20\n },\n {\n \"query\": [\n 0.01,\n 0.45,\n 0.67\n ],\n \"using\": \"dense\",\n \"limit\": 20\n }\n ],\n \"query\": {\n \"fusion\": \"rrf\"\n }\n}'\n\n# 2-stage query\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"prefetch\": {\n \"query\": [\n 1,\n 23,\n 45,\n 67\n ],\n \"limit\": 100\n },\n \"query\": [\n [\n 0.1,\n 0.2,\n 0.3\n ],\n [\n 0.2,\n 0.1,\n 0.35\n ],\n [\n 0.8,\n 0.9,\n 0.53\n ]\n ],\n \"using\": \"colbert\",\n \"limit\": 10\n}'\n\n# Random sampling (as of 1.11.0)\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"query\": {\n \"sample\": \"random\"\n }\n}'\n" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n// Query nearest by ID\nlet _nearest = client.query(\"{collection_name\", {\n query: \"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\n});\n\n// Recommend on the average of these vectors\nlet _recommendations = client.query(\"{collection_name}\", {\n query: {\n recommend: {\n positive: [\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\", [0.11, 0.35, 0.6]],\n negative: [0.01, 0.45, 0.67]\n }\n }\n});\n\n// Fusion query\nlet _hybrid = client.query(\"{collection_name}\", {\n prefetch: [\n {\n query: {\n values: [0.22, 0.8],\n indices: [1, 42],\n },\n using: 'sparse',\n limit: 20,\n },\n {\n query: [0.01, 0.45, 0.67],\n using: 'dense',\n limit: 20,\n },\n ],\n query: {\n fusion: 'rrf',\n },\n});\n\n// 2-stage query\nlet _refined = client.query(\"{collection_name}\", {\n prefetch: {\n query: [1, 23, 45, 67],\n limit: 100,\n },\n query: [\n [0.1, 0.2],\n [0.2, 0.1],\n [0.8, 0.9],\n ],\n using: 'colbert',\n limit: 10,\n});\n\n// Random sampling (as of 1.11.0)\nlet _sampled = client.query(\"{collection_name}\", {\n query: { sample: \"random\" },\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.QueryFactory.fusion;\nimport static io.qdrant.client.QueryFactory.nearest;\nimport static io.qdrant.client.QueryFactory.recommend;\nimport static io.qdrant.client.VectorInputFactory.vectorInput;\n\nimport java.util.UUID;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\nimport io.qdrant.client.grpc.Points.Fusion;\nimport io.qdrant.client.grpc.Points.PrefetchQuery;\nimport io.qdrant.client.grpc.Points.QueryPoints;\nimport io.qdrant.client.grpc.Points.RecommendInput;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\n// Query nearest by ID\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setQuery(nearest(UUID.fromString(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")))\n .build())\n .get();\n\n// Recommend on the average of these vectors\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setQuery(\n recommend(\n RecommendInput.newBuilder()\n .addPositive(vectorInput(UUID.fromString(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")))\n .addPositive(vectorInput(0.11f, 0.35f, 0.6f))\n .addNegative(vectorInput(0.01f, 0.45f, 0.67f))\n .build()))\n .build())\n .get();\n\n// Fusion query\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .addPrefetch(\n PrefetchQuery.newBuilder()\n .setQuery(nearest(List.of(0.22f, 0.8f), List.of(1, 42)))\n .setUsing(\"sparse\")\n .setLimit(20)\n .build())\n .addPrefetch(\n PrefetchQuery.newBuilder()\n .setQuery(nearest(List.of(0.01f, 0.45f, 0.67f)))\n .setUsing(\"dense\")\n .setLimit(20)\n .build())\n .setQuery(fusion(Fusion.RRF))\n .build())\n .get();\n\n// 2-stage query\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .addPrefetch(\n PrefetchQuery.newBuilder()\n .setQuery(nearest(0.01f, 0.45f, 0.67f))\n .setLimit(100)\n .build())\n .setQuery(\n nearest(\n new float[][] {\n {0.1f, 0.2f},\n {0.2f, 0.1f},\n {0.8f, 0.9f}\n }))\n .setUsing(\"colbert\")\n .setLimit(10)\n .build())\n .get();\n\n// Random sampling (as of 1.11.0)\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setQuery(sample(Sample.Random))\n .build())\n .get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc query() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Query nearest by ID\n\tpoints, err := client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQueryID(qdrant.NewID(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", points)\n\n\t// Recommend on the average of these vectors\n\tpoints, err = client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewID(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")),\n\t\t\t\tqdrant.NewVectorInput(0.11, 0.35, 0.6),\n\t\t\t},\n\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInput(0.01, 0.45, 0.67),\n\t\t\t},\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", points)\n\n\t// Fusion query\n\tpoints, err = client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPrefetch: []*qdrant.PrefetchQuery{\n\t\t\t{\n\t\t\t\tQuery: qdrant.NewQuerySparse([]uint32{1, 42}, []float32{0.22, 0.8}),\n\t\t\t\tUsing: qdrant.PtrOf(\"sparse\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\t\t\tUsing: qdrant.PtrOf(\"dense\"),\n\t\t\t},\n\t\t},\n\t\tQuery: qdrant.NewQueryFusion(qdrant.Fusion_RRF),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", points)\n\n\t// 2-stage query\n\tpoints, err = client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPrefetch: []*qdrant.PrefetchQuery{\n\t\t\t{\n\t\t\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\t\t},\n\t\t},\n\t\tQuery: qdrant.NewQueryMulti([][]float32{\n\t\t\t{0.1, 0.2},\n\t\t\t{0.2, 0.1},\n\t\t\t{0.8, 0.9},\n\t\t}),\n\t\tUsing: qdrant.PtrOf(\"colbert\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", points)\n\n\t// Random sampling (as of 1.11.0)\n\tpoints, err = client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQuerySample(qdrant.Sample_Random),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", points)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n// Query nearest by ID\nlet _nearest = client.query(\"{collection_name\", {\n query: \"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\n});\n\n// Recommend on the average of these vectors\nlet _recommendations = client.query(\"{collection_name}\", {\n query: {\n recommend: {\n positive: [\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\", [0.11, 0.35, 0.6]],\n negative: [0.01, 0.45, 0.67]\n }\n }\n});\n\n// Fusion query\nlet _hybrid = client.query(\"{collection_name}\", {\n prefetch: [\n {\n query: {\n values: [0.22, 0.8],\n indices: [1, 42],\n },\n using: 'sparse',\n limit: 20,\n },\n {\n query: [0.01, 0.45, 0.67],\n using: 'dense',\n limit: 20,\n },\n ],\n query: {\n fusion: 'rrf',\n },\n});\n\n// 2-stage query\nlet _refined = client.query(\"{collection_name}\", {\n prefetch: {\n query: [1, 23, 45, 67],\n limit: 100,\n },\n query: [\n [0.1, 0.2],\n [0.2, 0.1],\n [0.8, 0.9],\n ],\n using: 'colbert',\n limit: 10,\n});\n\n// Random sampling (as of 1.11.0)\nlet _sampled = client.query(\"{collection_name}\", {\n query: { sample: \"random\" },\n});\n" - language: typescript description: Universally query points. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries. summary: Query points tags: @@ -940,6 +940,12 @@ paths: /collections/{collection_name}/points/query/batch: post: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.QueryBatchAsync(\n\tcollectionName: \"{collection_name}\",\n\tqueries: new List\n\t{\n\t\tnew() { Query = new float[] { 0.1f, 0.2f, 0.3f }, },\n\t\tnew() { Query = new float[] { 0.4f, 0.5f, 0.6f }, }\n\t}\n);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"query\": [\n 0.23,\n 0.325,\n 0.623\n ],\n \"limit\": 1\n },\n {\n \"query\": [\n 0.423,\n 0.23,\n 0.623\n ],\n \"limit\": 5,\n \"using\": \"image-vector\"\n }\n ]\n}'" + language: curl - code-samples: - code: "use qdrant_client::{Qdrant, QdrantError};\nuse qdrant_client::qdrant::{Query, QueryPointsBuilder, QueryBatchPointsBuilder};\n\nlet request = QueryBatchPointsBuilder::new(\"{collection_name}\", vec![\n QueryPointsBuilder::new(\"\")\n .query(Query::new_nearest(\n vec![0.1; 8],\n )).into(),\n QueryPointsBuilder::new(\"\")\n .query(Query::new_nearest(\n vec![0.3; 8],\n )).into(),\n]);\n\nlet response = client.query_batch(request).await?;" language: rust @@ -947,20 +953,14 @@ paths: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nnearest = client.query_batch_points(\n collection_name=\"{collection_name}\",\n requests=[\n models.QueryRequest(\n query=[0.01, 0.45, 0.67, ...],\n ),\n models.QueryRequest(\n query=[0.11, 0.35, 0.6, ...],\n ),\n ]\n)" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.QueryBatchAsync(\n\tcollectionName: \"{collection_name}\",\n\tqueries: new List\n\t{\n\t\tnew() { Query = new float[] { 0.1f, 0.2f, 0.3f }, },\n\t\tnew() { Query = new float[] { 0.4f, 0.5f, 0.6f }, }\n\t}\n);\n" - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"query\": [\n 0.23,\n 0.325,\n 0.623\n ],\n \"limit\": 1\n },\n {\n \"query\": [\n 0.423,\n 0.23,\n 0.623\n ],\n \"limit\": 5,\n \"using\": \"image-vector\"\n }\n ]\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.queryBatch(\"{collection_name\", {\n searches: [{\n query: [0.01, 0.45, 0.67]\n },\n {\n query: [0.11, 0.35, 0.6]\n }]\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.QueryFactory.nearest;\n\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\nimport io.qdrant.client.grpc.Points.QueryPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .queryBatchAsync(\n \"{collection_name}\",\n List.of(\n QueryPoints.newBuilder().setQuery(nearest(0.1f, 0.2f, 0.3f)).build(),\n QueryPoints.newBuilder().setQuery(nearest(0.4f, 0.5f, 0.6f)).build()))\n .get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc queryBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresults, err := client.QueryBatch(context.Background(), &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\t\t},\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQuery(0.11, 0.35, 0.6),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.queryBatch(\"{collection_name\", {\n searches: [{\n query: [0.01, 0.45, 0.67]\n },\n {\n query: [0.11, 0.35, 0.6]\n }]\n});\n" - language: typescript description: Universally query points in batch. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries. summary: Query points in batch tags: @@ -968,6 +968,12 @@ paths: /collections/{collection_name}/points/query/groups: post: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.QueryGroupsAsync(\n collectionName: \"{collection_name}\",\n groupBy: \"document_id\",\n groupSize: 5,\n limit: 10,\n query: new float[] {\n 0.01f, 0.45f, 0.67f\n }\n);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query/groups' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"query\": [\n 0.324,\n 0.643,\n 0.423\n ],\n \"group_by\": \"document_id\",\n \"limit\": 1,\n \"group_size\": 5\n}'" + language: curl - code-samples: - code: "use qdrant_client::Qdrant;\nuse qdrant_client::qdrant::{Query, QueryPointGroupsBuilder};\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient.query_groups(\n QueryPointGroupsBuilder::new(\"{collection_name}\", \"document_id\")\n .query(Query::from(vec![0.01, 0.45, 0.67]))\n .limit(10u64)\n .group_size(5u64)\n).await?;\n" language: rust @@ -975,20 +981,14 @@ paths: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.query_points_groups(\n collection_name=\"{collection_name}\",\n query=[0.01, 0.45, 0.67],\n group_by=\"document_id\",\n limit=10,\n group_size=5,\n)" language: python - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.QueryGroupsAsync(\n collectionName: \"{collection_name}\",\n groupBy: \"document_id\",\n groupSize: 5,\n limit: 10,\n query: new float[] {\n 0.01f, 0.45f, 0.67f\n }\n);\n" - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query/groups' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"query\": [\n 0.324,\n 0.643,\n 0.423\n ],\n \"group_by\": \"document_id\",\n \"limit\": 1,\n \"group_size\": 5\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.queryGroups(\"{collection_name}\", {\n query: [0.01, 0.45, 0.67],\n group_by: \"document_id\",\n limit: 10,\n group_size: 5,\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.QueryFactory.nearest;\n\nimport io.qdrant.client.grpc.Points.QueryPointGroups;\nimport io.qdrant.client.grpc.Points.QueryPoints;\n\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .queryGroupsAsync(\n QueryPointGroups.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setGroupBy(\"document_id\")\n .setGroupSize(5)\n .setLimit(10)\n .setQuery(nearest(List.of(0.01f, 0.45f, 0.67f)))\n .build())\n .get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc queryGroups() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tgroupSize := uint64(5)\n\tresults, err := client.QueryGroups(context.Background(), &qdrant.QueryPointGroups{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\tGroupBy: \"document_id\",\n\t\tGroupSize: &groupSize,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.queryGroups(\"{collection_name}\", {\n query: [0.01, 0.45, 0.67],\n group_by: \"document_id\",\n limit: 10,\n group_size: 5,\n});\n" - language: typescript description: Universally query points and group results by a specified payload field. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries. summary: Query point groups tags: @@ -996,6 +996,12 @@ paths: /collections/{collection_name}/points/recommend: post: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendAsync(\n \"{collection_name}\",\n positive: new ulong[] { 100, 231 },\n negative: new ulong[] { 718 },\n filter: MatchKeyword(\"city\", \"London\"),\n limit: 3\n);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"positive\": [\n 100,\n 231\n ],\n \"negative\": [\n \"3a6e2150-f7b7-496e-92cd-687e63e215fd\",\n [\n 0.2,\n 0.3,\n 0.4,\n 0.5\n ]\n ],\n \"filter\": {\n \"must\": [\n {\n \"key\": \"city\",\n \"match\": {\n \"value\": \"London\"\n }\n }\n ]\n },\n \"limit\": 1\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{Condition, Filter, RecommendPointsBuilder, RecommendStrategy};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .recommend(\n RecommendPointsBuilder::new(\"{collection_name}\", 3)\n .add_positive(100)\n .add_positive(200)\n .add_positive(vec![100.0, 231.0])\n .add_negative(718)\n .add_negative(vec![0.2, 0.3, 0.4, 0.5])\n .strategy(RecommendStrategy::AverageVector)\n .filter(Filter::must([Condition::matches(\n \"city\",\n \"London\".to_string(),\n )])),\n )\n .await?;\n" language: rust @@ -1003,20 +1009,14 @@ paths: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.recommend(\n collection_name=\"{collection_name}\",\n positive=[100, 231],\n negative=[718, [0.2, 0.3, 0.4, 0.5]],\n strategy=models.RecommendStrategy.AVERAGE_VECTOR,\n query_filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"city\",\n match=models.MatchValue(\n value=\"London\",\n ),\n )\n ]\n ),\n limit=3,\n)\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendAsync(\n \"{collection_name}\",\n positive: new ulong[] { 100, 231 },\n negative: new ulong[] { 718 },\n filter: MatchKeyword(\"city\", \"London\"),\n limit: 3\n);\n" - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"positive\": [\n 100,\n 231\n ],\n \"negative\": [\n \"3a6e2150-f7b7-496e-92cd-687e63e215fd\",\n [\n 0.2,\n 0.3,\n 0.4,\n 0.5\n ]\n ],\n \"filter\": {\n \"must\": [\n {\n \"key\": \"city\",\n \"match\": {\n \"value\": \"London\"\n }\n }\n ]\n },\n \"limit\": 1\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.recommend(\"{collection_name}\", {\n positive: [100, 231],\n negative: [718, [0.2, 0.3, 0.4, 0.5]],\n strategy: \"average_vector\",\n filter: {\n must: [\n {\n key: \"city\",\n match: {\n value: \"London\",\n },\n },\n ],\n },\n limit: 3,\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\nimport static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.RecommendPoints;\nimport io.qdrant.client.grpc.Points.RecommendStrategy;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .recommendAsync(\n RecommendPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .addAllPositive(List.of(id(100), id(200)))\n .addAllPositiveVectors(List.of(vector(100.0f, 231.0f)))\n .addAllNegative(List.of(id(718)))\n .addAllPositiveVectors(List.of(vector(0.2f, 0.3f, 0.4f, 0.5f)))\n .setStrategy(RecommendStrategy.AverageVector)\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\")))\n .setLimit(3)\n .build())\n .get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc recommend() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresults, err := client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(231)),\n\t\t\t},\n\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\t\t\t\tqdrant.NewVectorInput(0.2, 0.3, 0.4, 0.5),\n\t\t\t},\n\t\t\tStrategy: qdrant.RecommendStrategy_AverageVector.Enum(),\n\t\t}),\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"city\", \"London\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.recommend(\"{collection_name}\", {\n positive: [100, 231],\n negative: [718, [0.2, 0.3, 0.4, 0.5]],\n strategy: \"average_vector\",\n filter: {\n must: [\n {\n key: \"city\",\n match: {\n value: \"London\",\n },\n },\n ],\n },\n limit: 3,\n});\n" - language: typescript description: Retrieves points that are closer to stored positive examples and further from negative examples. summary: Recommend points tags: @@ -1024,6 +1024,12 @@ paths: /collections/{collection_name}/points/recommend/batch: post: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter = MatchKeyword(\"city\", \"london\");\n\nawait client.RecommendBatchAsync(\n collectionName: \"{collection_name}\",\n recommendSearches:\n [\n new()\n {\n CollectionName = \"{collection_name}\",\n Positive = { new PointId[] { 100, 231 } },\n Negative = { new PointId[] { 718 } },\n Limit = 3,\n Filter = filter,\n },\n new()\n {\n CollectionName = \"{collection_name}\",\n Positive = { new PointId[] { 200, 67 } },\n Negative = { new PointId[] { 300 } },\n Limit = 3,\n Filter = filter,\n }\n ]\n);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"positive\": [\n 100,\n 231\n ],\n \"negative\": [\n \"9ad0884a-7bfe-43c0-b88f-c1d9a588b7e1\"\n ],\n \"limit\": 1\n },\n {\n \"positive\": [\n 200,\n 67\n ],\n \"negative\": [\n 300\n ],\n \"limit\": 5\n }\n ]\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{\n Condition, Filter, RecommendBatchPointsBuilder, RecommendPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet filter = Filter::must([Condition::matches(\"city\", \"London\".to_string())]);\nlet recommend_queries = vec![\n RecommendPointsBuilder::new(\"{collection_name}\", 3)\n .add_positive(100)\n .add_positive(231)\n .add_negative(718)\n .filter(filter.clone())\n .build(),\n RecommendPointsBuilder::new(\"{collection_name}\", 3)\n .add_positive(200)\n .add_positive(67)\n .add_negative(300)\n .filter(filter.clone())\n .build(),\n];\n\nclient\n .recommend_batch(RecommendBatchPointsBuilder::new(\n \"{collection_name}\",\n recommend_queries,\n ))\n .await?;\n" language: rust @@ -1031,20 +1037,14 @@ paths: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nrecommend_queries = [\n models.RecommendRequest(\n positive=[100, 231], negative=[718], filter=filter_, limit=3\n ),\n models.RecommendRequest(positive=[200, 67], negative=[300], limit=3),\n]\n\nclient.recommend_batch(collection_name=\"{collection_name}\", requests=recommend_queries)\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter = MatchKeyword(\"city\", \"london\");\n\nawait client.RecommendBatchAsync(\n collectionName: \"{collection_name}\",\n recommendSearches:\n [\n new()\n {\n CollectionName = \"{collection_name}\",\n Positive = { new PointId[] { 100, 231 } },\n Negative = { new PointId[] { 718 } },\n Limit = 3,\n Filter = filter,\n },\n new()\n {\n CollectionName = \"{collection_name}\",\n Positive = { new PointId[] { 200, 67 } },\n Negative = { new PointId[] { 300 } },\n Limit = 3,\n Filter = filter,\n }\n ]\n);\n" - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"positive\": [\n 100,\n 231\n ],\n \"negative\": [\n \"9ad0884a-7bfe-43c0-b88f-c1d9a588b7e1\"\n ],\n \"limit\": 1\n },\n {\n \"positive\": [\n 200,\n 67\n ],\n \"negative\": [\n 300\n ],\n \"limit\": 5\n }\n ]\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nconst searches = [\n {\n positive: [100, 231],\n negative: [718],\n limit: 3,\n },\n {\n positive: [200, 67],\n negative: [300],\n limit: 3,\n },\n];\n\nclient.recommend_batch(\"{collection_name}\", {\n searches,\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\nimport static io.qdrant.client.PointIdFactory.id;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.RecommendPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\")).build();\n\nList recommendQueries =\n List.of(\n RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(100), id(231)))\n .addAllNegative(List.of(id(718)))\n .setFilter(filter)\n .setLimit(3)\n .build(),\n RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(200), id(67)))\n .addAllNegative(List.of(id(300)))\n .setFilter(filter)\n .setLimit(3)\n .build());\n\nclient.recommendBatchAsync(\"{collection_name}\", recommendQueries, null).get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc recommendBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresults, err := client.QueryBatch(context.Background(), &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\t\t\t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(231)),\n\t\t\t\t\t},\n\t\t\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\t\t\t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(67)),\n\t\t\t\t\t},\n\t\t\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(300)),\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nconst searches = [\n {\n positive: [100, 231],\n negative: [718],\n limit: 3,\n },\n {\n positive: [200, 67],\n negative: [300],\n limit: 3,\n },\n];\n\nclient.recommend_batch(\"{collection_name}\", {\n searches,\n});\n" - language: typescript description: Retrieves points in batches that are closer to stored positive examples and further from negative examples. summary: Recommend batch points tags: @@ -1052,6 +1052,12 @@ paths: /collections/{collection_name}/points/recommend/groups: post: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendGroupsAsync(\n \"{collection_name}\",\n \"document_id\",\n groupSize: 3,\n positive: new ulong[] { 100, 231 },\n negative: new ulong[] { 718 },\n filter: MatchKeyword(\"city\", \"London\"),\n limit: 3\n);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend/groups' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"positive\": [\n 100,\n 231\n ],\n \"negative\": [\n 718\n ],\n \"group_by\": \"document_id\",\n \"limit\": 3,\n \"group_size\": 2\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{RecommendPointGroupsBuilder, RecommendStrategy};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .recommend_groups(\n RecommendPointGroupsBuilder::new(\"{collection_name}\", \"document_id\", 2, 3)\n .add_positive(100)\n .add_positive(200)\n .add_negative(718)\n .strategy(RecommendStrategy::AverageVector),\n )\n .await?;\n" language: rust @@ -1059,20 +1065,14 @@ paths: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.recommend_groups(\n collection_name=\"{collection_name}\",\n positive=[100, 231],\n negative=[718],\n group_by=\"document_id\",\n limit=3,\n group_size=2,\n)\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendGroupsAsync(\n \"{collection_name}\",\n \"document_id\",\n groupSize: 3,\n positive: new ulong[] { 100, 231 },\n negative: new ulong[] { 718 },\n filter: MatchKeyword(\"city\", \"London\"),\n limit: 3\n);\n" - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend/groups' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"positive\": [\n 100,\n 231\n ],\n \"negative\": [\n 718\n ],\n \"group_by\": \"document_id\",\n \"limit\": 3,\n \"group_size\": 2\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.recommendPointGroups(\"{collection_name}\", {\n positive: [100, 231],\n negative: [718],\n group_by: \"document_id\",\n limit: 3,\n group_size: 2,\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.RecommendPointGroups;\nimport io.qdrant.client.grpc.Points.RecommendStrategy;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.recommendGroupsAsync(RecommendPointGroups.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setGroupBy(\"document_id\")\n .setGroupSize(2)\n .addAllPositive(List.of(id(100), id(200)))\n .addAllNegative(List.of(id(718)))\n .setStrategy(RecommendStrategy.AverageVector)\n .setLimit(3)\n .build());\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc recommendGroups() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tgroupSize := uint64(5)\n\tresults, err := client.QueryGroups(context.Background(), &qdrant.QueryPointGroups{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(231)),\n\t\t\t},\n\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\t\t\t},\n\t\t}),\n\t\tGroupBy: \"document_id\",\n\t\tGroupSize: &groupSize,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.recommendPointGroups(\"{collection_name}\", {\n positive: [100, 231],\n negative: [718],\n group_by: \"document_id\",\n limit: 3,\n group_size: 2,\n});\n" - language: typescript description: Retrieves points that are closer to stored positive examples and further from negative examples. Results are grouped by the specified payload field. summary: Recommend point groups tags: @@ -1080,6 +1080,12 @@ paths: /collections/{collection_name}/points/scroll: post: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.ScrollAsync(\n collectionName: \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"),\n limit: 1,\n payloadSelector: true\n);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/scroll' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"with_payload\": [\n \"city\",\n \"color\"\n ],\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n },\n \"limit\": 2,\n \"with_vector\": false\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{Condition, Filter, ScrollPointsBuilder};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .scroll(\n ScrollPointsBuilder::new(\"{collection_name}\")\n .filter(Filter::must([Condition::matches(\n \"color\",\n \"red\".to_string(),\n )]))\n .limit(1)\n .with_payload(true)\n .with_vectors(false),\n )\n .await?;\n" language: rust @@ -1087,20 +1093,14 @@ paths: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.scroll(\n collection_name=\"{collection_name}\",\n scroll_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n limit=1,\n with_payload=True,\n with_vectors=False,\n)\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.ScrollAsync(\n collectionName: \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"),\n limit: 1,\n payloadSelector: true\n);\n" - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/scroll' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"with_payload\": [\n \"city\",\n \"color\"\n ],\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n },\n \"limit\": 2,\n \"with_vector\": false\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.scroll(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n limit: 1,\n with_payload: true,\n with_vector: false,\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\nimport static io.qdrant.client.WithPayloadSelectorFactory.enable;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.ScrollPoints;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .scrollAsync(\n ScrollPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"color\", \"red\")).build())\n .setLimit(1)\n .setWithPayload(enable(true))\n .build())\n .get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc scroll() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tlimit := uint32(1)\n\tresults, err := client.Scroll(context.Background(), &qdrant.ScrollPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t},\n\t\tLimit: &limit,\n\t\tWithPayload: qdrant.NewWithPayloadEnable(true),\n\t\tWithVectors: qdrant.NewWithVectorsEnable(false),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.scroll(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n limit: 1,\n with_payload: true,\n with_vector: false,\n});\n" - language: typescript description: 'Returns all points in a page-by-page manner. By default, all resulting points are sorted by {id}. @@ -1116,6 +1116,12 @@ paths: /collections/{collection_name}/points/search: post: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchAsync(\n collectionName: \"{collection_name}\",\n vector: new float[] { 0.2f, 0.1f, 0.9f, 0.7f },\n filter: MatchKeyword(\"city\", \"London\"),\n limit: 3\n);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"limit\": 1,\n \"filter\": {\n \"must\": [\n {\n \"key\": \"city\",\n \"match\": {\n \"value\": \"London\"\n }\n }\n ]\n }\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{Condition, Filter, SearchParamsBuilder, SearchPointsBuilder};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .search_points(\n SearchPointsBuilder::new(\"{collection_name}\", vec![0.2, 0.1, 0.9, 0.7], 3)\n .filter(Filter::must([Condition::matches(\n \"city\",\n \"London\".to_string(),\n )]))\n .params(SearchParamsBuilder::default().hnsw_ef(128).exact(false)),\n )\n .await?;\n" language: rust @@ -1123,20 +1129,14 @@ paths: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.search(\n collection_name=\"{collection_name}\",\n query_filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"city\",\n match=models.MatchValue(\n value=\"London\",\n ),\n )\n ]\n ),\n query_vector=[0.2, 0.1, 0.9, 0.7],\n limit=3,\n)\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchAsync(\n collectionName: \"{collection_name}\",\n vector: new float[] { 0.2f, 0.1f, 0.9f, 0.7f },\n filter: MatchKeyword(\"city\", \"London\"),\n limit: 3\n);\n" - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"limit\": 1,\n \"filter\": {\n \"must\": [\n {\n \"key\": \"city\",\n \"match\": {\n \"value\": \"London\"\n }\n }\n ]\n }\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.search(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"city\",\n match: {\n value: \"London\",\n },\n },\n ],\n },\n vector: [0.2, 0.1, 0.9, 0.7],\n limit: 3,\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .searchAsync(\n SearchPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\")).build())\n .addAllVector(List.of(0.2f, 0.1f, 0.9f, 0.7f))\n .setLimit(3)\n .build())\n .get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc search() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tlimit := uint64(3)\n\tresults, err := client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQuery(0.2, 0.1, 0.9, 0.7),\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"city\", \"London\"),\n\t\t\t},\n\t\t},\n\t\tLimit: &limit,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.search(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"city\",\n match: {\n value: \"London\",\n },\n },\n ],\n },\n vector: [0.2, 0.1, 0.9, 0.7],\n limit: 3,\n});\n" - language: typescript description: Retrieves the closest points based on vector similarity and given filtering conditions. summary: Search points tags: @@ -1144,6 +1144,12 @@ paths: /collections/{collection_name}/points/search/batch: post: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter = MatchKeyword(\"city\", \"London\");\n\nvar searches = new List\n{\n new()\n {\n Vector = { new float[] { 0.2f, 0.1f, 0.9f, 0.7f } },\n Filter = filter,\n Limit = 3\n },\n new()\n {\n Vector = { new float[] { 0.5f, 0.3f, 0.2f, 0.3f } },\n Filter = filter,\n Limit = 3\n }\n};\n\nawait client.SearchBatchAsync(collectionName: \"{collection_name}\", searches: searches);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"limit\": 3\n },\n {\n \"vector\": [\n 0.5,\n 0.3,\n 0.2,\n 0.3\n ],\n \"filter\": {\n \"must\": [\n {\n \"key\": \"city\",\n \"match\": {\n \"value\": \"London\"\n }\n }\n ]\n },\n \"limit\": 3\n }\n ]\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{\n Condition, Filter, SearchBatchPointsBuilder, SearchPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet filter = Filter::must([Condition::matches(\"city\", \"London\".to_string())]);\n\nlet searches = vec![\n SearchPointsBuilder::new(\"{collection_name}\", vec![0.2, 0.1, 0.9, 0.7], 3)\n .filter(filter.clone())\n .build(),\n SearchPointsBuilder::new(\"{collection_name}\", vec![0.5, 0.3, 0.2, 0.3], 3)\n .filter(filter.clone())\n .build(),\n];\n\nclient\n .search_batch_points(SearchBatchPointsBuilder::new(\"{collection_name}\", searches))\n .await?;\n" language: rust @@ -1151,20 +1157,14 @@ paths: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nfilter_ = models.Filter(\n must=[\n models.FieldCondition(\n key=\"city\",\n match=models.MatchValue(\n value=\"London\",\n ),\n )\n ]\n)\n\nsearch_queries = [\n models.SearchRequest(vector=[0.2, 0.1, 0.9, 0.7], filter=filter_, limit=3),\n models.SearchRequest(vector=[0.5, 0.3, 0.2, 0.3], filter=filter_, limit=3),\n]\n\nclient.search_batch(collection_name=\"{collection_name}\", requests=search_queries)\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter = MatchKeyword(\"city\", \"London\");\n\nvar searches = new List\n{\n new()\n {\n Vector = { new float[] { 0.2f, 0.1f, 0.9f, 0.7f } },\n Filter = filter,\n Limit = 3\n },\n new()\n {\n Vector = { new float[] { 0.5f, 0.3f, 0.2f, 0.3f } },\n Filter = filter,\n Limit = 3\n }\n};\n\nawait client.SearchBatchAsync(collectionName: \"{collection_name}\", searches: searches);\n" - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"limit\": 3\n },\n {\n \"vector\": [\n 0.5,\n 0.3,\n 0.2,\n 0.3\n ],\n \"filter\": {\n \"must\": [\n {\n \"key\": \"city\",\n \"match\": {\n \"value\": \"London\"\n }\n }\n ]\n },\n \"limit\": 3\n }\n ]\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nconst filter = {\n must: [\n {\n key: \"city\",\n match: {\n value: \"London\",\n },\n },\n ],\n};\n\nconst searches = [\n {\n vector: [0.2, 0.1, 0.9, 0.7],\n filter,\n limit: 3,\n },\n {\n vector: [0.5, 0.3, 0.2, 0.3],\n filter,\n limit: 3,\n },\n];\n\nclient.searchBatch(\"{collection_name}\", {\n searches,\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\")).build();\nList searches =\n List.of(\n SearchPoints.newBuilder()\n .addAllVector(List.of(0.2f, 0.1f, 0.9f, 0.7f))\n .setFilter(filter)\n .setLimit(3)\n .build(),\n SearchPoints.newBuilder()\n .addAllVector(List.of(0.5f, 0.3f, 0.2f, 0.3f))\n .setFilter(filter)\n .setLimit(3)\n .build());\nclient.searchBatchAsync(\"{collection_name}\", searches, null).get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc searchBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfilter := qdrant.Filter{\n\t\tMust: []*qdrant.Condition{\n\t\t\tqdrant.NewMatch(\"city\", \"London\"),\n\t\t},\n\t}\n\tlimit := uint64(3)\n\tresults, err := client.QueryBatch(context.Background(), &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQuery(0.2, 0.1, 0.9, 0.7),\n\t\t\t\tLimit: &limit,\n\t\t\t\tFilter: &filter,\n\t\t\t},\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQuery(0.5, 0.3, 0.2, 0.3),\n\t\t\t\tLimit: &limit,\n\t\t\t\tFilter: &filter,\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nconst filter = {\n must: [\n {\n key: \"city\",\n match: {\n value: \"London\",\n },\n },\n ],\n};\n\nconst searches = [\n {\n vector: [0.2, 0.1, 0.9, 0.7],\n filter,\n limit: 3,\n },\n {\n vector: [0.5, 0.3, 0.2, 0.3],\n filter,\n limit: 3,\n },\n];\n\nclient.searchBatch(\"{collection_name}\", {\n searches,\n});\n" - language: typescript description: Retrieves the closest points in batches based on vector similarity and given filtering conditions. summary: Search batch points tags: @@ -1172,6 +1172,12 @@ paths: /collections/{collection_name}/points/search/groups: post: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchGroupsAsync(\n collectionName: \"{collection_name}\",\n vector: new float[] { 1.1f },\n groupBy: \"document_id\",\n limit: 4,\n groupSize: 2\n);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search/groups' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"group_by\": \"document_id\",\n \"limit\": 4,\n \"group_size\": 2\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::SearchPointGroupsBuilder;\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .search_groups(SearchPointGroupsBuilder::new(\n \"{collection_name}\",\n vec![1.1],\n 4,\n \"document_id\",\n 2,\n ))\n .await?;\n" language: rust @@ -1179,20 +1185,14 @@ paths: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.search_groups(\n collection_name=\"{collection_name}\",\n query_vector=[1.1],\n group_by=\"document_id\",\n limit=4,\n group_size=2,\n)\n" language: python - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchGroupsAsync(\n collectionName: \"{collection_name}\",\n vector: new float[] { 1.1f },\n groupBy: \"document_id\",\n limit: 4,\n groupSize: 2\n);\n" - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search/groups' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"group_by\": \"document_id\",\n \"limit\": 4,\n \"group_size\": 2\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.searchPointGroups(\"{collection_name}\", {\n vector: [1.1],\n group_by: \"document_id\",\n limit: 4,\n group_size: 2,\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.SearchPointGroups;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .searchGroupsAsync(\n SearchPointGroups.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .addAllVector(List.of(1.1f))\n .setGroupBy(\"document_id\")\n .setLimit(4)\n .setGroupSize(2)\n .build())\n .get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc searchGroups() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tgroupSize := uint64(2)\n\tresults, err := client.QueryGroups(context.Background(), &qdrant.QueryPointGroups{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\tGroupBy: \"document_id\",\n\t\tGroupSize: &groupSize,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.searchPointGroups(\"{collection_name}\", {\n vector: [1.1],\n group_by: \"document_id\",\n limit: 4,\n group_size: 2,\n});\n" - language: typescript description: Retrieves the closest points based on vector similarity and given filtering conditions, grouped by a given payload field. summary: Search point groups tags: @@ -1200,6 +1200,9 @@ paths: /collections/{collection_name}/points/search/matrix/offsets: post: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchMatrixOffsetsAsync(\n \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"),\n sample: 100,\n limit: 5\n);" + language: csharp - code-samples: - code: "use qdrant_client::qdrant::{Condition, SearchMatrixPointsBuilder, Filter};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .search_matrix_offsets(\n SearchMatrixPointsBuilder::new(\"{collection_name}\")\n .filter(Filter::must(vec![Condition::matches(\n \"color\",\n \"red\".to_string(),\n )]))\n .sample(100)\n .limit(5),\n )\n .await?;" language: rust @@ -1207,17 +1210,14 @@ paths: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.search_matrix_offsets(\n collection_name=\"{collection_name}\",\n sample=100,\n limit=5,\n query_filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"color\", match=models.MatchValue(value=\"red\")\n ),\n ]\n ),\n)" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchMatrixOffsetsAsync(\n \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"),\n sample: 100,\n limit: 5\n);" - language: csharp + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.searchMatrixOffsets(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n sample: 100,\n limit: 5,\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchMatrixPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .searchMatrixOffsetsAsync(\n SearchMatrixPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setFilter(\n Filter.newBuilder()\n .addMust(matchKeyword(\"color\", \"red\"))\n .build()\n )\n .setSample(100)\n .setLimit(5)\n .build())\n .get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc searchMatiOffsets() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsample := uint64(100)\n\tlimit := uint64(5)\n\tresults, err := client.SearchMatrixOffsets(context.Background(), &qdrant.SearchMatrixPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tSample: &sample,\n\t\tLimit: &limit,\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.searchMatrixOffsets(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n sample: 100,\n limit: 5,\n});\n" - language: typescript description: Retrieves sparse matrix of pairwise distances between points sampled from the collection. Output is a form of row and column offsets and list of distances. summary: Distance matrix offsets tags: @@ -1225,6 +1225,9 @@ paths: /collections/{collection_name}/points/search/matrix/pairs: post: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchMatrixPairsAsync(\n \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"),\n sample: 100,\n limit: 5\n);" + language: csharp - code-samples: - code: "use qdrant_client::qdrant::{Condition, SearchMatrixPointsBuilder, Filter};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .search_matrix_pairs(\n SearchMatrixPointsBuilder::new(\"{collection_name}\")\n .filter(Filter::must(vec![Condition::matches(\n \"color\",\n \"red\".to_string(),\n )]))\n .sample(100)\n .limit(5),\n )\n .await?;\n" language: rust @@ -1232,17 +1235,14 @@ paths: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.search_matrix_pairs(\n collection_name=\"{collection_name}\",\n sample=100,\n limit=5,\n query_filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"color\", match=models.MatchValue(value=\"red\")\n ),\n ]\n ),\n)" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchMatrixPairsAsync(\n \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"),\n sample: 100,\n limit: 5\n);" - language: csharp + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.searchMatrixPairs(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n sample: 100,\n limit: 5,\n});" + language: typescript - code-samples: - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchMatrixPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .searchMatrixPairsAsync(\n SearchMatrixPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setFilter(\n Filter.newBuilder()\n .addMust(matchKeyword(\"color\", \"red\"))\n .build()\n )\n .setSample(100)\n .setLimit(5)\n .build())\n .get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc searchMatixPairs() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsample := uint64(100)\n\tlimit := uint64(5)\n\tresults, err := client.SearchMatrixPairs(context.Background(), &qdrant.SearchMatrixPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tSample: &sample,\n\t\tLimit: &limit,\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.searchMatrixPairs(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n sample: 100,\n limit: 5,\n});" - language: typescript description: Retrieves sparse matrix of pairwise distances between points sampled from the collection. Output is a list of pairs of points and their distances. summary: Distance matrix pairs tags: @@ -1250,6 +1250,12 @@ paths: /collections/{collection_name}/points/vectors: put: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateVectorsAsync(\n collectionName: \"{collection_name}\",\n points: new List\n {\n new() { Id = 1, Vectors = (\"image\", new float[] { 0.1f, 0.2f, 0.3f, 0.4f }) },\n new()\n {\n Id = 2,\n Vectors = (\"text\", new float[] { 0.9f, 0.8f, 0.7f, 0.6f, 0.5f, 0.4f, 0.3f, 0.2f })\n }\n }\n);\n" + language: csharp + - code-samples: + - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points/vectors?wait=true' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"points\": [\n {\n \"id\": 1,\n \"vector\": [\n 0.0984,\n 0.1406,\n 0.8973\n ]\n },\n {\n \"id\": 2,\n \"vector\": {\n \"vector-name\": [\n 0.9,\n 0.8,\n 0.7,\n 0.6\n ]\n }\n }\n ]\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{PointVectors, UpdatePointVectorsBuilder};\nuse qdrant_client::Qdrant;\nuse std::collections::HashMap;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .update_vectors(\n UpdatePointVectorsBuilder::new(\n \"{collection_name}\",\n vec![\n PointVectors {\n id: Some(1.into()),\n vectors: Some(\n HashMap::from([(\"image\".to_string(), vec![0.1, 0.2, 0.3, 0.4])])\n .into(),\n ),\n },\n PointVectors {\n id: Some(2.into()),\n vectors: Some(\n HashMap::from([(\n \"text\".to_string(),\n vec![0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n )])\n .into(),\n ),\n },\n ],\n )\n .wait(true),\n )\n .await?;\n" language: rust @@ -1257,20 +1263,14 @@ paths: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.update_vectors(\n collection_name=\"{collection_name}\",\n points=[\n models.PointVectors(\n id=1,\n vector={\n \"image\": [0.1, 0.2, 0.3, 0.4],\n },\n ),\n models.PointVectors(\n id=2,\n vector={\n \"text\": [0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n ),\n ],\n)\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateVectorsAsync(\n collectionName: \"{collection_name}\",\n points: new List\n {\n new() { Id = 1, Vectors = (\"image\", new float[] { 0.1f, 0.2f, 0.3f, 0.4f }) },\n new()\n {\n Id = 2,\n Vectors = (\"text\", new float[] { 0.9f, 0.8f, 0.7f, 0.6f, 0.5f, 0.4f, 0.3f, 0.2f })\n }\n }\n);\n" - language: csharp - - code-samples: - - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points/vectors?wait=true' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"points\": [\n {\n \"id\": 1,\n \"vector\": [\n 0.0984,\n 0.1406,\n 0.8973\n ]\n },\n {\n \"id\": 2,\n \"vector\": {\n \"vector-name\": [\n 0.9,\n 0.8,\n 0.7,\n 0.6\n ]\n }\n }\n ]\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.updateVectors(\"{collection_name}\", {\n points: [\n {\n id: 1,\n vector: {\n image: [0.1, 0.2, 0.3, 0.4],\n },\n },\n {\n id: 2,\n vector: {\n text: [0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n },\n ],\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .updateVectorsAsync(\n \"{collection_name}\",\n List.of(\n PointVectors.newBuilder()\n .setId(id(1))\n .setVectors(namedVectors(Map.of(\"image\", vector(List.of(0.1f, 0.2f, 0.3f, 0.4f)))))\n .build(),\n PointVectors.newBuilder()\n .setId(id(2))\n .setVectors(\n namedVectors(\n Map.of(\n \"text\", vector(List.of(0.9f, 0.8f, 0.7f, 0.6f, 0.5f, 0.4f, 0.3f, 0.2f)))))\n .build()))\n .get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc updateVectors() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.UpdateVectors(context.Background(), &qdrant.UpdatePointVectors{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: []*qdrant.PointVectors{\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(1),\n\t\t\t\tVectors: qdrant.NewVectorsMap(map[string]*qdrant.Vector{\n\t\t\t\t\t\"image\": qdrant.NewVector(0.1, 0.2, 0.3, 0.4),\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(2),\n\t\t\t\tVectors: qdrant.NewVectorsMap(map[string]*qdrant.Vector{\n\t\t\t\t\t\"text\": qdrant.NewVector(0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2),\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.updateVectors(\"{collection_name}\", {\n points: [\n {\n id: 1,\n vector: {\n image: [0.1, 0.2, 0.3, 0.4],\n },\n },\n {\n id: 2,\n vector: {\n text: [0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n },\n ],\n});\n" - language: typescript description: Updates specified vectors on points. All other unspecified vectors will stay intact. summary: Update vectors tags: @@ -1278,12 +1278,6 @@ paths: /collections/{collection_name}/points/vectors/delete: post: x-fern-examples: - - code-samples: - - code: "use qdrant_client::qdrant::{DeletePointVectorsBuilder, PointsIdsList, VectorsSelector};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .delete_vectors(\n DeletePointVectorsBuilder::new(\"{collection_name}\")\n .points_selector(PointsIdsList {\n ids: vec![0.into(), 3.into(), 10.into()],\n })\n .vectors(VectorsSelector {\n names: vec![\"text\".into(), \"image\".into()],\n })\n .wait(true),\n )\n .await?;\n" - language: rust - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete_vectors(\n collection_name=\"{collection_name}\",\n points=[0, 3, 100],\n vectors=[\"text\", \"image\"],\n)\n" - language: python - code-samples: - code: 'using Qdrant.Client; @@ -1298,15 +1292,21 @@ paths: - code-samples: - code: "# Delete vectors by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/vectors/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"points\": [\n 0,\n 3,\n 10\n ],\n \"vectors\": [\n \"text\",\n \"image\"\n ]\n}'\n\n# Delete vectors by filter\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/vectors/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n },\n \"vectors\": [\n \"text\",\n \"image\"\n ]\n}'" language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{DeletePointVectorsBuilder, PointsIdsList, VectorsSelector};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .delete_vectors(\n DeletePointVectorsBuilder::new(\"{collection_name}\")\n .points_selector(PointsIdsList {\n ids: vec![0.into(), 3.into(), 10.into()],\n })\n .vectors(VectorsSelector {\n names: vec![\"text\".into(), \"image\".into()],\n })\n .wait(true),\n )\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete_vectors(\n collection_name=\"{collection_name}\",\n points=[0, 3, 100],\n vectors=[\"text\", \"image\"],\n)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.deleteVectors(\"{collection_name}\", {\n points: [0, 3, 10],\n vectors: [\"text\", \"image\"],\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .deleteVectorsAsync(\n \"{collection_name}\", List.of(\"text\", \"image\"), List.of(id(0), id(3), id(10)))\n .get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteVectors() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.DeleteVectors(context.Background(), &qdrant.DeletePointVectors{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(100)),\n\t\tVectors: &qdrant.VectorsSelector{\n\t\t\tNames: []string{\"text\", \"image\"},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.deleteVectors(\"{collection_name}\", {\n points: [0, 3, 10],\n vectors: [\"text\", \"image\"],\n});\n" - language: typescript description: Deletes specified vectors from points. All other unspecified vectors will stay intact. summary: Delete vectors tags: @@ -1314,6 +1314,12 @@ paths: /collections/{collection_name}/shards: put: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.CreateShardKeyAsync(\n \"{collection_name}\",\n new CreateShardKey { ShardKey = new ShardKey { Keyword = \"{shard_key}\", } }\n);\n" + language: csharp + - code-samples: + - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/shards' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"shard_key\": \"{shard_key}\"\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::shard_key::Key;\nuse qdrant_client::qdrant::{CreateShardKeyBuilder, CreateShardKeyRequestBuilder};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .create_shard_key(\n CreateShardKeyRequestBuilder::new(\"{collection_name}\").request(\n CreateShardKeyBuilder::default()\n .shard_key(Key::Keyword(\"{shard_key}\".to_string())),\n ),\n )\n .await?;\n" language: rust @@ -1329,20 +1335,14 @@ paths: ' language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.CreateShardKeyAsync(\n \"{collection_name}\",\n new CreateShardKey { ShardKey = new ShardKey { Keyword = \"{shard_key}\", } }\n);\n" - language: csharp - - code-samples: - - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/shards' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"shard_key\": \"{shard_key}\"\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n});\n\nclient.createShardKey(\"{collection_name}\", {\n shard_key: \"{shard_key}\"\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.CreateShardKey;\nimport io.qdrant.client.grpc.Collections.CreateShardKeyRequest;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createShardKeyAsync(CreateShardKeyRequest.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setRequest(CreateShardKey.newBuilder()\n .setShardKey(shardKey(\"{shard_key}\"))\n .build())\n .build()).get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc createShardKey() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.CreateShardKey(context.Background(), \"{collection_name}\", &qdrant.CreateShardKey{\n\t\tShardKey: qdrant.NewShardKey(\"{shard_key}\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n});\n\nclient.createShardKey(\"{collection_name}\", {\n shard_key: \"{shard_key}\"\n});\n" - language: typescript description: Creates one or more shard keys for a specified collection. summary: Create a shard key tags: @@ -1350,6 +1350,12 @@ paths: /collections/{collection_name}/shards/delete: post: x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.DeleteShardKeyAsync(\n \"{collection_name}\",\n new DeleteShardKey { ShardKey = new ShardKey { Keyword = \"shard_key\", } }\n);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/shards/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"shard_key\": \"{shard_key}\"\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::shard_key::Key;\nuse qdrant_client::qdrant::DeleteShardKeyRequestBuilder;\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .delete_shard_key(\n DeleteShardKeyRequestBuilder::new(\"{collection_name}\")\n .key(Key::Keyword(\"{shard_key}\".to_string())),\n )\n .await?;\n" language: rust @@ -1365,20 +1371,14 @@ paths: ' language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.DeleteShardKeyAsync(\n \"{collection_name}\",\n new DeleteShardKey { ShardKey = new ShardKey { Keyword = \"shard_key\", } }\n);\n" - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/shards/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"shard_key\": \"{shard_key}\"\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n});\n\nclient.deleteShardKey(\"{collection_name}\", {\n shard_key: \"{shard_key}\"\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.DeleteShardKey;\nimport io.qdrant.client.grpc.Collections.DeleteShardKeyRequest;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteShardKeyAsync(DeleteShardKeyRequest.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setRequest(DeleteShardKey.newBuilder()\n .setShardKey(shardKey(\"{shard_key}\"))\n .build())\n .build()).get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteShardKey() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteShardKey(context.Background(), \"{collection_name}\", &qdrant.DeleteShardKey{\n\t\tShardKey: qdrant.NewShardKey(\"{shard_key}\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n});\n\nclient.deleteShardKey(\"{collection_name}\", {\n shard_key: \"{shard_key}\"\n});\n" - language: typescript description: Deletes one or more shard keys for a specified collection. summary: Delete a shard key tags: @@ -1386,6 +1386,20 @@ paths: /collections/{collection_name}/snapshots: get: x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ListSnapshotsAsync("{collection_name}"); + +' + language: csharp + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/snapshots' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'use qdrant_client::Qdrant; @@ -1409,42 +1423,42 @@ paths: ' language: python - code-samples: - - code: 'using Qdrant.Client; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - var client = new QdrantClient("localhost", 6334); + const client = new QdrantClient({ host: "localhost", port: 6333 }); - await client.ListSnapshotsAsync("{collection_name}"); + client.listSnapshots("{collection_name}"); ' - language: csharp - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/snapshots' \\\n --header 'api-key: '" - language: curl + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listSnapshotAsync(\"{collection_name}\").get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc listSnapshots() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsnapshots, err := client.ListSnapshots(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Snapshots: \", snapshots)\n}\n" language: go + description: Retrieves a list of all snapshots for a specified collection. + summary: List all snapshots (collection) + tags: + - Snapshots + post: + x-fern-examples: - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.listSnapshots("{collection_name}"); + await client.CreateSnapshotAsync("{collection_name}"); ' - language: typescript - description: Retrieves a list of all snapshots for a specified collection. - summary: List all snapshots (collection) - tags: - - Snapshots - post: - x-fern-examples: + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/snapshots' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'use qdrant_client::Qdrant; @@ -1468,36 +1482,22 @@ paths: ' language: python - code-samples: - - code: 'using Qdrant.Client; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - var client = new QdrantClient("localhost", 6334); + const client = new QdrantClient({ host: "localhost", port: 6333 }); - await client.CreateSnapshotAsync("{collection_name}"); + client.createSnapshot("{collection_name}"); ' - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/snapshots' \\\n --header 'api-key: '" - language: curl + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createSnapshotAsync(\"{collection_name}\").get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc createSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsnapshot, err := client.CreateSnapshot(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Snapshot created: \", snapshot.Name)\n}\n" language: go - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.createSnapshot("{collection_name}"); - -' - language: typescript description: Creates a new snapshot for a specified collection. summary: Create a snapshot (collection) tags: @@ -1505,12 +1505,12 @@ paths: /collections/{collection_name}/snapshots/recover: put: x-fern-examples: - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.recover_snapshot(\n \"{collection_name}\",\n \"http://example.com/path/to/snapshot.shapshot\",\n)\n" - language: python - code-samples: - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/snapshots/recover' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"location\": \"http://example.com/path/to/snapshot.shapshot\"\n}'" language: curl + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.recover_snapshot(\n \"{collection_name}\",\n \"http://example.com/path/to/snapshot.shapshot\",\n)\n" + language: python - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.recoverSnapshot(\"{collection_name}\", {\n location: \"http://example.com/path/to/snapshot.shapshot\",\n});\n" language: typescript @@ -1531,12 +1531,6 @@ paths: /collections/{collection_name}/snapshots/{snapshot_name}: delete: x-fern-examples: - - code-samples: - - code: "use qdrant_client::qdrant::DeleteSnapshotRequestBuilder;\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .delete_snapshot(DeleteSnapshotRequestBuilder::new(\n \"{collection_name}\",\n \"{snapshot_name}\",\n ))\n .await?;\n" - language: rust - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete_snapshot(\n collection_name=\"{collection_name}\", snapshot_name=\"{snapshot_name}\"\n)\n" - language: python - code-samples: - code: 'using Qdrant.Client; @@ -1552,11 +1546,11 @@ paths: - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/snapshots/snapshot_name' \\\n --header 'api-key: '" language: curl - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteSnapshotAsync(\"{collection_name}\", \"{snapshot_name}\").get();\n" - language: java + - code: "use qdrant_client::qdrant::DeleteSnapshotRequestBuilder;\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .delete_snapshot(DeleteSnapshotRequestBuilder::new(\n \"{collection_name}\",\n \"{snapshot_name}\",\n ))\n .await?;\n" + language: rust - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteSnapshot(context.Background(), \"{collection_name}\", \"{snapshot_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete_snapshot(\n collection_name=\"{collection_name}\", snapshot_name=\"{snapshot_name}\"\n)\n" + language: python - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -1568,6 +1562,12 @@ paths: ' language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteSnapshotAsync(\"{collection_name}\", \"{snapshot_name}\").get();\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteSnapshot(context.Background(), \"{collection_name}\", \"{snapshot_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go description: Deletes the specified snapshot for a collection. summary: Delete a snapshot (collection) tags: @@ -1580,6 +1580,20 @@ paths: /snapshots: get: x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ListFullSnapshotsAsync(); + +' + language: csharp + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/snapshots' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'use qdrant_client::Qdrant; @@ -1603,42 +1617,42 @@ paths: ' language: python - code-samples: - - code: 'using Qdrant.Client; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - var client = new QdrantClient("localhost", 6334); + const client = new QdrantClient({ host: "localhost", port: 6333 }); - await client.ListFullSnapshotsAsync(); + client.listFullSnapshots(); ' - language: csharp - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/snapshots' \\\n --header 'api-key: '" - language: curl + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listFullSnapshotAsync().get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc listFullSnapshots() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsnapshots, err := client.ListFullSnapshots(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Full snapshots: \", snapshots)\n}\n" language: go + description: Returns a list of all snapshots for the entire storage. + summary: List all snapshots (storage) + tags: + - Snapshots + post: + x-fern-examples: - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.listFullSnapshots(); + await client.CreateFullSnapshotAsync(); ' - language: typescript - description: Returns a list of all snapshots for the entire storage. - summary: List all snapshots (storage) - tags: - - Snapshots - post: - x-fern-examples: + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/snapshots' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'use qdrant_client::Qdrant; @@ -1662,36 +1676,22 @@ paths: ' language: python - code-samples: - - code: 'using Qdrant.Client; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - var client = new QdrantClient("localhost", 6334); + const client = new QdrantClient({ host: "localhost", port: 6333 }); - await client.CreateFullSnapshotAsync(); + client.createFullSnapshot(); ' - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/snapshots' \\\n --header 'api-key: '" - language: curl + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createFullSnapshotAsync().get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc createFullSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsnapshot, err := client.CreateFullSnapshot(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Snapshot created: \", snapshot.Name)\n}\n" language: go - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.createFullSnapshot(); - -' - language: typescript description: Creates a new snapshot of the entire storage. summary: Create a snapshot (storage) tags: @@ -1699,6 +1699,20 @@ paths: /snapshots/{snapshot_name}: delete: x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.DeleteFullSnapshotAsync("{snapshot_name}"); + +' + language: csharp + - code-samples: + - code: "curl -X DELETE \\\n 'http://localhost:6333/snapshots/snapshot_name' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'use qdrant_client::Qdrant; @@ -1722,36 +1736,22 @@ paths: ' language: python - code-samples: - - code: 'using Qdrant.Client; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - var client = new QdrantClient("localhost", 6334); + const client = new QdrantClient({ host: "localhost", port: 6333 }); - await client.DeleteFullSnapshotAsync("{snapshot_name}"); + client.deleteFullSnapshot("{snapshot_name}"); ' - language: csharp - - code-samples: - - code: "curl -X DELETE \\\n 'http://localhost:6333/snapshots/snapshot_name' \\\n --header 'api-key: '" - language: curl + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteFullSnapshotAsync(\"{snapshot_name}\").get();\n" language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteFullSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteFullSnapshot(context.Background(), \"{snapshot_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.deleteFullSnapshot("{snapshot_name}"); - -' - language: typescript description: Deletes the specified snapshot of the entire storage. summary: Delete a snapshot (storage) tags: diff --git a/fern/apis/master/openapi.json b/fern/apis/master/openapi.json index 68d159f..c078e9c 100644 --- a/fern/apis/master/openapi.json +++ b/fern/apis/master/openapi.json @@ -578,7 +578,6 @@ "summary": "Search points", "description": "Retrieve closest points based on vector similarity and given filtering conditions", "operationId": "search_points", - "availability": "deprecated", "requestBody": { "description": "Search request with optional filtering", "content": { @@ -4877,7 +4876,6 @@ "Search" ], "summary": "Search batch points", - "deprecated": true, "description": "Retrieve by batch the closest points based on vector similarity and given filtering conditions", "operationId": "search_batch_points", "requestBody": { @@ -7345,6 +7343,64 @@ "format": "uint", "minimum": 0, "nullable": true + }, + "multivector_config": { + "description": "Multivector configuration", + "anyOf": [ + { + "$ref": "#/components/schemas/StrictModeMultivectorConfig" + }, + { + "nullable": true + } + ] + }, + "sparse_config": { + "description": "Sparse vector configuration", + "anyOf": [ + { + "$ref": "#/components/schemas/StrictModeSparseConfig" + }, + { + "nullable": true + } + ] + } + } + }, + "StrictModeMultivectorConfig": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/StrictModeMultivector" + } + }, + "StrictModeMultivector": { + "type": "object", + "properties": { + "max_vectors": { + "description": "Max number of vectors in a multivector", + "type": "integer", + "format": "uint", + "minimum": 1, + "nullable": true + } + } + }, + "StrictModeSparseConfig": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/StrictModeSparse" + } + }, + "StrictModeSparse": { + "type": "object", + "properties": { + "max_length": { + "description": "Max length of sparse vector", + "type": "integer", + "format": "uint", + "minimum": 1, + "nullable": true } } }, diff --git a/fern/apis/v1.13.x/openapi-overrides.yml b/fern/apis/v1.13.x/openapi-overrides.yml index f967187..fa09815 100644 --- a/fern/apis/v1.13.x/openapi-overrides.yml +++ b/fern/apis/v1.13.x/openapi-overrides.yml @@ -17,6 +17,21 @@ paths: tags: - Aliases x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ListAliasesAsync(); + + ' + language: csharp + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/aliases' \\\n --header\ + \ 'api-key: '" + language: curl - code-samples: - code: 'use qdrant_client::Qdrant; @@ -40,20 +55,16 @@ paths: ' language: python - code-samples: - - code: 'using Qdrant.Client; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - var client = new QdrantClient("localhost", 6334); + const client = new QdrantClient({ host: "localhost", port: 6333 }); - await client.ListAliasesAsync(); + client.getAliases(); ' - language: csharp - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/aliases' \\\n --header\ - \ 'api-key: '" - language: curl + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ @@ -67,17 +78,6 @@ paths: \tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Aliases: \", aliases)\n\ }\n" language: go - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.getAliases(); - - ' - language: typescript /cluster: get: description: Returns information about the cluster's current state and composition. @@ -105,6 +105,21 @@ paths: tags: - Collections x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ListCollectionsAsync(); + + ' + language: csharp + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/collections' \\\n --header\ + \ 'api-key: '" + language: curl - code-samples: - code: 'use qdrant_client::Qdrant; @@ -128,20 +143,16 @@ paths: ' language: python - code-samples: - - code: 'using Qdrant.Client; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - var client = new QdrantClient("localhost", 6334); + const client = new QdrantClient({ host: "localhost", port: 6333 }); - await client.ListCollectionsAsync(); + client.getCollections(); ' - language: csharp - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections' \\\n --header\ - \ 'api-key: '" - language: curl + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ @@ -155,17 +166,6 @@ paths: \tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Collections: \"\ , collections)\n}\n" language: go - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.getCollections(); - - ' - language: typescript /collections/aliases: post: description: Updates aliases for the specified collections. @@ -173,24 +173,6 @@ paths: tags: - Aliases x-fern-examples: - - code-samples: - - code: "use qdrant_client::qdrant::{CreateAliasBuilder, DeleteAlias};\nuse\ - \ qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ - ).build()?;\n\nclient\n .create_alias(CreateAliasBuilder::new(\n \ - \ \"example_collection\",\n \"production_collection\",\n \ - \ ))\n .await?;\n\nclient\n .delete_alias(DeleteAlias {\n \ - \ alias_name: \"production_collection\".to_string(),\n })\n .await?;\n" - language: rust - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.update_collection_aliases(\n change_aliases_operations=[\n\ - \ models.CreateAliasOperation(\n create_alias=models.CreateAlias(\n\ - \ collection_name=\"example_collection\", alias_name=\"\ - production_collection\"\n )\n )\n ]\n)\n\nclient.update_collection_aliases(\n\ - \ change_aliases_operations=[\n models.DeleteAliasOperation(\n\ - \ delete_alias=models.DeleteAlias(alias_name=\"production_collection\"\ - )\n ),\n ]\n)\n" - language: python - code-samples: - code: 'using Qdrant.Client; @@ -223,6 +205,33 @@ paths: ,\n \"new_alias_name\": \"{new_alias_name}\"\n }\n }\n\ \ ]\n}'\n" language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{CreateAliasBuilder, DeleteAlias};\nuse\ + \ qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .create_alias(CreateAliasBuilder::new(\n \ + \ \"example_collection\",\n \"production_collection\",\n \ + \ ))\n .await?;\n\nclient\n .delete_alias(DeleteAlias {\n \ + \ alias_name: \"production_collection\".to_string(),\n })\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.update_collection_aliases(\n change_aliases_operations=[\n\ + \ models.CreateAliasOperation(\n create_alias=models.CreateAlias(\n\ + \ collection_name=\"example_collection\", alias_name=\"\ + production_collection\"\n )\n )\n ]\n)\n\nclient.update_collection_aliases(\n\ + \ change_aliases_operations=[\n models.DeleteAliasOperation(\n\ + \ delete_alias=models.DeleteAlias(alias_name=\"production_collection\"\ + )\n ),\n ]\n)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.updateCollectionAliases({\n actions: [\n {\n create_alias:\ + \ {\n collection_name: \"example_collection\",\n alias_name:\ + \ \"production_collection\",\n },\n },\n ],\n});\n\nclient.updateCollectionAliases({\n\ + \ actions: [\n {\n delete_alias: {\n alias_name: \"production_collection\"\ + ,\n },\n },\n ],\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport\ \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -243,15 +252,6 @@ paths: \n\terr = client.RenameAlias(context.Background(), \"production_collection\"\ , \"legacy_collection\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.updateCollectionAliases({\n actions: [\n {\n create_alias:\ - \ {\n collection_name: \"example_collection\",\n alias_name:\ - \ \"production_collection\",\n },\n },\n ],\n});\n\nclient.updateCollectionAliases({\n\ - \ actions: [\n {\n delete_alias: {\n alias_name: \"production_collection\"\ - ,\n },\n },\n ],\n});\n" - language: typescript /collections/{collection_name}: delete: description: Drops the specified collection and all associated data in it. @@ -259,6 +259,21 @@ paths: tags: - Collections x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.DeleteCollectionAsync("{collection_name}"); + + ' + language: csharp + - code-samples: + - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name'\ + \ \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'use qdrant_client::Qdrant; @@ -282,20 +297,16 @@ paths: ' language: python - code-samples: - - code: 'using Qdrant.Client; + - code: 'import { QdrantClient } from ''@qdrant/qdrant-js''; - var client = new QdrantClient("localhost", 6334); + const client = new QdrantClient({url: ''http://127.0.0.1:6333''}); - await client.DeleteCollectionAsync("{collection_name}"); + client.deleteCollection("{collection_name}"); ' - language: csharp - - code-samples: - - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name'\ - \ \\\n --header 'api-key: '" - language: curl + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ @@ -309,23 +320,27 @@ paths: \tpanic(err)\n\t}\n\n\terr = client.DeleteCollection(context.Background(),\ \ \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go + get: + description: Retrieves parameters from the specified collection. + summary: Get collection details + tags: + - Collections + x-fern-examples: - code-samples: - - code: 'import { QdrantClient } from ''@qdrant/qdrant-js''; + - code: 'using Qdrant.Client; - const client = new QdrantClient({url: ''http://127.0.0.1:6333''}); + var client = new QdrantClient("localhost", 6334); - client.deleteCollection("{collection_name}"); + await client.GetCollectionInfoAsync("{collection_name}"); ' - language: typescript - get: - description: Retrieves parameters from the specified collection. - summary: Get collection details - tags: - - Collections - x-fern-examples: + language: csharp + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name'\ + \ \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'use qdrant_client::Qdrant; @@ -349,20 +364,16 @@ paths: ' language: python - code-samples: - - code: 'using Qdrant.Client; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - var client = new QdrantClient("localhost", 6334); + const client = new QdrantClient({ host: "localhost", port: 6333 }); - await client.GetCollectionInfoAsync("{collection_name}"); + client.getCollection("{collection_name}"); ' - language: csharp - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name'\ - \ \\\n --header 'api-key: '" - language: curl + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ @@ -377,23 +388,24 @@ paths: \ \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"\ Collection info: \", info)\n}\n" language: go - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.getCollection("{collection_name}"); - - ' - language: typescript patch: description: Updates the parameters of the specified collection. summary: Update collection parameters tags: - Collections x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateCollectionAsync(\n\ + \ collectionName: \"{collection_name}\",\n optimizersConfig: new OptimizersConfigDiff\ + \ { IndexingThreshold = 10000 }\n);\n" + language: csharp + - code-samples: + - code: "curl -X PATCH \\\n 'http://localhost:6333/collections/collection_name'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"optimizers_config\": {\n\ + \ \"indexing_threshold\": 10000\n }\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{OptimizersConfigDiffBuilder, UpdateCollectionBuilder};\n\ use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ @@ -408,17 +420,11 @@ paths: )\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateCollectionAsync(\n\ - \ collectionName: \"{collection_name}\",\n optimizersConfig: new OptimizersConfigDiff\ - \ { IndexingThreshold = 10000 }\n);\n" - language: csharp - - code-samples: - - code: "curl -X PATCH \\\n 'http://localhost:6333/collections/collection_name'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"optimizers_config\": {\n\ - \ \"indexing_threshold\": 10000\n }\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.updateCollection(\"{collection_name}\", {\n optimizers_config:\ + \ {\n indexing_threshold: 10000,\n },\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport\ \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -440,31 +446,12 @@ paths: \ &threshold,\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\ }\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.updateCollection(\"{collection_name}\", {\n optimizers_config:\ - \ {\n indexing_threshold: 10000,\n },\n});\n" - language: typescript put: description: Creates a new collection with the given parameters. summary: Create a collection tags: - Collections x-fern-examples: - - code-samples: - - code: "use qdrant_client::qdrant::{CreateCollectionBuilder, Distance, VectorParamsBuilder};\n\ - use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ - ).build()?;\n\nclient\n .create_collection(\n CreateCollectionBuilder::new(\"\ - {collection_name}\")\n .vectors_config(VectorParamsBuilder::new(100,\ - \ Distance::Cosine)),\n )\n .await?;\n" - language: rust - - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.create_collection(\n collection_name=\"\ - {collection_name}\",\n vectors_config=models.VectorParams(size=100,\ - \ distance=models.Distance.COSINE),\n)\n" - language: python - code-samples: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ \ QdrantClient(\"localhost\", 6334);\n\nawait client.CreateCollectionAsync(\n\ @@ -490,11 +477,33 @@ paths: \ }\n}'\n" language: curl - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Collections.Distance;\nimport io.qdrant.client.grpc.Collections.VectorParams;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.createCollectionAsync(\"\ - {collection_name}\",\n VectorParams.newBuilder().setDistance(Distance.Cosine).setSize(100).build()).get();\n\ + - code: "use qdrant_client::qdrant::{CreateCollectionBuilder, Distance, VectorParamsBuilder};\n\ + use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .create_collection(\n CreateCollectionBuilder::new(\"\ + {collection_name}\")\n .vectors_config(VectorParamsBuilder::new(100,\ + \ Distance::Cosine)),\n )\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.create_collection(\n collection_name=\"\ + {collection_name}\",\n vectors_config=models.VectorParams(size=100,\ + \ distance=models.Distance.COSINE),\n)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.createCollection(\"{collection_name}\", {\n vectors: { size: 100,\ + \ distance: \"Cosine\" },\n});\n\n// or with sparse vectors\n\nclient.createCollection(\"\ + {collection_name}\", {\n vectors: { size: 100, distance: \"Cosine\" },\n\ + \ sparse_vectors: {\n \"splade-model-name\": {\n index: {\n \ + \ on_disk: false\n }\n }\n }\n});" + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Collections.Distance;\nimport io.qdrant.client.grpc.Collections.VectorParams;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.createCollectionAsync(\"\ + {collection_name}\",\n VectorParams.newBuilder().setDistance(Distance.Cosine).setSize(100).build()).get();\n\ \n// Or with sparse vectors\n\nclient.createCollectionAsync(\n CreateCollection.newBuilder()\n\ \ .setCollectionName(\"{collection_name}\")\n .setSparseVectorsConfig(\n\ \ Collections.SparseVectorConfig.newBuilder().putMap(\n \ @@ -514,15 +523,6 @@ paths: \t\tSize: 100,\n\t\t\tDistance: qdrant.Distance_Cosine,\n\t\t}),\n\ \t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.createCollection(\"{collection_name}\", {\n vectors: { size: 100,\ - \ distance: \"Cosine\" },\n});\n\n// or with sparse vectors\n\nclient.createCollection(\"\ - {collection_name}\", {\n vectors: { size: 100, distance: \"Cosine\" },\n\ - \ sparse_vectors: {\n \"splade-model-name\": {\n index: {\n \ - \ on_disk: false\n }\n }\n }\n});" - language: typescript /collections/{collection_name}/aliases: get: description: Retrieves a list of all aliases for the specified collection. @@ -530,6 +530,21 @@ paths: tags: - Aliases x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ListCollectionAliasesAsync("{collection_name}"); + + ' + language: csharp + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/aliases'\ + \ \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'use qdrant_client::Qdrant; @@ -553,20 +568,16 @@ paths: ' language: python - code-samples: - - code: 'using Qdrant.Client; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - var client = new QdrantClient("localhost", 6334); + const client = new QdrantClient({ host: "localhost", port: 6333 }); - await client.ListCollectionAliasesAsync("{collection_name}"); + client.getCollectionAliases("{collection_name}"); ' - language: csharp - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/aliases'\ - \ \\\n --header 'api-key: '" - language: curl + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ @@ -581,17 +592,6 @@ paths: \ \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"\ Collection aliases: \", aliases)\n}\n" language: go - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.getCollectionAliases("{collection_name}"); - - ' - language: typescript /collections/{collection_name}/cluster: get: description: Retrieves cluster details for a specified collection. @@ -610,6 +610,21 @@ paths: tags: - Collections x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.CollectionExistsAsync("{collection_name}"); + + ' + language: csharp + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/exists'\ + \ \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'use qdrant_client::Qdrant; @@ -631,20 +646,16 @@ paths: client.collection_exists(collection_name="{collection_name}")' language: python - code-samples: - - code: 'using Qdrant.Client; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - var client = new QdrantClient("localhost", 6334); + const client = new QdrantClient({ host: "localhost", port: 6333 }); - await client.CollectionExistsAsync("{collection_name}"); + client.collectionExists("{collection_name}"); ' - language: csharp - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/exists'\ - \ \\\n --header 'api-key: '" - language: curl + language: typescript - code-samples: - code: 'import static io.qdrant.client.ConditionFactory.matchKeyword; @@ -673,17 +684,6 @@ paths: \ \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"\ Collection exists: \", exists)\n}\n" language: go - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.collectionExists("{collection_name}"); - - ' - language: typescript /collections/{collection_name}/facet: post: description: Retrieves facets for the specified payload field. @@ -691,6 +691,12 @@ paths: tags: - Points x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nawait client.FacetAsync(\n\t\"\ + {collection_name}\",\n\tfilter: MatchKeyword(\"color\", \"red\"),\n\t\ + key: \"my-payload-key\",\n\tlimit: 10\n);" + language: csharp - code-samples: - code: "use qdrant_client::qdrant::{Condition, FacetCountsBuilder, Filter};\n\ use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ @@ -707,11 +713,14 @@ paths: color\", \"red\")]),\n limit=10,\n)\n\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.FacetAsync(\n\t\"\ - {collection_name}\",\n\tfilter: MatchKeyword(\"color\", \"red\"),\n\t\ - key: \"my-payload-key\",\n\tlimit: 10\n);" - language: csharp + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.facet(\"{collection_name}\", {\n filter: {\n must: [\n\ + \ {\n key: \"color\",\n match:\ + \ {\n value: \"red\",\n },\n \ + \ },\n ],\n },\n key: \"my-payload-key\",\n limit:\ + \ 10,\n});\n" + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nimport static io.qdrant.client.ConditionFactory.matchKeyword;\nimport\ @@ -736,15 +745,6 @@ paths: \ != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n\ }\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.facet(\"{collection_name}\", {\n filter: {\n must: [\n\ - \ {\n key: \"color\",\n match:\ - \ {\n value: \"red\",\n },\n \ - \ },\n ],\n },\n key: \"my-payload-key\",\n limit:\ - \ 10,\n});\n" - language: typescript /collections/{collection_name}/index: put: description: Creates a payload index for a field in the specified collection. @@ -752,6 +752,17 @@ paths: tags: - Indexes x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\"\ + , 6334);\n\nawait client.CreatePayloadIndexAsync(\n collectionName: \"\ + {collection_name}\",\n fieldName: \"name_of_the_field_to_index\"\n);\n" + language: csharp + - code-samples: + - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/index'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"field_name\": \"field_name\"\ + ,\n \"field_schema\": \"keyword\"\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{CreateFieldIndexCollectionBuilder, FieldType};\n\ use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ @@ -766,16 +777,11 @@ paths: \ field_schema=\"keyword\",\n)\n" language: python - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\"\ - , 6334);\n\nawait client.CreatePayloadIndexAsync(\n collectionName: \"\ - {collection_name}\",\n fieldName: \"name_of_the_field_to_index\"\n);\n" - language: csharp - - code-samples: - - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/index'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"field_name\": \"field_name\"\ - ,\n \"field_schema\": \"keyword\"\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.createPayloadIndex(\"{collection_name}\", {\n field_name: \"{field_name}\"\ + ,\n field_schema: \"keyword\",\n});\n" + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nimport io.qdrant.client.grpc.Collections.PayloadSchemaType;\n\nQdrantClient\ @@ -795,12 +801,6 @@ paths: \ qdrant.FieldType_FieldTypeKeyword.Enum(),\n\t})\n\tif err != nil\ \ {\n\t\tpanic(err)\n\t}\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.createPayloadIndex(\"{collection_name}\", {\n field_name: \"{field_name}\"\ - ,\n field_schema: \"keyword\",\n});\n" - language: typescript /collections/{collection_name}/index/{field_name}: delete: description: Deletes a payload index for a field in the specified collection. @@ -808,6 +808,15 @@ paths: tags: - Indexes x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\"\ + , 6334);\n\nawait client.DeletePayloadIndexAsync(\n collectionName: \"\ + {collection_name}\",\n fieldName: \"name_of_the_field_to_index\"\n);\n" + language: csharp + - code-samples: + - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/index/field_name'\ + \ \\\n --header 'api-key: '" + language: curl - code-samples: - code: "use qdrant_client::qdrant::DeleteFieldIndexCollectionBuilder;\nuse\ \ qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ @@ -827,14 +836,16 @@ paths: ' language: python - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\"\ - , 6334);\n\nawait client.DeletePayloadIndexAsync(\n collectionName: \"\ - {collection_name}\",\n fieldName: \"name_of_the_field_to_index\"\n);\n" - language: csharp - - code-samples: - - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/index/field_name'\ - \ \\\n --header 'api-key: '" - language: curl + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.deletePayloadIndex("{collection_name}", "{field_name}"); + + ' + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ @@ -850,17 +861,6 @@ paths: ,\n\t\tFieldName: \"{field_name}\",\n\t})\n\tif err != nil {\n\t\t\ panic(err)\n\t}\n}\n" language: go - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.deletePayloadIndex("{collection_name}", "{field_name}"); - - ' - language: typescript /collections/{collection_name}/points: post: description: Retrieves all details from multiple points. @@ -868,17 +868,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "use qdrant_client::qdrant::GetPointsBuilder;\nuse qdrant_client::Qdrant;\n\ - \nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\ - \nclient\n .get_points(GetPointsBuilder::new(\n \"{collection_name}\"\ - ,\n vec![0.into(), 30.into(), 100.into()],\n ))\n .await?;\n" - language: rust - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.retrieve(\n collection_name=\"{collection_name}\"\ - ,\n ids=[0, 3, 100],\n)\n" - language: python - code-samples: - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\"\ , 6334);\n\nawait client.RetrieveAsync(\n collectionName: \"{collection_name}\"\ @@ -891,6 +880,22 @@ paths: \ application/json' \\\n --data-raw '{\n \"ids\": [\n 0,\n 3,\n\ \ 100\n ]\n}'" language: curl + - code-samples: + - code: "use qdrant_client::qdrant::GetPointsBuilder;\nuse qdrant_client::Qdrant;\n\ + \nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\ + \nclient\n .get_points(GetPointsBuilder::new(\n \"{collection_name}\"\ + ,\n vec![0.into(), 30.into(), 100.into()],\n ))\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.retrieve(\n collection_name=\"{collection_name}\"\ + ,\n ids=[0, 3, 100],\n)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.retrieve(\"{collection_name}\", {\n ids: [0, 3, 100],\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\ \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -908,11 +913,6 @@ paths: ), qdrant.NewIDNum(100),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\ \t}\n\tfmt.Println(\"Points: \", points)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.retrieve(\"{collection_name}\", {\n ids: [0, 3, 100],\n});\n" - language: typescript put: description: Performs the insert + update action on specified points. Any point with an existing {id} will be overwritten. @@ -920,38 +920,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "use qdrant_client::qdrant::{PointStruct, UpsertPointsBuilder};\n\ - use qdrant_client::{Qdrant, Payload};\nuse serde_json::json;\n\nlet client\ - \ = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n\ - \ .upsert_points(\n UpsertPointsBuilder::new(\n \"\ - {collection_name}\",\n vec![\n PointStruct::new(\n\ - \ 1,\n vec![0.9, 0.1, 0.1],\n \ - \ Payload::try_from(json!(\n {\"\ - color\": \"red\"}\n ))\n .unwrap(),\n\ - \ ),\n PointStruct::new(\n \ - \ 2,\n vec![0.1, 0.9, 0.1],\n \ - \ Payload::try_from(json!(\n {\"color\": \"\ - green\"}\n ))\n .unwrap(),\n \ - \ ),\n PointStruct::new(\n \ - \ 3,\n vec![0.1, 0.1, 0.9],\n \ - \ Payload::try_from(json!(\n {\"color\": \"blue\"\ - }\n ))\n .unwrap(),\n \ - \ ),\n ],\n )\n .wait(true),\n )\n \ - \ .await?;\n" - language: rust - - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.upsert(\n collection_name=\"{collection_name}\"\ - ,\n points=[\n models.PointStruct(\n id=1,\n \ - \ payload={\n \"color\": \"red\",\n },\n\ - \ vector=[0.9, 0.1, 0.1],\n ),\n models.PointStruct(\n\ - \ id=2,\n payload={\n \"color\":\ - \ \"green\",\n },\n vector=[0.1, 0.9, 0.1],\n \ - \ ),\n models.PointStruct(\n id=3,\n \ - \ payload={\n \"color\": \"blue\",\n },\n \ - \ vector=[0.1, 0.1, 0.9],\n ),\n ],\n)\n" - language: python - code-samples: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ \ QdrantClient(\"localhost\", 6334);\n\nawait client.UpsertAsync(\n collectionName:\ @@ -976,6 +944,48 @@ paths: : \"blue\"\n },\n \"vector\": [\n 0.1,\n 0.1,\n\ \ 0.9\n ]\n }\n ]\n}'" language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{PointStruct, UpsertPointsBuilder};\n\ + use qdrant_client::{Qdrant, Payload};\nuse serde_json::json;\n\nlet client\ + \ = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n\ + \ .upsert_points(\n UpsertPointsBuilder::new(\n \"\ + {collection_name}\",\n vec![\n PointStruct::new(\n\ + \ 1,\n vec![0.9, 0.1, 0.1],\n \ + \ Payload::try_from(json!(\n {\"\ + color\": \"red\"}\n ))\n .unwrap(),\n\ + \ ),\n PointStruct::new(\n \ + \ 2,\n vec![0.1, 0.9, 0.1],\n \ + \ Payload::try_from(json!(\n {\"color\": \"\ + green\"}\n ))\n .unwrap(),\n \ + \ ),\n PointStruct::new(\n \ + \ 3,\n vec![0.1, 0.1, 0.9],\n \ + \ Payload::try_from(json!(\n {\"color\": \"blue\"\ + }\n ))\n .unwrap(),\n \ + \ ),\n ],\n )\n .wait(true),\n )\n \ + \ .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.upsert(\n collection_name=\"{collection_name}\"\ + ,\n points=[\n models.PointStruct(\n id=1,\n \ + \ payload={\n \"color\": \"red\",\n },\n\ + \ vector=[0.9, 0.1, 0.1],\n ),\n models.PointStruct(\n\ + \ id=2,\n payload={\n \"color\":\ + \ \"green\",\n },\n vector=[0.1, 0.9, 0.1],\n \ + \ ),\n models.PointStruct(\n id=3,\n \ + \ payload={\n \"color\": \"blue\",\n },\n \ + \ vector=[0.1, 0.1, 0.9],\n ),\n ],\n)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.upsert(\"{collection_name}\", {\n points: [\n {\n id:\ + \ 1,\n payload: { color: \"red\" },\n vector: [0.9, 0.1, 0.1],\n\ + \ },\n {\n id: 2,\n payload: { color: \"green\" },\n \ + \ vector: [0.1, 0.9, 0.1],\n },\n {\n id: 3,\n payload:\ + \ { color: \"blue\" },\n vector: [0.1, 0.1, 0.9],\n },\n ],\n\ + });\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ \ io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\ @@ -1015,16 +1025,6 @@ paths: \ err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Upsert status: \"\ , response.GetStatus())\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.upsert(\"{collection_name}\", {\n points: [\n {\n id:\ - \ 1,\n payload: { color: \"red\" },\n vector: [0.9, 0.1, 0.1],\n\ - \ },\n {\n id: 2,\n payload: { color: \"green\" },\n \ - \ vector: [0.1, 0.9, 0.1],\n },\n {\n id: 3,\n payload:\ - \ { color: \"blue\" },\n vector: [0.1, 0.1, 0.9],\n },\n ],\n\ - });\n" - language: typescript /collections/{collection_name}/points/batch: post: description: Batch updates points, including their respective vectors and payloads. @@ -1032,6 +1032,38 @@ paths: tags: - Points x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateBatchAsync(\n\ + \ \"{collection_name}\",\n [\n new()\n {\n \ + \ Upsert = new()\n {\n Points =\n \ + \ {\n new PointStruct { Id = 1, Vectors =\ + \ new[] { 0.9f, 0.1f, 0.1f } },\n }\n }\n \ + \ },\n new()\n {\n UpdateVectors = new()\n\ + \ {\n Points =\n {\n \ + \ new PointVectors { Id = 1, Vectors = new[] { 0.9f, 0.1f,\ + \ 0.1f } },\n }\n }\n },\n new()\n\ + \ {\n SetPayload = new()\n {\n \ + \ PointsSelector = new PointsSelector { Points = new PointsIdsList\ + \ { Ids = { 1 } } },\n Payload = { [\"test_payload_2\"\ + ] = 2, [\"test_payload_3\"] = 3 }\n }\n }\n ]\n);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/batch'\ + \ \\\n --header 'Content-Type: application/json' \\\n --header 'api-key:\ + \ ' \\\n --data-raw '{\n \"operations\": [\n {\n \ + \ \"upsert\": {\n \"points\": [\n {\n \"\ + id\": 1,\n \"vector\": [\n 0.4,\n \ + \ 0.3,\n 0.2,\n 0.1\n ]\n \ + \ }\n ]\n }\n },\n {\n \"update_vectors\": {\n\ + \ \"points\": [\n {\n \"id\": 1,\n \ + \ \"vector\": [\n 0.11,\n 0.22,\n \ + \ 0.33,\n 0.44\n ]\n }\n \ + \ ]\n }\n },\n {\n \"set_payload\": {\n \"payload\"\ + : {\n \"test_payload_2\": 2,\n \"test_payload_3\": 3\n\ + \ },\n \"points\": [\n 1\n ]\n }\n\ + \ }\n ]\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{\n points_selector::PointsSelectorOneOf,\n\ \ points_update_operation::{\n Operation, OverwritePayload,\ @@ -1083,37 +1115,21 @@ paths: \ ),\n ],\n)\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateBatchAsync(\n\ - \ \"{collection_name}\",\n [\n new()\n {\n \ - \ Upsert = new()\n {\n Points =\n \ - \ {\n new PointStruct { Id = 1, Vectors =\ - \ new[] { 0.9f, 0.1f, 0.1f } },\n }\n }\n \ - \ },\n new()\n {\n UpdateVectors = new()\n\ - \ {\n Points =\n {\n \ - \ new PointVectors { Id = 1, Vectors = new[] { 0.9f, 0.1f,\ - \ 0.1f } },\n }\n }\n },\n new()\n\ - \ {\n SetPayload = new()\n {\n \ - \ PointsSelector = new PointsSelector { Points = new PointsIdsList\ - \ { Ids = { 1 } } },\n Payload = { [\"test_payload_2\"\ - ] = 2, [\"test_payload_3\"] = 3 }\n }\n }\n ]\n);\n" - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/batch'\ - \ \\\n --header 'Content-Type: application/json' \\\n --header 'api-key:\ - \ ' \\\n --data-raw '{\n \"operations\": [\n {\n \ - \ \"upsert\": {\n \"points\": [\n {\n \"\ - id\": 1,\n \"vector\": [\n 0.4,\n \ - \ 0.3,\n 0.2,\n 0.1\n ]\n \ - \ }\n ]\n }\n },\n {\n \"update_vectors\": {\n\ - \ \"points\": [\n {\n \"id\": 1,\n \ - \ \"vector\": [\n 0.11,\n 0.22,\n \ - \ 0.33,\n 0.44\n ]\n }\n \ - \ ]\n }\n },\n {\n \"set_payload\": {\n \"payload\"\ - : {\n \"test_payload_2\": 2,\n \"test_payload_3\": 3\n\ - \ },\n \"points\": [\n 1\n ]\n }\n\ - \ }\n ]\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.batchUpdate(\"{collection_name}\", {\n operations: [\n \ + \ {\n upsert: {\n points: [\n \ + \ {\n id: 1,\n vector:\ + \ [1.0, 2.0, 3.0, 4.0],\n payload: {},\n \ + \ },\n ],\n },\n },\n \ + \ {\n update_vectors: {\n points: [\n \ + \ {\n id: 1,\n \ + \ vector: [1.0, 2.0, 3.0, 4.0],\n },\n \ + \ ],\n },\n },\n {\n set_payload:\ + \ {\n payload: {\n test_payload_2: 2,\n\ + \ test_payload_3: 3,\n },\n \ + \ points: [1],\n },\n },\n ],\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\nimport java.util.Map;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ import static io.qdrant.client.ValueFactory.value;\nimport static io.qdrant.client.VectorsFactory.vectors;\n\ @@ -1167,22 +1183,6 @@ paths: : 2,\n\t\t\t\t\t\"test_payload_3\": 3,\n\t\t\t\t}),\n\t\t\t}),\n\t\t},\n\ \t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.batchUpdate(\"{collection_name}\", {\n operations: [\n \ - \ {\n upsert: {\n points: [\n \ - \ {\n id: 1,\n vector:\ - \ [1.0, 2.0, 3.0, 4.0],\n payload: {},\n \ - \ },\n ],\n },\n },\n \ - \ {\n update_vectors: {\n points: [\n \ - \ {\n id: 1,\n \ - \ vector: [1.0, 2.0, 3.0, 4.0],\n },\n \ - \ ],\n },\n },\n {\n set_payload:\ - \ {\n payload: {\n test_payload_2: 2,\n\ - \ test_payload_3: 3,\n },\n \ - \ points: [1],\n },\n },\n ],\n});\n" - language: typescript /collections/{collection_name}/points/count: post: description: Counts the number of points that match a specified filtering condition. @@ -1190,21 +1190,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "use qdrant_client::qdrant::{Condition, CountPointsBuilder, Filter};\n\ - use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ - ).build()?;\n\nclient\n .count(\n CountPointsBuilder::new(\"\ - {collection_name}\")\n .filter(Filter::must([Condition::matches(\n\ - \ \"color\",\n \"red\".to_string(),\n \ - \ )]))\n .exact(true),\n )\n .await?;\n" - language: rust - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.count(\n collection_name=\"{collection_name}\"\ - ,\n count_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"\ - color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n\ - \ exact=True,\n)\n" - language: python - code-samples: - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\ \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.CountAsync(\n\ @@ -1223,6 +1208,29 @@ paths: \ \"value\": \"red\"\n }\n }\n ]\n },\n \"exact\"\ : true\n}'" language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{Condition, CountPointsBuilder, Filter};\n\ + use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .count(\n CountPointsBuilder::new(\"\ + {collection_name}\")\n .filter(Filter::must([Condition::matches(\n\ + \ \"color\",\n \"red\".to_string(),\n \ + \ )]))\n .exact(true),\n )\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.count(\n collection_name=\"{collection_name}\"\ + ,\n count_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"\ + color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n\ + \ exact=True,\n)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.count(\"{collection_name}\", {\n filter: {\n must: [\n\ + \ {\n key: \"color\",\n match:\ + \ {\n value: \"red\",\n },\n \ + \ },\n ],\n },\n exact: true,\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -1241,14 +1249,6 @@ paths: qdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err\ \ != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Count:\", count)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.count(\"{collection_name}\", {\n filter: {\n must: [\n\ - \ {\n key: \"color\",\n match:\ - \ {\n value: \"red\",\n },\n \ - \ },\n ],\n },\n exact: true,\n});\n" - language: typescript /collections/{collection_name}/points/delete: post: description: Deletes specified points from the collection. @@ -1256,28 +1256,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "use qdrant_client::qdrant::{Condition, DeletePointsBuilder, Filter,\ - \ PointsIdsList};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"\ - http://localhost:6334\").build()?;\n\nclient\n .delete_points(\n \ - \ DeletePointsBuilder::new(\"{collection_name}\")\n .points(PointsIdsList\ - \ {\n ids: vec![0.into(), 3.into(), 100.into()],\n \ - \ })\n .wait(true),\n )\n .await?;\n\nclient\n\ - \ .delete_points(\n DeletePointsBuilder::new(\"{collection_name}\"\ - )\n .points(Filter::must([Condition::matches(\n \ - \ \"color\",\n \"red\".to_string(),\n )]))\n\ - \ .wait(true),\n )\n .await?;\n" - language: rust - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.delete(\n collection_name=\"{collection_name}\"\ - ,\n points_selector=models.PointIdsList(\n points=[0, 3, 100],\n\ - \ ),\n)\n\nclient.delete(\n collection_name=\"{collection_name}\"\ - ,\n points_selector=models.FilterSelector(\n filter=models.Filter(\n\ - \ must=[\n models.FieldCondition(\n \ - \ key=\"color\",\n match=models.MatchValue(value=\"\ - red\"),\n ),\n ],\n )\n ),\n)\n" - language: python - code-samples: - code: 'using Qdrant.Client; @@ -1306,29 +1284,27 @@ paths: \ \"value\": \"red\"\n }\n }\n ]\n }\n}'\n" language: curl - code-samples: - - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ - \ io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport java.util.List;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Points.Filter;\n\nQdrantClient client =\ - \ new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\"\ - , 6334, false).build());\n\nclient.deleteAsync(\"{collection_name}\",\ - \ List.of(id(0), id(3), id(100)));\n\nclient\n .deleteAsync(\n \ - \ \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"\ - color\", \"red\")).build())\n .get();\n" - language: java + - code: "use qdrant_client::qdrant::{Condition, DeletePointsBuilder, Filter,\ + \ PointsIdsList};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"\ + http://localhost:6334\").build()?;\n\nclient\n .delete_points(\n \ + \ DeletePointsBuilder::new(\"{collection_name}\")\n .points(PointsIdsList\ + \ {\n ids: vec![0.into(), 3.into(), 100.into()],\n \ + \ })\n .wait(true),\n )\n .await?;\n\nclient\n\ + \ .delete_points(\n DeletePointsBuilder::new(\"{collection_name}\"\ + )\n .points(Filter::must([Condition::matches(\n \ + \ \"color\",\n \"red\".to_string(),\n )]))\n\ + \ .wait(true),\n )\n .await?;\n" + language: rust - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc delete() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\t_, err = client.Delete(context.Background(), &qdrant.DeletePoints{\n\ - \t\tCollectionName: \"{collection_name}\",\n\t\tPoints: qdrant.NewPointsSelectorIDs([]*qdrant.PointId{\n\ - \t\t\tqdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(100),\n\t\ - \t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.Delete(context.Background(),\ - \ &qdrant.DeletePoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ - \tPoints: qdrant.NewPointsSelectorFilter(&qdrant.Filter{\n\t\t\tMust:\ - \ []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\ - \t\t\t},\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.delete(\n collection_name=\"{collection_name}\"\ + ,\n points_selector=models.PointIdsList(\n points=[0, 3, 100],\n\ + \ ),\n)\n\nclient.delete(\n collection_name=\"{collection_name}\"\ + ,\n points_selector=models.FilterSelector(\n filter=models.Filter(\n\ + \ must=[\n models.FieldCondition(\n \ + \ key=\"color\",\n match=models.MatchValue(value=\"\ + red\"),\n ),\n ],\n )\n ),\n)\n" + language: python - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ @@ -1338,6 +1314,30 @@ paths: \ {\n value: \"red\",\n },\n \ \ },\n ],\n },\n});\n" language: typescript + - code-samples: + - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ + \ io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport java.util.List;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.Filter;\n\nQdrantClient client =\ + \ new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\"\ + , 6334, false).build());\n\nclient.deleteAsync(\"{collection_name}\",\ + \ List.of(id(0), id(3), id(100)));\n\nclient\n .deleteAsync(\n \ + \ \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"\ + color\", \"red\")).build())\n .get();\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc delete() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\t_, err = client.Delete(context.Background(), &qdrant.DeletePoints{\n\ + \t\tCollectionName: \"{collection_name}\",\n\t\tPoints: qdrant.NewPointsSelectorIDs([]*qdrant.PointId{\n\ + \t\t\tqdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(100),\n\t\ + \t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.Delete(context.Background(),\ + \ &qdrant.DeletePoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ + \tPoints: qdrant.NewPointsSelectorFilter(&qdrant.Filter{\n\t\t\tMust:\ + \ []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\ + \t\t\t},\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go /collections/{collection_name}/points/discover: post: description: 'Retrieves the most similar points to a given target, constrained @@ -1360,6 +1360,25 @@ paths: tags: - Search x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nawait client.DiscoverAsync(\n\ + \ collectionName: \"{collection_name}\",\n target: new TargetVector\n\ + \ {\n Single = new VectorExample { Vector = new float[] { 0.2f, 0.1f,\ + \ 0.9f, 0.7f }, }\n },\n context:\n [\n new()\n {\n Positive\ + \ = new VectorExample { Id = 100 },\n Negative = new VectorExample\ + \ { Id = 718 }\n },\n new()\n {\n Positive = new VectorExample\ + \ { Id = 200 },\n Negative = new VectorExample { Id = 300 }\n \ + \ }\n ],\n limit: 10\n);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/discover'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"target\": [\n 0.2,\n \ + \ 0.1,\n 0.9,\n 0.7\n ],\n \"context\": [\n {\n \"positive\"\ + : \"7f6652c4-89bd-40e0-ab1d-510f7fcddd2b\",\n \"negative\": \"2c2c9f86-0171-4bd2-9ab0-b4754682cddd\"\ + \n }\n ],\n \"limit\": 10\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{\n target_vector::Target, vector_example::Example,\ \ ContextExamplePairBuilder,\n DiscoverPointsBuilder, VectorExample,\n\ @@ -1383,24 +1402,13 @@ paths: \ ],\n limit=10,\n)\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.DiscoverAsync(\n\ - \ collectionName: \"{collection_name}\",\n target: new TargetVector\n\ - \ {\n Single = new VectorExample { Vector = new float[] { 0.2f, 0.1f,\ - \ 0.9f, 0.7f }, }\n },\n context:\n [\n new()\n {\n Positive\ - \ = new VectorExample { Id = 100 },\n Negative = new VectorExample\ - \ { Id = 718 }\n },\n new()\n {\n Positive = new VectorExample\ - \ { Id = 200 },\n Negative = new VectorExample { Id = 300 }\n \ - \ }\n ],\n limit: 10\n);\n" - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/discover'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"target\": [\n 0.2,\n \ - \ 0.1,\n 0.9,\n 0.7\n ],\n \"context\": [\n {\n \"positive\"\ - : \"7f6652c4-89bd-40e0-ab1d-510f7fcddd2b\",\n \"negative\": \"2c2c9f86-0171-4bd2-9ab0-b4754682cddd\"\ - \n }\n ],\n \"limit\": 10\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.discover(\"{collection_name}\", {\n target: [0.2, 0.1, 0.9,\ + \ 0.7],\n context: [\n {\n positive: 100,\n \ + \ negative: 718,\n },\n {\n positive: 200,\n\ + \ negative: 300,\n },\n ],\n limit: 10,\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ import static io.qdrant.client.VectorFactory.vector;\n\nimport io.qdrant.client.QdrantClient;\n\ @@ -1438,14 +1446,6 @@ paths: \t\t\t}},\n\t\t\t},\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\ \t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.discover(\"{collection_name}\", {\n target: [0.2, 0.1, 0.9,\ - \ 0.7],\n context: [\n {\n positive: 100,\n \ - \ negative: 718,\n },\n {\n positive: 200,\n\ - \ negative: 300,\n },\n ],\n limit: 10,\n});\n" - language: typescript /collections/{collection_name}/points/discover/batch: post: description: Retrieves points in batches based on the target and/or positive @@ -1454,42 +1454,6 @@ paths: tags: - Search x-fern-examples: - - code-samples: - - code: "use qdrant_client::qdrant::{\n vector_example::Example, ContextExamplePairBuilder,\ - \ DiscoverBatchPointsBuilder,\n DiscoverPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\ - \nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\ - \nlet discover_points = DiscoverBatchPointsBuilder::new(\n \"{collection_name}\"\ - ,\n vec![\n DiscoverPointsBuilder::new(\n \"{collection_name}\"\ - ,\n vec![\n ContextExamplePairBuilder::default()\n\ - \ .positive(Example::Id(100.into()))\n \ - \ .negative(Example::Id(718.into()))\n .build(),\n\ - \ ContextExamplePairBuilder::default()\n \ - \ .positive(Example::Id(200.into()))\n .negative(Example::Id(300.into()))\n\ - \ .build(),\n ],\n 10,\n \ - \ )\n .build(),\n DiscoverPointsBuilder::new(\n \ - \ \"{collection_name}\",\n vec![\n ContextExamplePairBuilder::default()\n\ - \ .positive(Example::Id(342.into()))\n \ - \ .negative(Example::Id(213.into()))\n .build(),\n\ - \ ContextExamplePairBuilder::default()\n \ - \ .positive(Example::Id(100.into()))\n .negative(Example::Id(200.into()))\n\ - \ .build(),\n ],\n 10,\n \ - \ )\n .build(),\n ],\n);\n\nclient.discover_batch(&discover_points.build()).await?;\n" - language: rust - - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\ndiscover_queries = [\n models.DiscoverRequest(\n\ - \ target=[0.2, 0.1, 0.9, 0.7],\n context=[\n \ - \ models.ContextExamplePair(\n positive=100,\n \ - \ negative=718,\n ),\n models.ContextExamplePair(\n\ - \ positive=200,\n negative=300,\n \ - \ ),\n ],\n limit=10,\n ),\n models.DiscoverRequest(\n\ - \ target=[0.5, 0.3, 0.2, 0.3],\n context=[\n \ - \ models.ContextExamplePair(\n positive=342,\n \ - \ negative=213,\n ),\n models.ContextExamplePair(\n\ - \ positive=100,\n negative=200,\n \ - \ ),\n ],\n limit=5,\n ),\n]\n\nclient.discover_batch(\"\ - {collection_name}\", discover_queries)\n" - language: python - code-samples: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ \ QdrantClient(\"localhost\", 6334);\n\nvar discoverPoints = new List\n\ @@ -1527,6 +1491,56 @@ paths: \ {\n \"positive\": 342,\n \"negative\": 213\n\ \ }\n ],\n \"limit\": 1\n }\n ]\n}'" language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{\n vector_example::Example, ContextExamplePairBuilder,\ + \ DiscoverBatchPointsBuilder,\n DiscoverPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\ + \nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\ + \nlet discover_points = DiscoverBatchPointsBuilder::new(\n \"{collection_name}\"\ + ,\n vec![\n DiscoverPointsBuilder::new(\n \"{collection_name}\"\ + ,\n vec![\n ContextExamplePairBuilder::default()\n\ + \ .positive(Example::Id(100.into()))\n \ + \ .negative(Example::Id(718.into()))\n .build(),\n\ + \ ContextExamplePairBuilder::default()\n \ + \ .positive(Example::Id(200.into()))\n .negative(Example::Id(300.into()))\n\ + \ .build(),\n ],\n 10,\n \ + \ )\n .build(),\n DiscoverPointsBuilder::new(\n \ + \ \"{collection_name}\",\n vec![\n ContextExamplePairBuilder::default()\n\ + \ .positive(Example::Id(342.into()))\n \ + \ .negative(Example::Id(213.into()))\n .build(),\n\ + \ ContextExamplePairBuilder::default()\n \ + \ .positive(Example::Id(100.into()))\n .negative(Example::Id(200.into()))\n\ + \ .build(),\n ],\n 10,\n \ + \ )\n .build(),\n ],\n);\n\nclient.discover_batch(&discover_points.build()).await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\ndiscover_queries = [\n models.DiscoverRequest(\n\ + \ target=[0.2, 0.1, 0.9, 0.7],\n context=[\n \ + \ models.ContextExamplePair(\n positive=100,\n \ + \ negative=718,\n ),\n models.ContextExamplePair(\n\ + \ positive=200,\n negative=300,\n \ + \ ),\n ],\n limit=10,\n ),\n models.DiscoverRequest(\n\ + \ target=[0.5, 0.3, 0.2, 0.3],\n context=[\n \ + \ models.ContextExamplePair(\n positive=342,\n \ + \ negative=213,\n ),\n models.ContextExamplePair(\n\ + \ positive=100,\n negative=200,\n \ + \ ),\n ],\n limit=5,\n ),\n]\n\nclient.discover_batch(\"\ + {collection_name}\", discover_queries)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + const searches = [\n {\n target: [0.2, 0.1, 0.9, 0.7],\n \ + \ context: [\n {\n positive: 100,\n \ + \ negative: 718,\n },\n {\n \ + \ positive: 200,\n negative: 300,\n },\n\ + \ ],\n limit: 10,\n },\n {\n target: [0.5,\ + \ 0.3, 0.2, 0.3],\n context: [\n {\n \ + \ positive: 342,\n negative: 213,\n },\n \ + \ {\n positive: 100,\n negative:\ + \ 200,\n },\n ],\n limit: 5,\n },\n];\n\n\ + client.discoverBatchPoints(\"{collection_name}\", {\n searches,\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ \ io.qdrant.client.VectorFactory.vector;\n\nimport java.util.Arrays;\n\ @@ -1591,20 +1605,6 @@ paths: if err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n\ }\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - const searches = [\n {\n target: [0.2, 0.1, 0.9, 0.7],\n \ - \ context: [\n {\n positive: 100,\n \ - \ negative: 718,\n },\n {\n \ - \ positive: 200,\n negative: 300,\n },\n\ - \ ],\n limit: 10,\n },\n {\n target: [0.5,\ - \ 0.3, 0.2, 0.3],\n context: [\n {\n \ - \ positive: 342,\n negative: 213,\n },\n \ - \ {\n positive: 100,\n negative:\ - \ 200,\n },\n ],\n limit: 5,\n },\n];\n\n\ - client.discoverBatchPoints(\"{collection_name}\", {\n searches,\n});\n" - language: typescript /collections/{collection_name}/points/payload: post: description: Sets payload values for specified points. @@ -1612,24 +1612,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "use qdrant_client::qdrant::{PointsIdsList, SetPayloadPointsBuilder};\n\ - use qdrant_client::{Qdrant, Payload};\nuse serde_json::json;\n\nlet client\ - \ = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet payload:\ - \ Payload = json!({\n \"property1\": \"string\",\n \"property2\"\ - : \"string\",\n})\n.try_into()\n.unwrap();\n\nclient\n .set_payload(\n\ - \ SetPayloadPointsBuilder::new(\"{collection_name}\", payload)\n\ - \ .points_selector(PointsIdsList {\n ids: vec![0.into(),\ - \ 3.into(), 10.into()],\n })\n .wait(true),\n \ - \ )\n .await?;\n" - language: rust - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.set_payload(\n collection_name=\"\ - {collection_name}\",\n payload={\n \"property1\": \"string\"\ - ,\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n\ - )\n" - language: python - code-samples: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ \ QdrantClient(\"localhost\", 6334);\n\nawait client.SetPayloadAsync(\n\ @@ -1651,6 +1633,31 @@ paths: : {\n \"property1\": \"some_value\",\n \"property2\": 32,\n \"\ property3\": true\n }\n}'" language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{PointsIdsList, SetPayloadPointsBuilder};\n\ + use qdrant_client::{Qdrant, Payload};\nuse serde_json::json;\n\nlet client\ + \ = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet payload:\ + \ Payload = json!({\n \"property1\": \"string\",\n \"property2\"\ + : \"string\",\n})\n.try_into()\n.unwrap();\n\nclient\n .set_payload(\n\ + \ SetPayloadPointsBuilder::new(\"{collection_name}\", payload)\n\ + \ .points_selector(PointsIdsList {\n ids: vec![0.into(),\ + \ 3.into(), 10.into()],\n })\n .wait(true),\n \ + \ )\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.set_payload(\n collection_name=\"\ + {collection_name}\",\n payload={\n \"property1\": \"string\"\ + ,\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n\ + )\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.setPayload(\"{collection_name}\", {\n payload: {\n property1:\ + \ \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n\ + });\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ \ io.qdrant.client.ValueFactory.value;\n\nimport java.util.List;\nimport\ @@ -1673,37 +1680,12 @@ paths: \t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results:\ \ \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.setPayload(\"{collection_name}\", {\n payload: {\n property1:\ - \ \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n\ - });\n" - language: typescript put: description: Replaces the entire payload of a specified point with a new payload. summary: Overwrite payload tags: - Points x-fern-examples: - - code-samples: - - code: "use qdrant_client::qdrant::{\n points_selector::PointsSelectorOneOf,\ - \ PointsIdsList, SetPayloadPointsBuilder,\n};\nuse qdrant_client::{Qdrant,\ - \ Payload};\nuse serde_json::json;\n\nlet client = Qdrant::from_url(\"\ - http://localhost:6334\").build()?;\n\nlet payload: Payload = json!({\n\ - \ \"property1\": \"string\",\n \"property2\": \"string\",\n})\n\ - .try_into()\n.unwrap();\n\nclient\n .overwrite_payload(\n SetPayloadPointsBuilder::new(\"\ - {collection_name}\", payload)\n .points_selector(PointsSelectorOneOf::Points(PointsIdsList\ - \ {\n ids: vec![0.into(), 3.into(), 10.into()],\n \ - \ }))\n .wait(true),\n )\n .await?;\n" - language: rust - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.overwrite_payload(\n collection_name=\"\ - {collection_name}\",\n payload={\n \"property1\": \"string\"\ - ,\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n\ - )\n" - language: python - code-samples: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ \ QdrantClient(\"localhost\", 6334);\n\nawait client.OverwritePayloadAsync(\n\ @@ -1724,6 +1706,31 @@ paths: \ \"must\": [\n {\n \"key\": \"color\",\n \"match\"\ : {\n \"value\": \"red\"\n }\n }\n ]\n }\n}'" language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{\n points_selector::PointsSelectorOneOf,\ + \ PointsIdsList, SetPayloadPointsBuilder,\n};\nuse qdrant_client::{Qdrant,\ + \ Payload};\nuse serde_json::json;\n\nlet client = Qdrant::from_url(\"\ + http://localhost:6334\").build()?;\n\nlet payload: Payload = json!({\n\ + \ \"property1\": \"string\",\n \"property2\": \"string\",\n})\n\ + .try_into()\n.unwrap();\n\nclient\n .overwrite_payload(\n SetPayloadPointsBuilder::new(\"\ + {collection_name}\", payload)\n .points_selector(PointsSelectorOneOf::Points(PointsIdsList\ + \ {\n ids: vec![0.into(), 3.into(), 10.into()],\n \ + \ }))\n .wait(true),\n )\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.overwrite_payload(\n collection_name=\"\ + {collection_name}\",\n payload={\n \"property1\": \"string\"\ + ,\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n\ + )\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.overwritePayload(\"{collection_name}\", {\n payload: {\n property1:\ + \ \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n\ + });\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ import static io.qdrant.client.ValueFactory.value;\n\nimport io.qdrant.client.QdrantClient;\n\ @@ -1745,13 +1752,6 @@ paths: \ qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(10)),\n\ \t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.overwritePayload(\"{collection_name}\", {\n payload: {\n property1:\ - \ \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n\ - });\n" - language: typescript /collections/{collection_name}/points/payload/clear: post: description: Removes the entire payload for specified points. @@ -1759,18 +1759,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "use qdrant_client::qdrant::{ClearPayloadPointsBuilder, PointsIdsList};\n\ - use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ - ).build()?;\n\nclient\n .clear_payload(ClearPayloadPointsBuilder::new(\"\ - {collection_name}\").points(\n PointsIdsList {\n ids:\ - \ vec![0.into(), 3.into(), 100.into()],\n },\n ))\n .await?;\n" - language: rust - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.clear_payload(\n collection_name=\"\ - {collection_name}\",\n points_selector=[0, 3, 100],\n)\n" - language: python - code-samples: - code: 'using Qdrant.Client; @@ -1788,6 +1776,24 @@ paths: \ ' \\\n --data-raw '{\n \"points\": [\n 0,\n 3,\n\ \ 100\n ]\n}'" language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{ClearPayloadPointsBuilder, PointsIdsList};\n\ + use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .clear_payload(ClearPayloadPointsBuilder::new(\"\ + {collection_name}\").points(\n PointsIdsList {\n ids:\ + \ vec![0.into(), 3.into(), 100.into()],\n },\n ))\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.clear_payload(\n collection_name=\"\ + {collection_name}\",\n points_selector=[0, 3, 100],\n)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.clearPayload(\"{collection_name}\", {\n points: [0, 3, 100],\n\ + });\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -1805,12 +1811,6 @@ paths: 3\"), qdrant.NewIDNum(100)),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\ \t}\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.clearPayload(\"{collection_name}\", {\n points: [0, 3, 100],\n\ - });\n" - language: typescript /collections/{collection_name}/points/payload/delete: post: description: Deletes a specified key payload for points. @@ -1818,21 +1818,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "use qdrant_client::qdrant::{DeletePayloadPointsBuilder, PointsIdsList};\n\ - use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ - ).build()?;\n\nclient\n .delete_payload(\n DeletePayloadPointsBuilder::new(\n\ - \ \"{collection_name}\",\n vec![\"color\".to_string(),\ - \ \"price\".to_string()],\n )\n .points_selector(PointsIdsList\ - \ {\n ids: vec![0.into(), 3.into(), 100.into()],\n })\n\ - \ .wait(true),\n )\n .await?;\n" - language: rust - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.delete_payload(\n collection_name=\"\ - {collection_name}\",\n keys=[\"color\", \"price\"],\n points=[0,\ - \ 3, 100],\n)\n" - language: python - code-samples: - code: 'using Qdrant.Client; @@ -1858,92 +1843,54 @@ paths: : \"red\"\n }\n }\n ]\n }\n}'" language: curl - code-samples: - - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .deletePayloadAsync(\n\ - \ \"{collection_name}\",\n List.of(\"color\", \"price\"\ - ),\n List.of(id(0), id(3), id(100)),\n true,\n null,\n\ - \ null)\n .get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc deletePayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\t_, err = client.DeletePayload(context.Background(),\ - \ &qdrant.DeletePayloadPoints{\n\t\tCollectionName: \"{collection_name}\"\ - ,\n\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3),\ - \ qdrant.NewIDNum(100)),\n\t\tKeys: []string{\"color\", \"price\"\ - },\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.deletePayload(\"{collection_name}\", {\n keys: [\"color\", \"\ - price\"],\n points: [0, 3, 100],\n});\n" - language: typescript - /collections/{collection_name}/points/query: - post: - description: Universally query points. This endpoint covers all capabilities - of search, recommend, discover, filters. But also enables hybrid and multi-stage - queries. - summary: Query points - tags: - - Search - x-fern-examples: - - code-samples: - - code: "use qdrant_client::Qdrant;\nuse qdrant_client::qdrant::{Condition,\ - \ Filter, PointId, PrefetchQueryBuilder, Query, QueryPointsBuilder};\n\ - \nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\ - \n// Query nearest by ID\nlet _nearest = client.query(\n QueryPointsBuilder::new(\"\ - {collection_name}\")\n .query(Query::new_nearest(PointId::new(\"\ - 43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")))\n).await?;\n\n// Recommend on\ - \ the average of these vectors\nlet _recommendations = client.query(\n\ - \ QueryPointsBuilder::new(\"{collection_name}\")\n .query(Query::new_recommend(\n\ - \ RecommendInputBuilder::default()\n .add_positive(vec![0.1;\ - \ 8])\n .add_negative(PointId::from(0))\n ))\n).await?;\n\ - \n// Fusion query\nlet _hybrid = client.query(\n QueryPointsBuilder::new(\"\ - {collection_name}\")\n .add_prefetch(PrefetchQueryBuilder::default()\n\ - \ .query(Query::new_nearest([(1, 0.22), (42, 0.8)].as_slice()))\n\ - \ .using(\"sparse\")\n .limit(20u64)\n )\n\ - \ .add_prefetch(PrefetchQueryBuilder::default()\n .query(Query::new_nearest(vec![0.01,\ - \ 0.45, 0.67]))\n .using(\"dense\")\n .limit(20u64)\n\ - \ )\n .query(Query::new_fusion(Fusion::Rrf))\n).await?;\n\ - \n// 2-stage query\nlet _refined = client.query(\n QueryPointsBuilder::new(\"\ - {collection_name}\")\n .add_prefetch(PrefetchQueryBuilder::default()\n\ - \ .query(Query::new_nearest(vec![0.01, 0.45, 0.67]))\n \ - \ .limit(100u64)\n )\n .query(Query::new_nearest(vec![\n\ - \ vec![0.1, 0.2],\n vec![0.2, 0.1],\n \ - \ vec![0.8, 0.9],\n ]))\n .using(\"colbert\")\n \ - \ .limit(10u64)\n).await?;\n\n// Random sampling (as of 1.11.0)\nlet _sampled\ - \ = client\n .query(\n QueryPointsBuilder::new(\"{collection_name}\"\ - )\n .query(Query::new_sample(Sample::Random))\n )\n .await?;\n" + - code: "use qdrant_client::qdrant::{DeletePayloadPointsBuilder, PointsIdsList};\n\ + use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .delete_payload(\n DeletePayloadPointsBuilder::new(\n\ + \ \"{collection_name}\",\n vec![\"color\".to_string(),\ + \ \"price\".to_string()],\n )\n .points_selector(PointsIdsList\ + \ {\n ids: vec![0.into(), 3.into(), 100.into()],\n })\n\ + \ .wait(true),\n )\n .await?;\n" language: rust - - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\n# Query nearest by ID\nnearest = client.query_points(\n\ - \ collection_name=\"{collection_name}\",\n query=\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\ - ,\n)\n\n# Recommend on the average of these vectors\nrecommended = client.query_points(\n\ - \ collection_name=\"{collection_name}\",\n query=models.RecommendQuery(recommend=models.RecommendInput(\n\ - \ positive=[\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\", [0.11, 0.35,\ - \ 0.6, ...]],\n negative=[[0.01, 0.45, 0.67, ...]]\n ))\n)\n\ - \n# Fusion query\nhybrid = client.query_points(\n collection_name=\"\ - {collection_name}\",\n prefetch=[\n models.Prefetch(\n \ - \ query=models.SparseVector(indices=[1, 42], values=[0.22, 0.8]),\n\ - \ using=\"sparse\",\n limit=20,\n ),\n \ - \ models.Prefetch(\n query=[0.01, 0.45, 0.67, ...], #\ - \ <-- dense vector\n using=\"dense\",\n limit=20,\n\ - \ ),\n ],\n query=models.FusionQuery(fusion=models.Fusion.RRF),\n\ - )\n\n# 2-stage query\nrefined = client.query_points(\n collection_name=\"\ - {collection_name}\",\n prefetch=models.Prefetch(\n query=[0.01,\ - \ 0.45, 0.67, ...], # <-- dense vector\n limit=100,\n ),\n\ - \ query=[\n [0.1, 0.2, ...], # <\u2500\u2510\n [0.2,\ - \ 0.1, ...], # < \u251C\u2500 multi-vector\n [0.8, 0.9, ...],\ - \ # < \u2518\n ],\n using=\"colbert\",\n limit=10,\n)\n\n# Random\ - \ sampling (as of 1.11.0)\nsampled = client.query_points(\n collection_name=\"\ - {collection_name}\",\n query=models.SampleQuery(sample=models.Sample.Random)\n\ - )\n" + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.delete_payload(\n collection_name=\"\ + {collection_name}\",\n keys=[\"color\", \"price\"],\n points=[0,\ + \ 3, 100],\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.deletePayload(\"{collection_name}\", {\n keys: [\"color\", \"\ + price\"],\n points: [0, 3, 100],\n});\n" + language: typescript + - code-samples: + - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .deletePayloadAsync(\n\ + \ \"{collection_name}\",\n List.of(\"color\", \"price\"\ + ),\n List.of(id(0), id(3), id(100)),\n true,\n null,\n\ + \ null)\n .get();\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc deletePayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\t_, err = client.DeletePayload(context.Background(),\ + \ &qdrant.DeletePayloadPoints{\n\t\tCollectionName: \"{collection_name}\"\ + ,\n\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3),\ + \ qdrant.NewIDNum(100)),\n\t\tKeys: []string{\"color\", \"price\"\ + },\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go + /collections/{collection_name}/points/query: + post: + description: Universally query points. This endpoint covers all capabilities + of search, recommend, discover, filters. But also enables hybrid and multi-stage + queries. + summary: Query points + tags: + - Search + x-fern-examples: - code-samples: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ \ QdrantClient(\"localhost\", 6334);\n\n// Query nearest by ID\nawait\ @@ -2002,6 +1949,82 @@ paths: \ application/json' \\\n --data-raw '{\n \"query\": {\n \"sample\"\ : \"random\"\n }\n}'\n" language: curl + - code-samples: + - code: "use qdrant_client::Qdrant;\nuse qdrant_client::qdrant::{Condition,\ + \ Filter, PointId, PrefetchQueryBuilder, Query, QueryPointsBuilder};\n\ + \nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\ + \n// Query nearest by ID\nlet _nearest = client.query(\n QueryPointsBuilder::new(\"\ + {collection_name}\")\n .query(Query::new_nearest(PointId::new(\"\ + 43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")))\n).await?;\n\n// Recommend on\ + \ the average of these vectors\nlet _recommendations = client.query(\n\ + \ QueryPointsBuilder::new(\"{collection_name}\")\n .query(Query::new_recommend(\n\ + \ RecommendInputBuilder::default()\n .add_positive(vec![0.1;\ + \ 8])\n .add_negative(PointId::from(0))\n ))\n).await?;\n\ + \n// Fusion query\nlet _hybrid = client.query(\n QueryPointsBuilder::new(\"\ + {collection_name}\")\n .add_prefetch(PrefetchQueryBuilder::default()\n\ + \ .query(Query::new_nearest([(1, 0.22), (42, 0.8)].as_slice()))\n\ + \ .using(\"sparse\")\n .limit(20u64)\n )\n\ + \ .add_prefetch(PrefetchQueryBuilder::default()\n .query(Query::new_nearest(vec![0.01,\ + \ 0.45, 0.67]))\n .using(\"dense\")\n .limit(20u64)\n\ + \ )\n .query(Query::new_fusion(Fusion::Rrf))\n).await?;\n\ + \n// 2-stage query\nlet _refined = client.query(\n QueryPointsBuilder::new(\"\ + {collection_name}\")\n .add_prefetch(PrefetchQueryBuilder::default()\n\ + \ .query(Query::new_nearest(vec![0.01, 0.45, 0.67]))\n \ + \ .limit(100u64)\n )\n .query(Query::new_nearest(vec![\n\ + \ vec![0.1, 0.2],\n vec![0.2, 0.1],\n \ + \ vec![0.8, 0.9],\n ]))\n .using(\"colbert\")\n \ + \ .limit(10u64)\n).await?;\n\n// Random sampling (as of 1.11.0)\nlet _sampled\ + \ = client\n .query(\n QueryPointsBuilder::new(\"{collection_name}\"\ + )\n .query(Query::new_sample(Sample::Random))\n )\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\n# Query nearest by ID\nnearest = client.query_points(\n\ + \ collection_name=\"{collection_name}\",\n query=\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\ + ,\n)\n\n# Recommend on the average of these vectors\nrecommended = client.query_points(\n\ + \ collection_name=\"{collection_name}\",\n query=models.RecommendQuery(recommend=models.RecommendInput(\n\ + \ positive=[\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\", [0.11, 0.35,\ + \ 0.6, ...]],\n negative=[[0.01, 0.45, 0.67, ...]]\n ))\n)\n\ + \n# Fusion query\nhybrid = client.query_points(\n collection_name=\"\ + {collection_name}\",\n prefetch=[\n models.Prefetch(\n \ + \ query=models.SparseVector(indices=[1, 42], values=[0.22, 0.8]),\n\ + \ using=\"sparse\",\n limit=20,\n ),\n \ + \ models.Prefetch(\n query=[0.01, 0.45, 0.67, ...], #\ + \ <-- dense vector\n using=\"dense\",\n limit=20,\n\ + \ ),\n ],\n query=models.FusionQuery(fusion=models.Fusion.RRF),\n\ + )\n\n# 2-stage query\nrefined = client.query_points(\n collection_name=\"\ + {collection_name}\",\n prefetch=models.Prefetch(\n query=[0.01,\ + \ 0.45, 0.67, ...], # <-- dense vector\n limit=100,\n ),\n\ + \ query=[\n [0.1, 0.2, ...], # <\u2500\u2510\n [0.2,\ + \ 0.1, ...], # < \u251C\u2500 multi-vector\n [0.8, 0.9, ...],\ + \ # < \u2518\n ],\n using=\"colbert\",\n limit=10,\n)\n\n# Random\ + \ sampling (as of 1.11.0)\nsampled = client.query_points(\n collection_name=\"\ + {collection_name}\",\n query=models.SampleQuery(sample=models.Sample.Random)\n\ + )\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + // Query nearest by ID\nlet _nearest = client.query(\"{collection_name\"\ + , {\n query: \"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\n});\n\n// Recommend\ + \ on the average of these vectors\nlet _recommendations = client.query(\"\ + {collection_name}\", {\n query: {\n recommend: {\n \ + \ positive: [\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\", [0.11, 0.35,\ + \ 0.6]],\n negative: [0.01, 0.45, 0.67]\n }\n }\n\ + });\n\n// Fusion query\nlet _hybrid = client.query(\"{collection_name}\"\ + , {\n prefetch: [\n {\n query: {\n \ + \ values: [0.22, 0.8],\n indices: [1, 42],\n \ + \ },\n using: 'sparse',\n limit: 20,\n \ + \ },\n {\n query: [0.01, 0.45, 0.67],\n using:\ + \ 'dense',\n limit: 20,\n },\n ],\n query: {\n\ + \ fusion: 'rrf',\n },\n});\n\n// 2-stage query\nlet _refined\ + \ = client.query(\"{collection_name}\", {\n prefetch: {\n query:\ + \ [1, 23, 45, 67],\n limit: 100,\n },\n query: [\n \ + \ [0.1, 0.2],\n [0.2, 0.1],\n [0.8, 0.9],\n ],\n \ + \ using: 'colbert',\n limit: 10,\n});\n\n// Random sampling (as of\ + \ 1.11.0)\nlet _sampled = client.query(\"{collection_name}\", {\n query:\ + \ { sample: \"random\" },\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.QueryFactory.fusion;\nimport static\ \ io.qdrant.client.QueryFactory.nearest;\nimport static io.qdrant.client.QueryFactory.recommend;\n\ @@ -2081,29 +2104,6 @@ paths: \t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results:\ \ \", points)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - // Query nearest by ID\nlet _nearest = client.query(\"{collection_name\"\ - , {\n query: \"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\n});\n\n// Recommend\ - \ on the average of these vectors\nlet _recommendations = client.query(\"\ - {collection_name}\", {\n query: {\n recommend: {\n \ - \ positive: [\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\", [0.11, 0.35,\ - \ 0.6]],\n negative: [0.01, 0.45, 0.67]\n }\n }\n\ - });\n\n// Fusion query\nlet _hybrid = client.query(\"{collection_name}\"\ - , {\n prefetch: [\n {\n query: {\n \ - \ values: [0.22, 0.8],\n indices: [1, 42],\n \ - \ },\n using: 'sparse',\n limit: 20,\n \ - \ },\n {\n query: [0.01, 0.45, 0.67],\n using:\ - \ 'dense',\n limit: 20,\n },\n ],\n query: {\n\ - \ fusion: 'rrf',\n },\n});\n\n// 2-stage query\nlet _refined\ - \ = client.query(\"{collection_name}\", {\n prefetch: {\n query:\ - \ [1, 23, 45, 67],\n limit: 100,\n },\n query: [\n \ - \ [0.1, 0.2],\n [0.2, 0.1],\n [0.8, 0.9],\n ],\n \ - \ using: 'colbert',\n limit: 10,\n});\n\n// Random sampling (as of\ - \ 1.11.0)\nlet _sampled = client.query(\"{collection_name}\", {\n query:\ - \ { sample: \"random\" },\n});\n" - language: typescript /collections/{collection_name}/points/query/batch: post: description: Universally query points in batch. This endpoint covers all capabilities @@ -2113,6 +2113,22 @@ paths: tags: - Search x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nawait client.QueryBatchAsync(\n\ + \tcollectionName: \"{collection_name}\",\n\tqueries: new List\n\ + \t{\n\t\tnew() { Query = new float[] { 0.1f, 0.2f, 0.3f }, },\n\t\tnew()\ + \ { Query = new float[] { 0.4f, 0.5f, 0.6f }, }\n\t}\n);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query/batch'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \ + \ \"query\": [\n 0.23,\n 0.325,\n 0.623\n \ + \ ],\n \"limit\": 1\n },\n {\n \"query\": [\n \ + \ 0.423,\n 0.23,\n 0.623\n ],\n \"limit\": 5,\n\ + \ \"using\": \"image-vector\"\n }\n ]\n}'" + language: curl - code-samples: - code: "use qdrant_client::{Qdrant, QdrantError};\nuse qdrant_client::qdrant::{Query,\ \ QueryPointsBuilder, QueryBatchPointsBuilder};\n\nlet request = QueryBatchPointsBuilder::new(\"\ @@ -2130,21 +2146,12 @@ paths: \ query=[0.11, 0.35, 0.6, ...],\n ),\n ]\n)" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.QueryBatchAsync(\n\ - \tcollectionName: \"{collection_name}\",\n\tqueries: new List\n\ - \t{\n\t\tnew() { Query = new float[] { 0.1f, 0.2f, 0.3f }, },\n\t\tnew()\ - \ { Query = new float[] { 0.4f, 0.5f, 0.6f }, }\n\t}\n);\n" - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query/batch'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \ - \ \"query\": [\n 0.23,\n 0.325,\n 0.623\n \ - \ ],\n \"limit\": 1\n },\n {\n \"query\": [\n \ - \ 0.423,\n 0.23,\n 0.623\n ],\n \"limit\": 5,\n\ - \ \"using\": \"image-vector\"\n }\n ]\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.queryBatch(\"{collection_name\", {\n searches: [{\n query:\ + \ [0.01, 0.45, 0.67]\n },\n {\n query: [0.11, 0.35, 0.6]\n\ + \ }]\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.QueryFactory.nearest;\n\nimport java.util.List;\n\ \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -2168,13 +2175,6 @@ paths: \t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"\ Query results: \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.queryBatch(\"{collection_name\", {\n searches: [{\n query:\ - \ [0.01, 0.45, 0.67]\n },\n {\n query: [0.11, 0.35, 0.6]\n\ - \ }]\n});\n" - language: typescript /collections/{collection_name}/points/query/groups: post: description: Universally query points and group results by a specified payload @@ -2184,6 +2184,19 @@ paths: tags: - Search x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\"\ + , 6334);\n\nawait client.QueryGroupsAsync(\n collectionName: \"{collection_name}\"\ + ,\n groupBy: \"document_id\",\n groupSize: 5,\n limit: 10,\n query:\ + \ new float[] {\n 0.01f, 0.45f, 0.67f\n }\n);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query/groups'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"query\": [\n 0.324,\n\ + \ 0.643,\n 0.423\n ],\n \"group_by\": \"document_id\",\n \"limit\"\ + : 1,\n \"group_size\": 5\n}'" + language: curl - code-samples: - code: "use qdrant_client::Qdrant;\nuse qdrant_client::qdrant::{Query, QueryPointGroupsBuilder};\n\ \nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\ @@ -2198,18 +2211,12 @@ paths: ,\n limit=10,\n group_size=5,\n)" language: python - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\"\ - , 6334);\n\nawait client.QueryGroupsAsync(\n collectionName: \"{collection_name}\"\ - ,\n groupBy: \"document_id\",\n groupSize: 5,\n limit: 10,\n query:\ - \ new float[] {\n 0.01f, 0.45f, 0.67f\n }\n);\n" - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query/groups'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"query\": [\n 0.324,\n\ - \ 0.643,\n 0.423\n ],\n \"group_by\": \"document_id\",\n \"limit\"\ - : 1,\n \"group_size\": 5\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.queryGroups(\"{collection_name}\", {\n query: [0.01, 0.45, 0.67],\n\ + \ group_by: \"document_id\",\n limit: 10,\n group_size: 5,\n\ + });\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.QueryFactory.nearest;\n\ \nimport io.qdrant.client.grpc.Points.QueryPointGroups;\nimport io.qdrant.client.grpc.Points.QueryPoints;\n\ @@ -2231,13 +2238,6 @@ paths: \ err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \"\ , results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.queryGroups(\"{collection_name}\", {\n query: [0.01, 0.45, 0.67],\n\ - \ group_by: \"document_id\",\n limit: 10,\n group_size: 5,\n\ - });\n" - language: typescript /collections/{collection_name}/points/recommend: post: description: Retrieves points that are closer to stored positive examples and @@ -2246,6 +2246,23 @@ paths: tags: - Search x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\ + \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendAsync(\n\ + \ \"{collection_name}\",\n positive: new ulong[] { 100, 231 },\n\ + \ negative: new ulong[] { 718 },\n filter: MatchKeyword(\"city\"\ + , \"London\"),\n limit: 3\n);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"positive\": [\n 100,\n\ + \ 231\n ],\n \"negative\": [\n \"3a6e2150-f7b7-496e-92cd-687e63e215fd\"\ + ,\n [\n 0.2,\n 0.3,\n 0.4,\n 0.5\n ]\n ],\n\ + \ \"filter\": {\n \"must\": [\n {\n \"key\": \"city\"\ + ,\n \"match\": {\n \"value\": \"London\"\n }\n\ + \ }\n ]\n },\n \"limit\": 1\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{Condition, Filter, RecommendPointsBuilder,\ \ RecommendStrategy};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"\ @@ -2269,22 +2286,15 @@ paths: \ )\n ]\n ),\n limit=3,\n)\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\ - \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendAsync(\n\ - \ \"{collection_name}\",\n positive: new ulong[] { 100, 231 },\n\ - \ negative: new ulong[] { 718 },\n filter: MatchKeyword(\"city\"\ - , \"London\"),\n limit: 3\n);\n" - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"positive\": [\n 100,\n\ - \ 231\n ],\n \"negative\": [\n \"3a6e2150-f7b7-496e-92cd-687e63e215fd\"\ - ,\n [\n 0.2,\n 0.3,\n 0.4,\n 0.5\n ]\n ],\n\ - \ \"filter\": {\n \"must\": [\n {\n \"key\": \"city\"\ - ,\n \"match\": {\n \"value\": \"London\"\n }\n\ - \ }\n ]\n },\n \"limit\": 1\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.recommend(\"{collection_name}\", {\n positive: [100, 231],\n\ + \ negative: [718, [0.2, 0.3, 0.4, 0.5]],\n strategy: \"average_vector\"\ + ,\n filter: {\n must: [\n {\n key:\ + \ \"city\",\n match: {\n value: \"London\"\ + ,\n },\n },\n ],\n },\n limit:\ + \ 3,\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\ @@ -2317,16 +2327,6 @@ paths: city\", \"London\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\t\ panic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.recommend(\"{collection_name}\", {\n positive: [100, 231],\n\ - \ negative: [718, [0.2, 0.3, 0.4, 0.5]],\n strategy: \"average_vector\"\ - ,\n filter: {\n must: [\n {\n key:\ - \ \"city\",\n match: {\n value: \"London\"\ - ,\n },\n },\n ],\n },\n limit:\ - \ 3,\n});\n" - language: typescript /collections/{collection_name}/points/recommend/batch: post: description: Retrieves points in batches that are closer to stored positive @@ -2335,28 +2335,6 @@ paths: tags: - Search x-fern-examples: - - code-samples: - - code: "use qdrant_client::qdrant::{\n Condition, Filter, RecommendBatchPointsBuilder,\ - \ RecommendPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\nlet client\ - \ = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet filter\ - \ = Filter::must([Condition::matches(\"city\", \"London\".to_string())]);\n\ - let recommend_queries = vec![\n RecommendPointsBuilder::new(\"{collection_name}\"\ - , 3)\n .add_positive(100)\n .add_positive(231)\n \ - \ .add_negative(718)\n .filter(filter.clone())\n .build(),\n\ - \ RecommendPointsBuilder::new(\"{collection_name}\", 3)\n .add_positive(200)\n\ - \ .add_positive(67)\n .add_negative(300)\n .filter(filter.clone())\n\ - \ .build(),\n];\n\nclient\n .recommend_batch(RecommendBatchPointsBuilder::new(\n\ - \ \"{collection_name}\",\n recommend_queries,\n ))\n\ - \ .await?;\n" - language: rust - - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nrecommend_queries = [\n models.RecommendRequest(\n\ - \ positive=[100, 231], negative=[718], filter=filter_, limit=3\n\ - \ ),\n models.RecommendRequest(positive=[200, 67], negative=[300],\ - \ limit=3),\n]\n\nclient.recommend_batch(collection_name=\"{collection_name}\"\ - , requests=recommend_queries)\n" - language: python - code-samples: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\ \nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter =\ @@ -2380,6 +2358,36 @@ paths: \ 67\n ],\n \"negative\": [\n 300\n ],\n\ \ \"limit\": 5\n }\n ]\n}'" language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{\n Condition, Filter, RecommendBatchPointsBuilder,\ + \ RecommendPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\nlet client\ + \ = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet filter\ + \ = Filter::must([Condition::matches(\"city\", \"London\".to_string())]);\n\ + let recommend_queries = vec![\n RecommendPointsBuilder::new(\"{collection_name}\"\ + , 3)\n .add_positive(100)\n .add_positive(231)\n \ + \ .add_negative(718)\n .filter(filter.clone())\n .build(),\n\ + \ RecommendPointsBuilder::new(\"{collection_name}\", 3)\n .add_positive(200)\n\ + \ .add_positive(67)\n .add_negative(300)\n .filter(filter.clone())\n\ + \ .build(),\n];\n\nclient\n .recommend_batch(RecommendBatchPointsBuilder::new(\n\ + \ \"{collection_name}\",\n recommend_queries,\n ))\n\ + \ .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nrecommend_queries = [\n models.RecommendRequest(\n\ + \ positive=[100, 231], negative=[718], filter=filter_, limit=3\n\ + \ ),\n models.RecommendRequest(positive=[200, 67], negative=[300],\ + \ limit=3),\n]\n\nclient.recommend_batch(collection_name=\"{collection_name}\"\ + , requests=recommend_queries)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + const searches = [\n {\n positive: [100, 231],\n negative:\ + \ [718],\n limit: 3,\n },\n {\n positive: [200, 67],\n\ + \ negative: [300],\n limit: 3,\n },\n];\n\nclient.recommend_batch(\"\ + {collection_name}\", {\n searches,\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ import static io.qdrant.client.PointIdFactory.id;\n\nimport io.qdrant.client.QdrantClient;\n\ @@ -2416,14 +2424,6 @@ paths: \t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\ \t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - const searches = [\n {\n positive: [100, 231],\n negative:\ - \ [718],\n limit: 3,\n },\n {\n positive: [200, 67],\n\ - \ negative: [300],\n limit: 3,\n },\n];\n\nclient.recommend_batch(\"\ - {collection_name}\", {\n searches,\n});\n" - language: typescript /collections/{collection_name}/points/recommend/groups: post: description: Retrieves points that are closer to stored positive examples and @@ -2433,20 +2433,6 @@ paths: tags: - Search x-fern-examples: - - code-samples: - - code: "use qdrant_client::qdrant::{RecommendPointGroupsBuilder, RecommendStrategy};\n\ - use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ - ).build()?;\n\nclient\n .recommend_groups(\n RecommendPointGroupsBuilder::new(\"\ - {collection_name}\", \"document_id\", 2, 3)\n .add_positive(100)\n\ - \ .add_positive(200)\n .add_negative(718)\n \ - \ .strategy(RecommendStrategy::AverageVector),\n )\n .await?;\n" - language: rust - - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.recommend_groups(\n collection_name=\"\ - {collection_name}\",\n positive=[100, 231],\n negative=[718],\n\ - \ group_by=\"document_id\",\n limit=3,\n group_size=2,\n)\n" - language: python - code-samples: - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\ \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendGroupsAsync(\n\ @@ -2462,6 +2448,27 @@ paths: \ 231\n ],\n \"negative\": [\n 718\n ],\n \"group_by\": \"document_id\"\ ,\n \"limit\": 3,\n \"group_size\": 2\n}'" language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{RecommendPointGroupsBuilder, RecommendStrategy};\n\ + use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .recommend_groups(\n RecommendPointGroupsBuilder::new(\"\ + {collection_name}\", \"document_id\", 2, 3)\n .add_positive(100)\n\ + \ .add_positive(200)\n .add_negative(718)\n \ + \ .strategy(RecommendStrategy::AverageVector),\n )\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.recommend_groups(\n collection_name=\"\ + {collection_name}\",\n positive=[100, 231],\n negative=[718],\n\ + \ group_by=\"document_id\",\n limit=3,\n group_size=2,\n)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.recommendPointGroups(\"{collection_name}\", {\n positive: [100,\ + \ 231],\n negative: [718],\n group_by: \"document_id\",\n limit:\ + \ 3,\n group_size: 2,\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\ \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -2488,13 +2495,6 @@ paths: \t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results:\ \ \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.recommendPointGroups(\"{collection_name}\", {\n positive: [100,\ - \ 231],\n negative: [718],\n group_by: \"document_id\",\n limit:\ - \ 3,\n group_size: 2,\n});\n" - language: typescript /collections/{collection_name}/points/scroll: post: description: 'Returns all points in a page-by-page manner. @@ -2510,6 +2510,21 @@ paths: tags: - Points x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\ + \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.ScrollAsync(\n\ + \ collectionName: \"{collection_name}\",\n filter: MatchKeyword(\"color\"\ + , \"red\"),\n limit: 1,\n payloadSelector: true\n);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/scroll'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"with_payload\": [\n \"\ + city\",\n \"color\"\n ],\n \"filter\": {\n \"must\": [\n \ + \ {\n \"key\": \"color\",\n \"match\": {\n \"value\"\ + : \"red\"\n }\n }\n ]\n },\n \"limit\": 2,\n \"with_vector\"\ + : false\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{Condition, Filter, ScrollPointsBuilder};\n\ use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ @@ -2527,20 +2542,14 @@ paths: \ limit=1,\n with_payload=True,\n with_vectors=False,\n)\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\ - \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.ScrollAsync(\n\ - \ collectionName: \"{collection_name}\",\n filter: MatchKeyword(\"color\"\ - , \"red\"),\n limit: 1,\n payloadSelector: true\n);\n" - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/scroll'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"with_payload\": [\n \"\ - city\",\n \"color\"\n ],\n \"filter\": {\n \"must\": [\n \ - \ {\n \"key\": \"color\",\n \"match\": {\n \"value\"\ - : \"red\"\n }\n }\n ]\n },\n \"limit\": 2,\n \"with_vector\"\ - : false\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.scroll(\"{collection_name}\", {\n filter: {\n must: [\n\ + \ {\n key: \"color\",\n match:\ + \ {\n value: \"red\",\n },\n \ + \ },\n ],\n },\n limit: 1,\n with_payload: true,\n\ + \ with_vector: false,\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\nimport\ \ static io.qdrant.client.WithPayloadSelectorFactory.enable;\n\nimport\ @@ -2565,15 +2574,6 @@ paths: WithVectors: qdrant.NewWithVectorsEnable(false),\n\t})\n\tif err != nil\ \ {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.scroll(\"{collection_name}\", {\n filter: {\n must: [\n\ - \ {\n key: \"color\",\n match:\ - \ {\n value: \"red\",\n },\n \ - \ },\n ],\n },\n limit: 1,\n with_payload: true,\n\ - \ with_vector: false,\n});\n" - language: typescript /collections/{collection_name}/points/search: post: description: Retrieves the closest points based on vector similarity and given @@ -2582,6 +2582,22 @@ paths: tags: - Search x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\ + \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchAsync(\n\ + \ collectionName: \"{collection_name}\",\n vector: new float[] { 0.2f,\ + \ 0.1f, 0.9f, 0.7f },\n filter: MatchKeyword(\"city\", \"London\"),\n\ + \ limit: 3\n);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"vector\": [\n 0.2,\n \ + \ 0.1,\n 0.9,\n 0.7\n ],\n \"limit\": 1,\n \"filter\": {\n\ + \ \"must\": [\n {\n \"key\": \"city\",\n \"match\"\ + : {\n \"value\": \"London\"\n }\n }\n ]\n }\n\ + }'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{Condition, Filter, SearchParamsBuilder,\ \ SearchPointsBuilder};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"\ @@ -2602,21 +2618,14 @@ paths: \ limit=3,\n)\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\ - \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchAsync(\n\ - \ collectionName: \"{collection_name}\",\n vector: new float[] { 0.2f,\ - \ 0.1f, 0.9f, 0.7f },\n filter: MatchKeyword(\"city\", \"London\"),\n\ - \ limit: 3\n);\n" - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"vector\": [\n 0.2,\n \ - \ 0.1,\n 0.9,\n 0.7\n ],\n \"limit\": 1,\n \"filter\": {\n\ - \ \"must\": [\n {\n \"key\": \"city\",\n \"match\"\ - : {\n \"value\": \"London\"\n }\n }\n ]\n }\n\ - }'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.search(\"{collection_name}\", {\n filter: {\n must: [\n\ + \ {\n key: \"city\",\n match:\ + \ {\n value: \"London\",\n },\n \ + \ },\n ],\n },\n vector: [0.2, 0.1, 0.9, 0.7],\n \ + \ limit: 3,\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -2640,15 +2649,6 @@ paths: London\"),\n\t\t\t},\n\t\t},\n\t\tLimit: &limit,\n\t})\n\tif err != nil\ \ {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.search(\"{collection_name}\", {\n filter: {\n must: [\n\ - \ {\n key: \"city\",\n match:\ - \ {\n value: \"London\",\n },\n \ - \ },\n ],\n },\n vector: [0.2, 0.1, 0.9, 0.7],\n \ - \ limit: 3,\n});\n" - language: typescript /collections/{collection_name}/points/search/batch: post: description: Retrieves the closest points in batches based on vector similarity @@ -2657,6 +2657,28 @@ paths: tags: - Search x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\ + \nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter =\ + \ MatchKeyword(\"city\", \"London\");\n\nvar searches = new List\n\ + {\n new()\n {\n Vector = { new float[] { 0.2f, 0.1f, 0.9f, 0.7f }\ + \ },\n Filter = filter,\n Limit = 3\n },\n new()\n {\n Vector\ + \ = { new float[] { 0.5f, 0.3f, 0.2f, 0.3f } },\n Filter = filter,\n\ + \ Limit = 3\n }\n};\n\nawait client.SearchBatchAsync(collectionName:\ + \ \"{collection_name}\", searches: searches);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search/batch'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \ + \ \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n \ + \ 0.7\n ],\n \"limit\": 3\n },\n {\n \"vector\":\ + \ [\n 0.5,\n 0.3,\n 0.2,\n 0.3\n ],\n\ + \ \"filter\": {\n \"must\": [\n {\n \"\ + key\": \"city\",\n \"match\": {\n \"value\": \"\ + London\"\n }\n }\n ]\n },\n \"limit\"\ + : 3\n }\n ]\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{\n Condition, Filter, SearchBatchPointsBuilder,\ \ SearchPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\nlet client =\ @@ -2680,27 +2702,16 @@ paths: {collection_name}\", requests=search_queries)\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\ - \nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter =\ - \ MatchKeyword(\"city\", \"London\");\n\nvar searches = new List\n\ - {\n new()\n {\n Vector = { new float[] { 0.2f, 0.1f, 0.9f, 0.7f }\ - \ },\n Filter = filter,\n Limit = 3\n },\n new()\n {\n Vector\ - \ = { new float[] { 0.5f, 0.3f, 0.2f, 0.3f } },\n Filter = filter,\n\ - \ Limit = 3\n }\n};\n\nawait client.SearchBatchAsync(collectionName:\ - \ \"{collection_name}\", searches: searches);\n" - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search/batch'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \ - \ \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n \ - \ 0.7\n ],\n \"limit\": 3\n },\n {\n \"vector\":\ - \ [\n 0.5,\n 0.3,\n 0.2,\n 0.3\n ],\n\ - \ \"filter\": {\n \"must\": [\n {\n \"\ - key\": \"city\",\n \"match\": {\n \"value\": \"\ - London\"\n }\n }\n ]\n },\n \"limit\"\ - : 3\n }\n ]\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + const filter = {\n must: [\n {\n key: \"city\",\n\ + \ match: {\n value: \"London\",\n \ + \ },\n },\n ],\n};\n\nconst searches = [\n {\n vector:\ + \ [0.2, 0.1, 0.9, 0.7],\n filter,\n limit: 3,\n },\n\ + \ {\n vector: [0.5, 0.3, 0.2, 0.3],\n filter,\n \ + \ limit: 3,\n },\n];\n\nclient.searchBatch(\"{collection_name}\"\ + , {\n searches,\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -2732,17 +2743,6 @@ paths: \t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"\ Query results: \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - const filter = {\n must: [\n {\n key: \"city\",\n\ - \ match: {\n value: \"London\",\n \ - \ },\n },\n ],\n};\n\nconst searches = [\n {\n vector:\ - \ [0.2, 0.1, 0.9, 0.7],\n filter,\n limit: 3,\n },\n\ - \ {\n vector: [0.5, 0.3, 0.2, 0.3],\n filter,\n \ - \ limit: 3,\n },\n];\n\nclient.searchBatch(\"{collection_name}\"\ - , {\n searches,\n});\n" - language: typescript /collections/{collection_name}/points/search/groups: post: description: Retrieves the closest points based on vector similarity and given @@ -2751,6 +2751,19 @@ paths: tags: - Search x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\"\ + , 6334);\n\nawait client.SearchGroupsAsync(\n collectionName: \"{collection_name}\"\ + ,\n vector: new float[] { 1.1f },\n groupBy: \"document_id\",\n limit:\ + \ 4,\n groupSize: 2\n);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search/groups'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"vector\": [\n 0.2,\n \ + \ 0.1,\n 0.9,\n 0.7\n ],\n \"group_by\": \"document_id\",\n\ + \ \"limit\": 4,\n \"group_size\": 2\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::SearchPointGroupsBuilder;\nuse qdrant_client::Qdrant;\n\ \nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\ @@ -2765,18 +2778,11 @@ paths: ,\n limit=4,\n group_size=2,\n)\n" language: python - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\"\ - , 6334);\n\nawait client.SearchGroupsAsync(\n collectionName: \"{collection_name}\"\ - ,\n vector: new float[] { 1.1f },\n groupBy: \"document_id\",\n limit:\ - \ 4,\n groupSize: 2\n);\n" - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search/groups'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"vector\": [\n 0.2,\n \ - \ 0.1,\n 0.9,\n 0.7\n ],\n \"group_by\": \"document_id\",\n\ - \ \"limit\": 4,\n \"group_size\": 2\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.searchPointGroups(\"{collection_name}\", {\n vector: [1.1],\n\ + \ group_by: \"document_id\",\n limit: 4,\n group_size: 2,\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport io.qdrant.client.QdrantClient;\n\ import io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.SearchPointGroups;\n\ @@ -2798,12 +2804,6 @@ paths: \ err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \"\ , results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.searchPointGroups(\"{collection_name}\", {\n vector: [1.1],\n\ - \ group_by: \"document_id\",\n limit: 4,\n group_size: 2,\n});\n" - language: typescript /collections/{collection_name}/points/search/matrix/offsets: post: description: Retrieves sparse matrix of pairwise distances between points sampled @@ -2813,6 +2813,12 @@ paths: tags: - Search x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nawait client.SearchMatrixOffsetsAsync(\n\ + \ \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"\ + ),\n sample: 100,\n limit: 5\n);" + language: csharp - code-samples: - code: "use qdrant_client::qdrant::{Condition, SearchMatrixPointsBuilder,\ \ Filter};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"\ @@ -2831,11 +2837,14 @@ paths: \ ]\n ),\n)" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.SearchMatrixOffsetsAsync(\n\ - \ \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"\ - ),\n sample: 100,\n limit: 5\n);" - language: csharp + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.searchMatrixOffsets(\"{collection_name}\", {\n filter: {\n \ + \ must: [\n {\n key: \"color\",\n \ + \ match: {\n value: \"red\",\n \ + \ },\n },\n ],\n },\n sample: 100,\n \ + \ limit: 5,\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -2860,15 +2869,6 @@ paths: \t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"\ Query results: \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.searchMatrixOffsets(\"{collection_name}\", {\n filter: {\n \ - \ must: [\n {\n key: \"color\",\n \ - \ match: {\n value: \"red\",\n \ - \ },\n },\n ],\n },\n sample: 100,\n \ - \ limit: 5,\n});\n" - language: typescript /collections/{collection_name}/points/search/matrix/pairs: post: description: Retrieves sparse matrix of pairwise distances between points sampled @@ -2877,6 +2877,12 @@ paths: tags: - Search x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nawait client.SearchMatrixPairsAsync(\n\ + \ \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"\ + ),\n sample: 100,\n limit: 5\n);" + language: csharp - code-samples: - code: "use qdrant_client::qdrant::{Condition, SearchMatrixPointsBuilder,\ \ Filter};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"\ @@ -2895,11 +2901,14 @@ paths: \ ]\n ),\n)" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.SearchMatrixPairsAsync(\n\ - \ \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"\ - ),\n sample: 100,\n limit: 5\n);" - language: csharp + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.searchMatrixPairs(\"{collection_name}\", {\n filter: {\n \ + \ must: [\n {\n key: \"color\",\n \ + \ match: {\n value: \"red\",\n \ + \ },\n },\n ],\n },\n sample: 100,\n limit:\ + \ 5,\n});" + language: typescript - code-samples: - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -2924,15 +2933,6 @@ paths: \t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"\ Query results: \", results)\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.searchMatrixPairs(\"{collection_name}\", {\n filter: {\n \ - \ must: [\n {\n key: \"color\",\n \ - \ match: {\n value: \"red\",\n \ - \ },\n },\n ],\n },\n sample: 100,\n limit:\ - \ 5,\n});" - language: typescript /collections/{collection_name}/points/vectors: put: description: Updates specified vectors on points. All other unspecified vectors @@ -2941,6 +2941,24 @@ paths: tags: - Points x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateVectorsAsync(\n\ + \ collectionName: \"{collection_name}\",\n points: new List\n\ + \ {\n new() { Id = 1, Vectors = (\"image\", new float[] { 0.1f, 0.2f,\ + \ 0.3f, 0.4f }) },\n new()\n {\n Id = 2,\n Vectors = (\"\ + text\", new float[] { 0.9f, 0.8f, 0.7f, 0.6f, 0.5f, 0.4f, 0.3f, 0.2f })\n\ + \ }\n }\n);\n" + language: csharp + - code-samples: + - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points/vectors?wait=true'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"points\": [\n {\n \ + \ \"id\": 1,\n \"vector\": [\n 0.0984,\n 0.1406,\n\ + \ 0.8973\n ]\n },\n {\n \"id\": 2,\n \"vector\"\ + : {\n \"vector-name\": [\n 0.9,\n 0.8,\n \ + \ 0.7,\n 0.6\n ]\n }\n }\n ]\n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{PointVectors, UpdatePointVectorsBuilder};\n\ use qdrant_client::Qdrant;\nuse std::collections::HashMap;\n\nlet client\ @@ -2970,23 +2988,15 @@ paths: \ ],\n)\n" language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateVectorsAsync(\n\ - \ collectionName: \"{collection_name}\",\n points: new List\n\ - \ {\n new() { Id = 1, Vectors = (\"image\", new float[] { 0.1f, 0.2f,\ - \ 0.3f, 0.4f }) },\n new()\n {\n Id = 2,\n Vectors = (\"\ - text\", new float[] { 0.9f, 0.8f, 0.7f, 0.6f, 0.5f, 0.4f, 0.3f, 0.2f })\n\ - \ }\n }\n);\n" - language: csharp - - code-samples: - - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points/vectors?wait=true'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"points\": [\n {\n \ - \ \"id\": 1,\n \"vector\": [\n 0.0984,\n 0.1406,\n\ - \ 0.8973\n ]\n },\n {\n \"id\": 2,\n \"vector\"\ - : {\n \"vector-name\": [\n 0.9,\n 0.8,\n \ - \ 0.7,\n 0.6\n ]\n }\n }\n ]\n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.updateVectors(\"{collection_name}\", {\n points: [\n \ + \ {\n id: 1,\n vector: {\n image:\ + \ [0.1, 0.2, 0.3, 0.4],\n },\n },\n {\n \ + \ id: 2,\n vector: {\n text: [0.9, 0.8,\ + \ 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n },\n ],\n\ + });\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ \ io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\ @@ -3017,16 +3027,6 @@ paths: \ 0.2),\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\t\ panic(err)\n\t}\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.updateVectors(\"{collection_name}\", {\n points: [\n \ - \ {\n id: 1,\n vector: {\n image:\ - \ [0.1, 0.2, 0.3, 0.4],\n },\n },\n {\n \ - \ id: 2,\n vector: {\n text: [0.9, 0.8,\ - \ 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n },\n ],\n\ - });\n" - language: typescript /collections/{collection_name}/points/vectors/delete: post: description: Deletes specified vectors from points. All other unspecified vectors @@ -3035,22 +3035,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "use qdrant_client::qdrant::{DeletePointVectorsBuilder, PointsIdsList,\ - \ VectorsSelector};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"\ - http://localhost:6334\").build()?;\n\nclient\n .delete_vectors(\n \ - \ DeletePointVectorsBuilder::new(\"{collection_name}\")\n \ - \ .points_selector(PointsIdsList {\n ids: vec![0.into(),\ - \ 3.into(), 10.into()],\n })\n .vectors(VectorsSelector\ - \ {\n names: vec![\"text\".into(), \"image\".into()],\n\ - \ })\n .wait(true),\n )\n .await?;\n" - language: rust - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.delete_vectors(\n collection_name=\"\ - {collection_name}\",\n points=[0, 3, 100],\n vectors=[\"text\",\ - \ \"image\"],\n)\n" - language: python - code-samples: - code: 'using Qdrant.Client; @@ -3075,6 +3059,28 @@ paths: \ \"value\": \"red\"\n }\n }\n ]\n },\n \"vectors\"\ : [\n \"text\",\n \"image\"\n ]\n}'" language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{DeletePointVectorsBuilder, PointsIdsList,\ + \ VectorsSelector};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"\ + http://localhost:6334\").build()?;\n\nclient\n .delete_vectors(\n \ + \ DeletePointVectorsBuilder::new(\"{collection_name}\")\n \ + \ .points_selector(PointsIdsList {\n ids: vec![0.into(),\ + \ 3.into(), 10.into()],\n })\n .vectors(VectorsSelector\ + \ {\n names: vec![\"text\".into(), \"image\".into()],\n\ + \ })\n .wait(true),\n )\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.delete_vectors(\n collection_name=\"\ + {collection_name}\",\n points=[0, 3, 100],\n vectors=[\"text\",\ + \ \"image\"],\n)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.deleteVectors(\"{collection_name}\", {\n points: [0, 3, 10],\n\ + \ vectors: [\"text\", \"image\"],\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\ \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -3094,12 +3100,6 @@ paths: Names: []string{\"text\", \"image\"},\n\t\t},\n\t})\n\tif err != nil {\n\ \t\tpanic(err)\n\t}\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.deleteVectors(\"{collection_name}\", {\n points: [0, 3, 10],\n\ - \ vectors: [\"text\", \"image\"],\n});\n" - language: typescript /collections/{collection_name}/points/{id}: get: description: Retrieves all details from a single point. @@ -3113,6 +3113,18 @@ paths: tags: - Distributed x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nawait client.CreateShardKeyAsync(\n\ + \ \"{collection_name}\",\n new CreateShardKey { ShardKey = new ShardKey\ + \ { Keyword = \"{shard_key}\", } }\n);\n" + language: csharp + - code-samples: + - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/shards'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"shard_key\": \"{shard_key}\"\ + \n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::shard_key::Key;\nuse qdrant_client::qdrant::{CreateShardKeyBuilder,\ \ CreateShardKeyRequestBuilder};\nuse qdrant_client::Qdrant;\n\nlet client\ @@ -3134,17 +3146,11 @@ paths: ' language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.CreateShardKeyAsync(\n\ - \ \"{collection_name}\",\n new CreateShardKey { ShardKey = new ShardKey\ - \ { Keyword = \"{shard_key}\", } }\n);\n" - language: csharp - - code-samples: - - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/shards'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"shard_key\": \"{shard_key}\"\ - \n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n\ + });\n\nclient.createShardKey(\"{collection_name}\", {\n shard_key:\ + \ \"{shard_key}\"\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport\ \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -3164,12 +3170,6 @@ paths: \ \"{collection_name}\", &qdrant.CreateShardKey{\n\t\tShardKey: qdrant.NewShardKey(\"\ {shard_key}\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n\ - });\n\nclient.createShardKey(\"{collection_name}\", {\n shard_key:\ - \ \"{shard_key}\"\n});\n" - language: typescript /collections/{collection_name}/shards/delete: post: description: Deletes one or more shard keys for a specified collection. @@ -3177,6 +3177,18 @@ paths: tags: - Distributed x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nawait client.DeleteShardKeyAsync(\n\ + \ \"{collection_name}\",\n new DeleteShardKey { ShardKey = new ShardKey\ + \ { Keyword = \"shard_key\", } }\n);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/shards/delete'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"shard_key\": \"{shard_key}\"\ + \n}'" + language: curl - code-samples: - code: "use qdrant_client::qdrant::shard_key::Key;\nuse qdrant_client::qdrant::DeleteShardKeyRequestBuilder;\n\ use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ @@ -3196,17 +3208,11 @@ paths: ' language: python - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.DeleteShardKeyAsync(\n\ - \ \"{collection_name}\",\n new DeleteShardKey { ShardKey = new ShardKey\ - \ { Keyword = \"shard_key\", } }\n);\n" - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/shards/delete'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"shard_key\": \"{shard_key}\"\ - \n}'" - language: curl + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n\ + });\n\nclient.deleteShardKey(\"{collection_name}\", {\n shard_key:\ + \ \"{shard_key}\"\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport\ \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -3226,12 +3232,6 @@ paths: \ \"{collection_name}\", &qdrant.DeleteShardKey{\n\t\tShardKey: qdrant.NewShardKey(\"\ {shard_key}\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n\ - });\n\nclient.deleteShardKey(\"{collection_name}\", {\n shard_key:\ - \ \"{shard_key}\"\n});\n" - language: typescript /collections/{collection_name}/shards/{shard_id}/snapshots: get: description: Returns a list of all snapshots for a shard from a collection. @@ -3276,6 +3276,21 @@ paths: tags: - Snapshots x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ListSnapshotsAsync("{collection_name}"); + + ' + language: csharp + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/snapshots'\ + \ \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'use qdrant_client::Qdrant; @@ -3299,20 +3314,16 @@ paths: ' language: python - code-samples: - - code: 'using Qdrant.Client; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - var client = new QdrantClient("localhost", 6334); + const client = new QdrantClient({ host: "localhost", port: 6333 }); - await client.ListSnapshotsAsync("{collection_name}"); + client.listSnapshots("{collection_name}"); ' - language: csharp - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/snapshots'\ - \ \\\n --header 'api-key: '" - language: curl + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ @@ -3327,23 +3338,27 @@ paths: \ \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"\ Snapshots: \", snapshots)\n}\n" language: go + post: + description: Creates a new snapshot for a specified collection. + summary: Create a snapshot (collection) + tags: + - Snapshots + x-fern-examples: - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.listSnapshots("{collection_name}"); + await client.CreateSnapshotAsync("{collection_name}"); ' - language: typescript - post: - description: Creates a new snapshot for a specified collection. - summary: Create a snapshot (collection) - tags: - - Snapshots - x-fern-examples: + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/snapshots'\ + \ \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'use qdrant_client::Qdrant; @@ -3367,20 +3382,16 @@ paths: ' language: python - code-samples: - - code: 'using Qdrant.Client; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - var client = new QdrantClient("localhost", 6334); + const client = new QdrantClient({ host: "localhost", port: 6333 }); - await client.CreateSnapshotAsync("{collection_name}"); + client.createSnapshot("{collection_name}"); ' - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/snapshots'\ - \ \\\n --header 'api-key: '" - language: curl + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ @@ -3395,17 +3406,6 @@ paths: \ \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"\ Snapshot created: \", snapshot.Name)\n}\n" language: go - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.createSnapshot("{collection_name}"); - - ' - language: typescript /collections/{collection_name}/snapshots/recover: put: description: Recovers local collection data from a snapshot. This will overwrite @@ -3415,17 +3415,17 @@ paths: tags: - Snapshots x-fern-examples: - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.recover_snapshot(\n \"{collection_name}\"\ - ,\n \"http://example.com/path/to/snapshot.shapshot\",\n)\n" - language: python - code-samples: - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/snapshots/recover'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ \ application/json' \\\n --data-raw '{\n \"location\": \"http://example.com/path/to/snapshot.shapshot\"\ \n}'" language: curl + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.recover_snapshot(\n \"{collection_name}\"\ + ,\n \"http://example.com/path/to/snapshot.shapshot\",\n)\n" + language: python - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ @@ -3452,6 +3452,21 @@ paths: tags: - Snapshots x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.DeleteSnapshotAsync("{collection_name}", "{snapshot_name}"); + + ' + language: csharp + - code-samples: + - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/snapshots/snapshot_name'\ + \ \\\n --header 'api-key: '" + language: curl - code-samples: - code: "use qdrant_client::qdrant::DeleteSnapshotRequestBuilder;\nuse qdrant_client::Qdrant;\n\ \nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\ @@ -3465,20 +3480,16 @@ paths: {collection_name}\", snapshot_name=\"{snapshot_name}\"\n)\n" language: python - code-samples: - - code: 'using Qdrant.Client; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - var client = new QdrantClient("localhost", 6334); + const client = new QdrantClient({ host: "localhost", port: 6333 }); - await client.DeleteSnapshotAsync("{collection_name}", "{snapshot_name}"); + client.deleteSnapshot("{collection_name}", "{snapshot_name}"); ' - language: csharp - - code-samples: - - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/snapshots/snapshot_name'\ - \ \\\n --header 'api-key: '" - language: curl + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ @@ -3493,17 +3504,6 @@ paths: \ \"{collection_name}\", \"{snapshot_name}\")\n\tif err != nil {\n\t\t\ panic(err)\n\t}\n}\n" language: go - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.deleteSnapshot("{collection_name}", "{snapshot_name}"); - - ' - language: typescript get: description: Downloads the specified snapshot file from a collection. summary: Download a snapshot (collection) @@ -3565,6 +3565,21 @@ paths: tags: - Snapshots x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ListFullSnapshotsAsync(); + + ' + language: csharp + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/snapshots' \\\n --header\ + \ 'api-key: '" + language: curl - code-samples: - code: 'use qdrant_client::Qdrant; @@ -3588,20 +3603,16 @@ paths: ' language: python - code-samples: - - code: 'using Qdrant.Client; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - var client = new QdrantClient("localhost", 6334); + const client = new QdrantClient({ host: "localhost", port: 6333 }); - await client.ListFullSnapshotsAsync(); + client.listFullSnapshots(); ' - language: csharp - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/snapshots' \\\n --header\ - \ 'api-key: '" - language: curl + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ @@ -3615,23 +3626,27 @@ paths: \tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Full snapshots:\ \ \", snapshots)\n}\n" language: go + post: + description: Creates a new snapshot of the entire storage. + summary: Create a snapshot (storage) + tags: + - Snapshots + x-fern-examples: - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.listFullSnapshots(); + await client.CreateFullSnapshotAsync(); ' - language: typescript - post: - description: Creates a new snapshot of the entire storage. - summary: Create a snapshot (storage) - tags: - - Snapshots - x-fern-examples: + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/snapshots' \\\n --header\ + \ 'api-key: '" + language: curl - code-samples: - code: 'use qdrant_client::Qdrant; @@ -3655,20 +3670,16 @@ paths: ' language: python - code-samples: - - code: 'using Qdrant.Client; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - var client = new QdrantClient("localhost", 6334); + const client = new QdrantClient({ host: "localhost", port: 6333 }); - await client.CreateFullSnapshotAsync(); + client.createFullSnapshot(); ' - language: csharp - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/snapshots' \\\n --header\ - \ 'api-key: '" - language: curl + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ @@ -3682,17 +3693,6 @@ paths: \tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Snapshot created:\ \ \", snapshot.Name)\n}\n" language: go - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.createFullSnapshot(); - - ' - language: typescript /snapshots/{snapshot_name}: delete: description: Deletes the specified snapshot of the entire storage. @@ -3700,6 +3700,21 @@ paths: tags: - Snapshots x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.DeleteFullSnapshotAsync("{snapshot_name}"); + + ' + language: csharp + - code-samples: + - code: "curl -X DELETE \\\n 'http://localhost:6333/snapshots/snapshot_name'\ + \ \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'use qdrant_client::Qdrant; @@ -3723,20 +3738,16 @@ paths: ' language: python - code-samples: - - code: 'using Qdrant.Client; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - var client = new QdrantClient("localhost", 6334); + const client = new QdrantClient({ host: "localhost", port: 6333 }); - await client.DeleteFullSnapshotAsync("{snapshot_name}"); + client.deleteFullSnapshot("{snapshot_name}"); ' - language: csharp - - code-samples: - - code: "curl -X DELETE \\\n 'http://localhost:6333/snapshots/snapshot_name'\ - \ \\\n --header 'api-key: '" - language: curl + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ @@ -3750,17 +3761,6 @@ paths: \tpanic(err)\n\t}\n\n\terr = client.DeleteFullSnapshot(context.Background(),\ \ \"{snapshot_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.deleteFullSnapshot("{snapshot_name}"); - - ' - language: typescript get: description: Downloads the specified snapshot of the entire storage as a file. summary: Download a snapshot (storage) From 8a90c1bb5e943f7a1b3ac3260706b795e7bec664 Mon Sep 17 00:00:00 2001 From: George Panchuk Date: Wed, 29 Jan 2025 17:42:06 +0100 Subject: [PATCH 03/14] wip: try deprecating over overrides --- fern/apis/master/openapi-overrides.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fern/apis/master/openapi-overrides.yml b/fern/apis/master/openapi-overrides.yml index d885f8f..23ddffe 100644 --- a/fern/apis/master/openapi-overrides.yml +++ b/fern/apis/master/openapi-overrides.yml @@ -1114,6 +1114,7 @@ paths: tags: - Points /collections/{collection_name}/points/search: + availability: "deprecated" post: x-fern-examples: - code-samples: @@ -1142,6 +1143,7 @@ paths: tags: - Search /collections/{collection_name}/points/search/batch: + deprecated: true post: x-fern-examples: - code-samples: From 7c7ff0c397651e02af7b05597efe7e927291c52a Mon Sep 17 00:00:00 2001 From: joein <22641570+joein@users.noreply.github.com> Date: Wed, 29 Jan 2025 16:43:01 +0000 Subject: [PATCH 04/14] Sync OpenAPI --- fern/apis/master/openapi-overrides.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/fern/apis/master/openapi-overrides.yml b/fern/apis/master/openapi-overrides.yml index 23ddffe..d885f8f 100644 --- a/fern/apis/master/openapi-overrides.yml +++ b/fern/apis/master/openapi-overrides.yml @@ -1114,7 +1114,6 @@ paths: tags: - Points /collections/{collection_name}/points/search: - availability: "deprecated" post: x-fern-examples: - code-samples: @@ -1143,7 +1142,6 @@ paths: tags: - Search /collections/{collection_name}/points/search/batch: - deprecated: true post: x-fern-examples: - code-samples: From 046ceb10b56145d1af0b1a5e382f9dd402dca997 Mon Sep 17 00:00:00 2001 From: George Panchuk Date: Wed, 29 Jan 2025 17:45:32 +0100 Subject: [PATCH 05/14] wip: disable doc sync --- .github/workflows/preview.yml | 16 ++++++++-------- fern/apis/master/openapi.json | 2 ++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 5a5b172..324f3b6 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -33,14 +33,14 @@ jobs: wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64 -O yq chmod +x yq mv yq /usr/local/bin - - name: Sync Docs - run: | - bash -x tools/sync-openapi.sh - - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_message: "Sync OpenAPI" - commit_user_name: "GitHub Actions" - commit_user_email: "team@qdrant.com" +# - name: Sync Docs +# run: | +# bash -x tools/sync-openapi.sh +# - uses: stefanzweifel/git-auto-commit-action@v5 +# with: +# commit_message: "Sync OpenAPI" +# commit_user_name: "GitHub Actions" +# commit_user_email: "team@qdrant.com" - name: Install Fern run: npm install -g fern-api diff --git a/fern/apis/master/openapi.json b/fern/apis/master/openapi.json index c078e9c..40bf896 100644 --- a/fern/apis/master/openapi.json +++ b/fern/apis/master/openapi.json @@ -4871,6 +4871,7 @@ } }, "/collections/{collection_name}/points/search/batch": { + "deprecated": true, "post": { "tags": [ "Search" @@ -4985,6 +4986,7 @@ } }, "/collections/{collection_name}/points/search/groups": { + "availability": "deprecated", "post": { "tags": [ "Search" From bba0d9324dd41fa2697695124e3ae71c0dfdc03f Mon Sep 17 00:00:00 2001 From: George Panchuk Date: Wed, 29 Jan 2025 17:52:49 +0100 Subject: [PATCH 06/14] wip: turn on ci, try deprecating via api-description-overwrites.yml --- .github/workflows/preview.yml | 16 ++++++++-------- fern/api-description-overwrites.yml | 2 ++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 324f3b6..5a5b172 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -33,14 +33,14 @@ jobs: wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64 -O yq chmod +x yq mv yq /usr/local/bin -# - name: Sync Docs -# run: | -# bash -x tools/sync-openapi.sh -# - uses: stefanzweifel/git-auto-commit-action@v5 -# with: -# commit_message: "Sync OpenAPI" -# commit_user_name: "GitHub Actions" -# commit_user_email: "team@qdrant.com" + - name: Sync Docs + run: | + bash -x tools/sync-openapi.sh + - uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "Sync OpenAPI" + commit_user_name: "GitHub Actions" + commit_user_email: "team@qdrant.com" - name: Install Fern run: npm install -g fern-api diff --git a/fern/api-description-overwrites.yml b/fern/api-description-overwrites.yml index c1ae75e..a26a0bf 100644 --- a/fern/api-description-overwrites.yml +++ b/fern/api-description-overwrites.yml @@ -217,12 +217,14 @@ paths: tags: - Points /collections/{collection_name}/points/search: + deprecated: true post: description: Retrieves the closest points based on vector similarity and given filtering conditions. summary: Search points tags: - Search /collections/{collection_name}/points/search/batch: + availability: deprecated post: description: Retrieves the closest points in batches based on vector similarity and given filtering conditions. summary: Search batch points From adb199a3453ffbdf1843870e1da16a62e3e63322 Mon Sep 17 00:00:00 2001 From: joein <22641570+joein@users.noreply.github.com> Date: Wed, 29 Jan 2025 16:53:22 +0000 Subject: [PATCH 07/14] Sync OpenAPI --- fern/apis/master/openapi-overrides.yml | 2 ++ fern/apis/master/openapi.json | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fern/apis/master/openapi-overrides.yml b/fern/apis/master/openapi-overrides.yml index d885f8f..1350621 100644 --- a/fern/apis/master/openapi-overrides.yml +++ b/fern/apis/master/openapi-overrides.yml @@ -1141,6 +1141,7 @@ paths: summary: Search points tags: - Search + deprecated: true /collections/{collection_name}/points/search/batch: post: x-fern-examples: @@ -1169,6 +1170,7 @@ paths: summary: Search batch points tags: - Search + availability: deprecated /collections/{collection_name}/points/search/groups: post: x-fern-examples: diff --git a/fern/apis/master/openapi.json b/fern/apis/master/openapi.json index 40bf896..c078e9c 100644 --- a/fern/apis/master/openapi.json +++ b/fern/apis/master/openapi.json @@ -4871,7 +4871,6 @@ } }, "/collections/{collection_name}/points/search/batch": { - "deprecated": true, "post": { "tags": [ "Search" @@ -4986,7 +4985,6 @@ } }, "/collections/{collection_name}/points/search/groups": { - "availability": "deprecated", "post": { "tags": [ "Search" From 2c477699254e9b53c0c4ddd9f2a005261ecb6bd4 Mon Sep 17 00:00:00 2001 From: George Panchuk Date: Wed, 29 Jan 2025 17:56:46 +0100 Subject: [PATCH 08/14] move deprecated, availability, try x-fern-availability --- fern/api-description-overwrites.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fern/api-description-overwrites.yml b/fern/api-description-overwrites.yml index a26a0bf..b6b33ed 100644 --- a/fern/api-description-overwrites.yml +++ b/fern/api-description-overwrites.yml @@ -217,21 +217,22 @@ paths: tags: - Points /collections/{collection_name}/points/search: - deprecated: true post: + deprecated: true description: Retrieves the closest points based on vector similarity and given filtering conditions. summary: Search points tags: - Search /collections/{collection_name}/points/search/batch: - availability: deprecated post: + x-fern-availability: deprecated description: Retrieves the closest points in batches based on vector similarity and given filtering conditions. summary: Search batch points tags: - Search /collections/{collection_name}/points/search/groups: post: + availability: deprecated description: Retrieves the closest points based on vector similarity and given filtering conditions, grouped by a given payload field. summary: Search point groups tags: From 16833316dd0c12b67dae0bcca7bc9df496473338 Mon Sep 17 00:00:00 2001 From: joein <22641570+joein@users.noreply.github.com> Date: Wed, 29 Jan 2025 16:57:25 +0000 Subject: [PATCH 09/14] Sync OpenAPI --- fern/apis/master/openapi-overrides.yml | 5 +++-- fern/apis/v1.13.x/openapi-overrides.yml | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fern/apis/master/openapi-overrides.yml b/fern/apis/master/openapi-overrides.yml index 1350621..b58b908 100644 --- a/fern/apis/master/openapi-overrides.yml +++ b/fern/apis/master/openapi-overrides.yml @@ -1137,11 +1137,11 @@ paths: - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc search() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tlimit := uint64(3)\n\tresults, err := client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQuery(0.2, 0.1, 0.9, 0.7),\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"city\", \"London\"),\n\t\t\t},\n\t\t},\n\t\tLimit: &limit,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go + deprecated: true description: Retrieves the closest points based on vector similarity and given filtering conditions. summary: Search points tags: - Search - deprecated: true /collections/{collection_name}/points/search/batch: post: x-fern-examples: @@ -1166,11 +1166,11 @@ paths: - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc searchBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfilter := qdrant.Filter{\n\t\tMust: []*qdrant.Condition{\n\t\t\tqdrant.NewMatch(\"city\", \"London\"),\n\t\t},\n\t}\n\tlimit := uint64(3)\n\tresults, err := client.QueryBatch(context.Background(), &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQuery(0.2, 0.1, 0.9, 0.7),\n\t\t\t\tLimit: &limit,\n\t\t\t\tFilter: &filter,\n\t\t\t},\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQuery(0.5, 0.3, 0.2, 0.3),\n\t\t\t\tLimit: &limit,\n\t\t\t\tFilter: &filter,\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go + x-fern-availability: deprecated description: Retrieves the closest points in batches based on vector similarity and given filtering conditions. summary: Search batch points tags: - Search - availability: deprecated /collections/{collection_name}/points/search/groups: post: x-fern-examples: @@ -1195,6 +1195,7 @@ paths: - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc searchGroups() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tgroupSize := uint64(2)\n\tresults, err := client.QueryGroups(context.Background(), &qdrant.QueryPointGroups{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\tGroupBy: \"document_id\",\n\t\tGroupSize: &groupSize,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go + availability: deprecated description: Retrieves the closest points based on vector similarity and given filtering conditions, grouped by a given payload field. summary: Search point groups tags: diff --git a/fern/apis/v1.13.x/openapi-overrides.yml b/fern/apis/v1.13.x/openapi-overrides.yml index fa09815..b15ea00 100644 --- a/fern/apis/v1.13.x/openapi-overrides.yml +++ b/fern/apis/v1.13.x/openapi-overrides.yml @@ -2576,6 +2576,7 @@ paths: language: go /collections/{collection_name}/points/search: post: + deprecated: true description: Retrieves the closest points based on vector similarity and given filtering conditions. summary: Search points @@ -2656,6 +2657,7 @@ paths: summary: Search batch points tags: - Search + x-fern-availability: deprecated x-fern-examples: - code-samples: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\ @@ -2745,6 +2747,7 @@ paths: language: go /collections/{collection_name}/points/search/groups: post: + availability: deprecated description: Retrieves the closest points based on vector similarity and given filtering conditions, grouped by a given payload field. summary: Search point groups From 3cbe4e9945d5c9f8b129eae00362a3cda4bb9822 Mon Sep 17 00:00:00 2001 From: George Panchuk Date: Wed, 29 Jan 2025 18:00:43 +0100 Subject: [PATCH 10/14] search deprecation works --- fern/api-description-overwrites.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/fern/api-description-overwrites.yml b/fern/api-description-overwrites.yml index b6b33ed..0d47e41 100644 --- a/fern/api-description-overwrites.yml +++ b/fern/api-description-overwrites.yml @@ -225,14 +225,12 @@ paths: - Search /collections/{collection_name}/points/search/batch: post: - x-fern-availability: deprecated description: Retrieves the closest points in batches based on vector similarity and given filtering conditions. summary: Search batch points tags: - Search /collections/{collection_name}/points/search/groups: post: - availability: deprecated description: Retrieves the closest points based on vector similarity and given filtering conditions, grouped by a given payload field. summary: Search point groups tags: From 9731eb79bac274b1b2d3c172d0f4224ea9779441 Mon Sep 17 00:00:00 2001 From: joein <22641570+joein@users.noreply.github.com> Date: Wed, 29 Jan 2025 17:01:21 +0000 Subject: [PATCH 11/14] Sync OpenAPI --- fern/apis/master/openapi-overrides.yml | 2 -- fern/apis/v1.13.x/openapi-overrides.yml | 2 -- 2 files changed, 4 deletions(-) diff --git a/fern/apis/master/openapi-overrides.yml b/fern/apis/master/openapi-overrides.yml index b58b908..088f5a0 100644 --- a/fern/apis/master/openapi-overrides.yml +++ b/fern/apis/master/openapi-overrides.yml @@ -1166,7 +1166,6 @@ paths: - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc searchBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfilter := qdrant.Filter{\n\t\tMust: []*qdrant.Condition{\n\t\t\tqdrant.NewMatch(\"city\", \"London\"),\n\t\t},\n\t}\n\tlimit := uint64(3)\n\tresults, err := client.QueryBatch(context.Background(), &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQuery(0.2, 0.1, 0.9, 0.7),\n\t\t\t\tLimit: &limit,\n\t\t\t\tFilter: &filter,\n\t\t\t},\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQuery(0.5, 0.3, 0.2, 0.3),\n\t\t\t\tLimit: &limit,\n\t\t\t\tFilter: &filter,\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go - x-fern-availability: deprecated description: Retrieves the closest points in batches based on vector similarity and given filtering conditions. summary: Search batch points tags: @@ -1195,7 +1194,6 @@ paths: - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc searchGroups() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tgroupSize := uint64(2)\n\tresults, err := client.QueryGroups(context.Background(), &qdrant.QueryPointGroups{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\tGroupBy: \"document_id\",\n\t\tGroupSize: &groupSize,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go - availability: deprecated description: Retrieves the closest points based on vector similarity and given filtering conditions, grouped by a given payload field. summary: Search point groups tags: diff --git a/fern/apis/v1.13.x/openapi-overrides.yml b/fern/apis/v1.13.x/openapi-overrides.yml index b15ea00..ee4e475 100644 --- a/fern/apis/v1.13.x/openapi-overrides.yml +++ b/fern/apis/v1.13.x/openapi-overrides.yml @@ -2657,7 +2657,6 @@ paths: summary: Search batch points tags: - Search - x-fern-availability: deprecated x-fern-examples: - code-samples: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\ @@ -2747,7 +2746,6 @@ paths: language: go /collections/{collection_name}/points/search/groups: post: - availability: deprecated description: Retrieves the closest points based on vector similarity and given filtering conditions, grouped by a given payload field. summary: Search point groups From 2f1e6ecc4d18ce086fef11d0dd8ebcbb73afc4ae Mon Sep 17 00:00:00 2001 From: George Panchuk Date: Wed, 29 Jan 2025 18:34:07 +0100 Subject: [PATCH 12/14] fetch deprecated from qdrant repo --- fern/api-description-overwrites.yml | 1 - tools/sync-openapi.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/fern/api-description-overwrites.yml b/fern/api-description-overwrites.yml index 0d47e41..c1ae75e 100644 --- a/fern/api-description-overwrites.yml +++ b/fern/api-description-overwrites.yml @@ -218,7 +218,6 @@ paths: - Points /collections/{collection_name}/points/search: post: - deprecated: true description: Retrieves the closest points based on vector similarity and given filtering conditions. summary: Search points tags: diff --git a/tools/sync-openapi.sh b/tools/sync-openapi.sh index 56775e3..5160f80 100755 --- a/tools/sync-openapi.sh +++ b/tools/sync-openapi.sh @@ -12,7 +12,7 @@ PROJECT_ROOT="$(pwd)/$(dirname "$0")/.." rm -rf qdrant -git clone --sparse --filter=blob:none --depth=1 -b master https://github.com/qdrant/qdrant.git +git clone --sparse --filter=blob:none --depth=1 -b deprecate-old-search-api https://github.com/qdrant/qdrant.git cd qdrant git sparse-checkout add docs/redoc From 8b4c2ff482863a0ca652b777bd34f38bd3c69f2f Mon Sep 17 00:00:00 2001 From: joein <22641570+joein@users.noreply.github.com> Date: Wed, 29 Jan 2025 17:34:52 +0000 Subject: [PATCH 13/14] Sync OpenAPI --- fern/apis/master/openapi-overrides.yml | 1 - fern/apis/master/openapi.json | 8 + fern/apis/v0.11.1/generators.yml | 2 + fern/apis/v0.11.1/openapi-overrides.yml | 1870 +++++++ fern/apis/v0.11.1/openapi.json | 5910 +++++++++++++++++++++++ fern/docs.yml | 2 + fern/versions/v0.11.1.yml | 8 + 7 files changed, 7800 insertions(+), 1 deletion(-) create mode 100644 fern/apis/v0.11.1/generators.yml create mode 100644 fern/apis/v0.11.1/openapi-overrides.yml create mode 100644 fern/apis/v0.11.1/openapi.json create mode 100644 fern/versions/v0.11.1.yml diff --git a/fern/apis/master/openapi-overrides.yml b/fern/apis/master/openapi-overrides.yml index 088f5a0..d885f8f 100644 --- a/fern/apis/master/openapi-overrides.yml +++ b/fern/apis/master/openapi-overrides.yml @@ -1137,7 +1137,6 @@ paths: - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc search() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tlimit := uint64(3)\n\tresults, err := client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQuery(0.2, 0.1, 0.9, 0.7),\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"city\", \"London\"),\n\t\t\t},\n\t\t},\n\t\tLimit: &limit,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - deprecated: true description: Retrieves the closest points based on vector similarity and given filtering conditions. summary: Search points tags: diff --git a/fern/apis/master/openapi.json b/fern/apis/master/openapi.json index c078e9c..54c895f 100644 --- a/fern/apis/master/openapi.json +++ b/fern/apis/master/openapi.json @@ -572,6 +572,7 @@ }, "/collections/{collection_name}/points/search": { "post": { + "deprecated": true, "tags": [ "Search" ], @@ -4872,6 +4873,7 @@ }, "/collections/{collection_name}/points/search/batch": { "post": { + "deprecated": true, "tags": [ "Search" ], @@ -4986,6 +4988,7 @@ }, "/collections/{collection_name}/points/search/groups": { "post": { + "deprecated": true, "tags": [ "Search" ], @@ -5094,6 +5097,7 @@ }, "/collections/{collection_name}/points/recommend": { "post": { + "deprecated": true, "tags": [ "Search" ], @@ -5205,6 +5209,7 @@ }, "/collections/{collection_name}/points/recommend/batch": { "post": { + "deprecated": true, "tags": [ "Search" ], @@ -5319,6 +5324,7 @@ }, "/collections/{collection_name}/points/recommend/groups": { "post": { + "deprecated": true, "tags": [ "Search" ], @@ -5427,6 +5433,7 @@ }, "/collections/{collection_name}/points/discover": { "post": { + "deprecated": true, "tags": [ "Search" ], @@ -5538,6 +5545,7 @@ }, "/collections/{collection_name}/points/discover/batch": { "post": { + "deprecated": true, "tags": [ "Search" ], diff --git a/fern/apis/v0.11.1/generators.yml b/fern/apis/v0.11.1/generators.yml new file mode 100644 index 0000000..7616c56 --- /dev/null +++ b/fern/apis/v0.11.1/generators.yml @@ -0,0 +1,2 @@ +openapi: ./openapi.json +openapi-overrides: ./openapi-overrides.yml \ No newline at end of file diff --git a/fern/apis/v0.11.1/openapi-overrides.yml b/fern/apis/v0.11.1/openapi-overrides.yml new file mode 100644 index 0000000..7493d97 --- /dev/null +++ b/fern/apis/v0.11.1/openapi-overrides.yml @@ -0,0 +1,1870 @@ +components: + securitySchemes: + BearerAuth: + scheme: bearer + type: http +paths: + /: {} + /aliases: {} + /cluster: + get: + description: Returns information about the cluster's current state and composition. + summary: Check cluster status + tags: + - Distributed + /cluster/peer/{peer_id}: + delete: + description: Attempts to remove the node from the cluster. This endpoint returns + an error if the node (peer) has shards on it. + summary: Remove peer from cluster + tags: + - Distributed + /cluster/recover: {} + /collections: + get: + description: Returns a list of all existing collections. + summary: List all collections + tags: + - Collections + x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ListCollectionsAsync(); + + ' + language: csharp + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/collections' \\\n --header\ + \ 'api-key: '" + language: curl + - code-samples: + - code: 'use qdrant_client::Qdrant; + + + let client = Qdrant::from_url("http://localhost:6334").build()?; + + + client.list_collections().await?; + + ' + language: rust + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.get_collections() + + ' + language: python + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.getCollections(); + + ' + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.listCollectionsAsync().get();\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc listCollections() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tcollections, err := client.ListCollections(context.Background())\n\ + \tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Collections: \"\ + , collections)\n}\n" + language: go + /collections/aliases: + post: + description: Updates aliases for the specified collections. + summary: Update collection aliases + tags: + - Aliases + x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.CreateAliasAsync(aliasName: "production_collection", collectionName: + "example_collection"); + + + await client.DeleteAliasAsync("production_collection"); + + ' + language: csharp + - code-samples: + - code: "# Create an alias\ncurl -X POST \\\n 'http://localhost:6333/collections/aliases'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"actions\": [\n {\n \ + \ \"create_alias\": {\n \"collection_name\": \"{collection_name}\"\ + ,\n \"alias_name\": \"{alias_name}\"\n }\n }\n ]\n}'\n\ + \n# Delete an alias\ncurl -X POST \\\n 'http://localhost:6333/collections/aliases'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"actions\": [\n {\n \ + \ \"delete_alias\": {\n \"alias_name\": \"{alias_name}\"\n \ + \ }\n }\n ]\n}'\n\n# Rename an alias\ncurl -X POST \\\n 'http://localhost:6333/collections/aliases'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"actions\": [\n {\n \ + \ \"rename_alias\": {\n \"old_alias_name\": \"{old_alias_name}\"\ + ,\n \"new_alias_name\": \"{new_alias_name}\"\n }\n }\n\ + \ ]\n}'\n" + language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{CreateAliasBuilder, DeleteAlias};\nuse\ + \ qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .create_alias(CreateAliasBuilder::new(\n \ + \ \"example_collection\",\n \"production_collection\",\n \ + \ ))\n .await?;\n\nclient\n .delete_alias(DeleteAlias {\n \ + \ alias_name: \"production_collection\".to_string(),\n })\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.update_collection_aliases(\n change_aliases_operations=[\n\ + \ models.CreateAliasOperation(\n create_alias=models.CreateAlias(\n\ + \ collection_name=\"example_collection\", alias_name=\"\ + production_collection\"\n )\n )\n ]\n)\n\nclient.update_collection_aliases(\n\ + \ change_aliases_operations=[\n models.DeleteAliasOperation(\n\ + \ delete_alias=models.DeleteAlias(alias_name=\"production_collection\"\ + )\n ),\n ]\n)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.updateCollectionAliases({\n actions: [\n {\n create_alias:\ + \ {\n collection_name: \"example_collection\",\n alias_name:\ + \ \"production_collection\",\n },\n },\n ],\n});\n\nclient.updateCollectionAliases({\n\ + \ actions: [\n {\n delete_alias: {\n alias_name: \"production_collection\"\ + ,\n },\n },\n ],\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport\ + \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Collections.DeleteShardKey;\nimport io.qdrant.client.grpc.Collections.DeleteShardKeyRequest;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.createAliasAsync(\"production_collection\"\ + , \"example_collection\").get();\n\nclient.deleteAliasAsync(\"production_collection\"\ + ).get();\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc updateAlias() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\terr = client.CreateAlias(context.Background(),\ + \ \"production_collection\", \"example_collection\")\n\tif err != nil\ + \ {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteAlias(context.Background(),\ + \ \"production_collection\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\ + \n\terr = client.RenameAlias(context.Background(), \"production_collection\"\ + , \"legacy_collection\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go + /collections/{collection_name}: + delete: + description: Drops the specified collection and all associated data in it. + summary: Delete a collection + tags: + - Collections + x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.DeleteCollectionAsync("{collection_name}"); + + ' + language: csharp + - code-samples: + - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name'\ + \ \\\n --header 'api-key: '" + language: curl + - code-samples: + - code: 'use qdrant_client::Qdrant; + + + let client = Qdrant::from_url("http://localhost:6334").build()?; + + + client.delete_collection("{collection_name}").await?; + + ' + language: rust + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.delete_collection(collection_name="{collection_name}") + + ' + language: python + - code-samples: + - code: 'import { QdrantClient } from ''@qdrant/qdrant-js''; + + + const client = new QdrantClient({url: ''http://127.0.0.1:6333''}); + + + client.deleteCollection("{collection_name}"); + + ' + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.deleteCollectionAsync(\"\ + {collection_name}\").get();\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc deleteCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\terr = client.DeleteCollection(context.Background(),\ + \ \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go + get: + description: Retrieves parameters from the specified collection. + summary: Get collection details + tags: + - Collections + x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.GetCollectionInfoAsync("{collection_name}"); + + ' + language: csharp + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name'\ + \ \\\n --header 'api-key: '" + language: curl + - code-samples: + - code: 'use qdrant_client::Qdrant; + + + let client = Qdrant::from_url("http://localhost:6334").build()?; + + + client.collection_info("{collection_name}").await?; + + ' + language: rust + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.get_collection("{collection_name}") + + ' + language: python + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.getCollection("{collection_name}"); + + ' + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.getCollectionInfoAsync(\"\ + {collection_name}\").get();\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc getCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tinfo, err := client.GetCollectionInfo(context.Background(),\ + \ \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"\ + Collection info: \", info)\n}\n" + language: go + patch: + description: Updates the parameters of the specified collection. + summary: Update collection parameters + tags: + - Collections + x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateCollectionAsync(\n\ + \ collectionName: \"{collection_name}\",\n optimizersConfig: new OptimizersConfigDiff\ + \ { IndexingThreshold = 10000 }\n);\n" + language: csharp + - code-samples: + - code: "curl -X PATCH \\\n 'http://localhost:6333/collections/collection_name'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"optimizers_config\": {\n\ + \ \"indexing_threshold\": 10000\n }\n}'" + language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{OptimizersConfigDiffBuilder, UpdateCollectionBuilder};\n\ + use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .update_collection(\n UpdateCollectionBuilder::new(\"\ + {collection_name}\").optimizers_config(\n OptimizersConfigDiffBuilder::default().indexing_threshold(10_000),\n\ + \ ),\n )\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.update_collection(\n collection_name=\"\ + {collection_name}\",\n optimizer_config=models.OptimizersConfigDiff(indexing_threshold=10000),\n\ + )\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.updateCollection(\"{collection_name}\", {\n optimizers_config:\ + \ {\n indexing_threshold: 10000,\n },\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport\ + \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Collections.OptimizersConfigDiff;\nimport\ + \ io.qdrant.client.grpc.Collections.UpdateCollection;\n\nQdrantClient\ + \ client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.updateCollectionAsync(\n\ + \ UpdateCollection.newBuilder()\n .setCollectionName(\"{collection_name}\"\ + )\n .setOptimizersConfig(\n OptimizersConfigDiff.newBuilder().setIndexingThreshold(10000).build())\n\ + \ .build());\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc updateCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tthreshold := uint64(10000)\n\terr = client.UpdateCollection(context.Background(),\ + \ &qdrant.UpdateCollection{\n\t\tCollectionName: \"{collection_name}\"\ + ,\n\t\tOptimizersConfig: &qdrant.OptimizersConfigDiff{\n\t\t\tIndexingThreshold:\ + \ &threshold,\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\ + }\n" + language: go + put: + description: Creates a new collection with the given parameters. + summary: Create a collection + tags: + - Collections + x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nawait client.CreateCollectionAsync(\n\ + \tcollectionName: \"{collection_name}\",\n\tvectorsConfig: new VectorParams\ + \ { Size = 100, Distance = Distance.Cosine }\n);\n\n// Or with sparse\ + \ vectors\n\nawait client.CreateCollectionAsync(\n\tcollectionName: \"\ + {collection_name}\",\n\tsparseVectorsConfig: (\"splade-model-name\", new\ + \ SparseVectorParams{\n Index = new SparseIndexConfig {\n \ + \ OnDisk = false,\n }\n })\n);" + language: csharp + - code-samples: + - code: "# Create a collection with default dense vector\ncurl -X PUT \\\n\ + \ 'http://localhost:6333/collections/collection_name' \\\n --header\ + \ 'api-key: ' \\\n --header 'Content-Type: application/json'\ + \ \\\n --data-raw '{\n \"vectors\": {\n \"size\": 384,\n \"distance\"\ + : \"Cosine\"\n }\n}'\n\n# Create a collection with named dense and sparse\ + \ vectors\ncurl -X PUT \\\n 'http://localhost:6333/collections/collection_name'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"vectors\": {\n \"dense-vector-name\"\ + : {\n \"size\": 1536,\n \"distance\": \"Cosine\"\n },\n \ + \ \"sparse_vectors\": {\n \"sparse-vector-name\": {\n \"\ + index\": {\n \"on_disk\": true\n }\n }\n }\n \ + \ }\n}'\n" + language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{CreateCollectionBuilder, Distance, VectorParamsBuilder};\n\ + use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .create_collection(\n CreateCollectionBuilder::new(\"\ + {collection_name}\")\n .vectors_config(VectorParamsBuilder::new(100,\ + \ Distance::Cosine)),\n )\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.create_collection(\n collection_name=\"\ + {collection_name}\",\n vectors_config=models.VectorParams(size=100,\ + \ distance=models.Distance.COSINE),\n)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.createCollection(\"{collection_name}\", {\n vectors: { size: 100,\ + \ distance: \"Cosine\" },\n});\n\n// or with sparse vectors\n\nclient.createCollection(\"\ + {collection_name}\", {\n vectors: { size: 100, distance: \"Cosine\" },\n\ + \ sparse_vectors: {\n \"splade-model-name\": {\n index: {\n \ + \ on_disk: false\n }\n }\n }\n});" + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Collections.Distance;\nimport io.qdrant.client.grpc.Collections.VectorParams;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.createCollectionAsync(\"\ + {collection_name}\",\n VectorParams.newBuilder().setDistance(Distance.Cosine).setSize(100).build()).get();\n\ + \n// Or with sparse vectors\n\nclient.createCollectionAsync(\n CreateCollection.newBuilder()\n\ + \ .setCollectionName(\"{collection_name}\")\n .setSparseVectorsConfig(\n\ + \ Collections.SparseVectorConfig.newBuilder().putMap(\n \ + \ \"splade-model-name\",\n Collections.SparseVectorParams.newBuilder()\n\ + \ .setIndex(\n Collections.SparseIndexConfig\n\ + \ .newBuilder()\n \ + \ .setOnDisk(false)\n .build()\n \ + \ ).build()\n ).build()\n ).build()\n).get();" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc createCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\terr = client.CreateCollection(context.Background(),\ + \ &qdrant.CreateCollection{\n\t\tCollectionName: \"{collection_name}\"\ + ,\n\t\tVectorsConfig: qdrant.NewVectorsConfig(&qdrant.VectorParams{\n\t\ + \t\tSize: 100,\n\t\t\tDistance: qdrant.Distance_Cosine,\n\t\t}),\n\ + \t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go + /collections/{collection_name}/aliases: {} + /collections/{collection_name}/cluster: + get: + description: Retrieves cluster details for a specified collection. + summary: Retrieve cluster details + tags: + - Distributed + post: + description: Updates the cluster configuration for a specified collection. + summary: Update cluster setup + tags: + - Distributed + /collections/{collection_name}/exists: {} + /collections/{collection_name}/facet: {} + /collections/{collection_name}/index: + put: + description: Creates a payload index for a field in the specified collection. + summary: Create payload index + tags: + - Indexes + x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\"\ + , 6334);\n\nawait client.CreatePayloadIndexAsync(\n collectionName: \"\ + {collection_name}\",\n fieldName: \"name_of_the_field_to_index\"\n);\n" + language: csharp + - code-samples: + - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/index'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"field_name\": \"field_name\"\ + ,\n \"field_schema\": \"keyword\"\n}'" + language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{CreateFieldIndexCollectionBuilder, FieldType};\n\ + use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .create_field_index(\n CreateFieldIndexCollectionBuilder::new(\n\ + \ \"{collection_name}\",\n \"{field_name}\",\n \ + \ FieldType::Keyword,\n ),\n )\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.create_payload_index(\n collection_name=\"\ + {collection_name}\",\n field_name=\"name_of_the_field_to_index\",\n\ + \ field_schema=\"keyword\",\n)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.createPayloadIndex(\"{collection_name}\", {\n field_name: \"{field_name}\"\ + ,\n field_schema: \"keyword\",\n});\n" + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Collections.PayloadSchemaType;\n\nQdrantClient\ + \ client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.createPayloadIndexAsync(\n\ + \ \"{collection_name}\",\n \"{field_name}\"\ + ,\n PayloadSchemaType.Keyword,\n null,\n\ + \ true,\n null,\n null);\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc createFieldIndex() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\t_, err = client.CreateFieldIndex(context.Background(),\ + \ &qdrant.CreateFieldIndexCollection{\n\t\tCollectionName: \"{collection_name}\"\ + ,\n\t\tFieldName: \"name_of_the_field_to_index\",\n\t\tFieldType:\ + \ qdrant.FieldType_FieldTypeKeyword.Enum(),\n\t})\n\tif err != nil\ + \ {\n\t\tpanic(err)\n\t}\n}\n" + language: go + /collections/{collection_name}/index/{field_name}: + delete: + description: Deletes a payload index for a field in the specified collection. + summary: Delete payload index + tags: + - Indexes + x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\"\ + , 6334);\n\nawait client.DeletePayloadIndexAsync(\n collectionName: \"\ + {collection_name}\",\n fieldName: \"name_of_the_field_to_index\"\n);\n" + language: csharp + - code-samples: + - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/index/field_name'\ + \ \\\n --header 'api-key: '" + language: curl + - code-samples: + - code: "use qdrant_client::qdrant::DeleteFieldIndexCollectionBuilder;\nuse\ + \ qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .delete_field_index(DeleteFieldIndexCollectionBuilder::new(\n\ + \ \"{collection_name}\",\n \"{field_name}\",\n ))\n \ + \ .await?;\n" + language: rust + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.delete_payload_index("{collection_name}", "{field_name}"); + + ' + language: python + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.deletePayloadIndex("{collection_name}", "{field_name}"); + + ' + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.deletePayloadIndexAsync(\"\ + {collection_name}\", \"{field_name}\", true, null, null).get();\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc deleteFieldIndex() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\t_, err = client.DeleteFieldIndex(context.Background(),\ + \ &qdrant.DeleteFieldIndexCollection{\n\t\tCollectionName: \"{collection_name}\"\ + ,\n\t\tFieldName: \"{field_name}\",\n\t})\n\tif err != nil {\n\t\t\ + panic(err)\n\t}\n}\n" + language: go + /collections/{collection_name}/points: + post: + description: Retrieves all details from multiple points. + summary: Retrieve points + tags: + - Points + x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\"\ + , 6334);\n\nawait client.RetrieveAsync(\n collectionName: \"{collection_name}\"\ + ,\n ids: [0, 30, 100],\n withPayload: false,\n withVectors: false\n\ + );\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"ids\": [\n 0,\n 3,\n\ + \ 100\n ]\n}'" + language: curl + - code-samples: + - code: "use qdrant_client::qdrant::GetPointsBuilder;\nuse qdrant_client::Qdrant;\n\ + \nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\ + \nclient\n .get_points(GetPointsBuilder::new(\n \"{collection_name}\"\ + ,\n vec![0.into(), 30.into(), 100.into()],\n ))\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.retrieve(\n collection_name=\"{collection_name}\"\ + ,\n ids=[0, 3, 100],\n)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.retrieve(\"{collection_name}\", {\n ids: [0, 3, 100],\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .retrieveAsync(\"{collection_name}\"\ + , List.of(id(0), id(30), id(100)), false, false, null)\n .get();\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc getPoints() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tpoints, err := client.Get(context.Background(),\ + \ &qdrant.GetPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\t\ + Ids: []*qdrant.PointId{\n\t\t\tqdrant.NewIDNum(0), qdrant.NewID(\"3\"\ + ), qdrant.NewIDNum(100),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\ + \t}\n\tfmt.Println(\"Points: \", points)\n}\n" + language: go + put: + description: Performs the insert + update action on specified points. Any point + with an existing {id} will be overwritten. + summary: Upsert points + tags: + - Points + x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nawait client.UpsertAsync(\n collectionName:\ + \ \"{collection_name}\",\n points: new List\n {\n new()\n\ + \ {\n Id = 1,\n Vectors = new[] { 0.9f, 0.1f, 0.1f },\n \ + \ Payload = { [\"city\"] = \"red\" }\n },\n new()\n {\n \ + \ Id = 2,\n Vectors = new[] { 0.1f, 0.9f, 0.1f },\n Payload\ + \ = { [\"city\"] = \"green\" }\n },\n new()\n {\n Id = 3,\n\ + \ Vectors = new[] { 0.1f, 0.1f, 0.9f },\n Payload = { [\"city\"\ + ] = \"blue\" }\n }\n }\n);\n" + language: csharp + - code-samples: + - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"points\": [\n {\n \ + \ \"id\": \"76874cce-1fb9-4e16-9b0b-f085ac06ed6f\",\n \"payload\"\ + : {\n \"color\": \"red\"\n },\n \"vector\": [\n \ + \ 0.9,\n 0.1,\n 0.1\n ]\n },\n {\n \"\ + id\": 1,\n \"payload\": {\n \"color\": \"green\"\n },\n\ + \ \"vector\": [\n 0.1,\n 0.9,\n 0.1\n ]\n\ + \ },\n {\n \"id\": 2,\n \"payload\": {\n \"color\"\ + : \"blue\"\n },\n \"vector\": [\n 0.1,\n 0.1,\n\ + \ 0.9\n ]\n }\n ]\n}'" + language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{PointStruct, UpsertPointsBuilder};\n\ + use qdrant_client::{Qdrant, Payload};\nuse serde_json::json;\n\nlet client\ + \ = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n\ + \ .upsert_points(\n UpsertPointsBuilder::new(\n \"\ + {collection_name}\",\n vec![\n PointStruct::new(\n\ + \ 1,\n vec![0.9, 0.1, 0.1],\n \ + \ Payload::try_from(json!(\n {\"\ + color\": \"red\"}\n ))\n .unwrap(),\n\ + \ ),\n PointStruct::new(\n \ + \ 2,\n vec![0.1, 0.9, 0.1],\n \ + \ Payload::try_from(json!(\n {\"color\": \"\ + green\"}\n ))\n .unwrap(),\n \ + \ ),\n PointStruct::new(\n \ + \ 3,\n vec![0.1, 0.1, 0.9],\n \ + \ Payload::try_from(json!(\n {\"color\": \"blue\"\ + }\n ))\n .unwrap(),\n \ + \ ),\n ],\n )\n .wait(true),\n )\n \ + \ .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.upsert(\n collection_name=\"{collection_name}\"\ + ,\n points=[\n models.PointStruct(\n id=1,\n \ + \ payload={\n \"color\": \"red\",\n },\n\ + \ vector=[0.9, 0.1, 0.1],\n ),\n models.PointStruct(\n\ + \ id=2,\n payload={\n \"color\":\ + \ \"green\",\n },\n vector=[0.1, 0.9, 0.1],\n \ + \ ),\n models.PointStruct(\n id=3,\n \ + \ payload={\n \"color\": \"blue\",\n },\n \ + \ vector=[0.1, 0.1, 0.9],\n ),\n ],\n)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.upsert(\"{collection_name}\", {\n points: [\n {\n id:\ + \ 1,\n payload: { color: \"red\" },\n vector: [0.9, 0.1, 0.1],\n\ + \ },\n {\n id: 2,\n payload: { color: \"green\" },\n \ + \ vector: [0.1, 0.9, 0.1],\n },\n {\n id: 3,\n payload:\ + \ { color: \"blue\" },\n vector: [0.1, 0.1, 0.9],\n },\n ],\n\ + });\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ + \ io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\ + \nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\n\ + import io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.PointStruct;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .upsertAsync(\n \ + \ \"{collection_name}\",\n List.of(\n PointStruct.newBuilder()\n\ + \ .setId(id(1))\n .setVectors(\n \ + \ namedVectors(\n Map.of(\n \ + \ \"image\",\n vector(List.of(0.9f,\ + \ 0.1f, 0.1f, 0.2f)),\n \"text\",\n \ + \ vector(List.of(0.4f, 0.7f, 0.1f, 0.8f, 0.1f, 0.1f,\ + \ 0.9f, 0.2f)))))\n .build(),\n PointStruct.newBuilder()\n\ + \ .setId(id(2))\n .setVectors(\n \ + \ namedVectors(\n Map.of(\n \ + \ \"image\",\n List.of(0.2f,\ + \ 0.1f, 0.3f, 0.9f),\n \"text\",\n \ + \ List.of(0.5f, 0.2f, 0.7f, 0.4f, 0.7f, 0.2f, 0.3f,\ + \ 0.9f))))\n .build()))\n .get();\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc upsert() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tresponse, err := client.Upsert(context.Background(),\ + \ &qdrant.UpsertPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ + \tPoints: []*qdrant.PointStruct{\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(1),\n\ + \t\t\t\tVectors: qdrant.NewVectors(0.9, 0.1, 0.1),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\ + \t\t\t\t\t\"color\": \"red\",\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\t\ + Id: qdrant.NewIDNum(2),\n\t\t\t\tVectors: qdrant.NewVectors(0.1,\ + \ 0.9, 0.1),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\ + \t\t\t\"color\": \"green\",\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\t\ + Id: qdrant.NewIDNum(3),\n\t\t\t\tVectors: qdrant.NewVectors(0.1,\ + \ 0.1, 0.9),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\ + \t\t\t\"color\": \"blue\",\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif\ + \ err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Upsert status: \"\ + , response.GetStatus())\n}\n" + language: go + /collections/{collection_name}/points/batch: {} + /collections/{collection_name}/points/count: + post: + description: Counts the number of points that match a specified filtering condition. + summary: Count points + tags: + - Points + x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\ + \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.CountAsync(\n\ + \ collectionName: \"{collection_name}\",\n filter: MatchKeyword(\"color\"\ + , \"red\"),\n exact: true\n);\n" + language: csharp + - code-samples: + - code: "# Count total number of points in a collection\ncurl -X POST \\\n\ + \ 'http://localhost:6333/collections/collection_name/points/count' \\\ + \n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"exact\": true\n}'\n\n# Count\ + \ points satisfying a filter condition\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/count'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"filter\": {\n \"must\"\ + : [\n {\n \"key\": \"color\",\n \"match\": {\n \ + \ \"value\": \"red\"\n }\n }\n ]\n },\n \"exact\"\ + : true\n}'" + language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{Condition, CountPointsBuilder, Filter};\n\ + use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .count(\n CountPointsBuilder::new(\"\ + {collection_name}\")\n .filter(Filter::must([Condition::matches(\n\ + \ \"color\",\n \"red\".to_string(),\n \ + \ )]))\n .exact(true),\n )\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.count(\n collection_name=\"{collection_name}\"\ + ,\n count_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"\ + color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n\ + \ exact=True,\n)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.count(\"{collection_name}\", {\n filter: {\n must: [\n\ + \ {\n key: \"color\",\n match:\ + \ {\n value: \"red\",\n },\n \ + \ },\n ],\n },\n exact: true,\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ + import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.Filter;\n\nQdrantClient client =\ + \ new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\ + \nclient\n .countAsync(\n \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"\ + color\", \"red\")).build(),\n true)\n .get();\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc count() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tcount, err := client.Count(context.Background(),\ + \ &qdrant.CountPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ + \tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\t\ + qdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err\ + \ != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Count:\", count)\n}\n" + language: go + /collections/{collection_name}/points/delete: + post: + description: Deletes specified points from the collection. + summary: Delete points + tags: + - Points + x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.DeleteAsync(collectionName: "{collection_name}", ids: [0, + 3, 100]); + + + await client.DeleteAsync(collectionName: "{collection_name}", filter: + MatchKeyword("color", "red")); + + ' + language: csharp + - code-samples: + - code: "# Delete points by IDs\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/delete'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"points\": [\n 0,\n \ + \ 3,\n 100\n ]\n}'\n\n# Delete points by filter \ncurl -X POST \\\ + \n 'http://localhost:6333/collections/collection_name/points/delete'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"filter\": {\n \"must\"\ + : [\n {\n \"key\": \"color\",\n \"match\": {\n \ + \ \"value\": \"red\"\n }\n }\n ]\n }\n}'\n" + language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{Condition, DeletePointsBuilder, Filter,\ + \ PointsIdsList};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"\ + http://localhost:6334\").build()?;\n\nclient\n .delete_points(\n \ + \ DeletePointsBuilder::new(\"{collection_name}\")\n .points(PointsIdsList\ + \ {\n ids: vec![0.into(), 3.into(), 100.into()],\n \ + \ })\n .wait(true),\n )\n .await?;\n\nclient\n\ + \ .delete_points(\n DeletePointsBuilder::new(\"{collection_name}\"\ + )\n .points(Filter::must([Condition::matches(\n \ + \ \"color\",\n \"red\".to_string(),\n )]))\n\ + \ .wait(true),\n )\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.delete(\n collection_name=\"{collection_name}\"\ + ,\n points_selector=models.PointIdsList(\n points=[0, 3, 100],\n\ + \ ),\n)\n\nclient.delete(\n collection_name=\"{collection_name}\"\ + ,\n points_selector=models.FilterSelector(\n filter=models.Filter(\n\ + \ must=[\n models.FieldCondition(\n \ + \ key=\"color\",\n match=models.MatchValue(value=\"\ + red\"),\n ),\n ],\n )\n ),\n)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.delete(\"{collection_name}\", {\n points: [0, 3, 100],\n});\n\n\ + client.delete(\"{collection_name}\", {\n filter: {\n must: [\n\ + \ {\n key: \"color\",\n match:\ + \ {\n value: \"red\",\n },\n \ + \ },\n ],\n },\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ + \ io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport java.util.List;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.Filter;\n\nQdrantClient client =\ + \ new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\"\ + , 6334, false).build());\n\nclient.deleteAsync(\"{collection_name}\",\ + \ List.of(id(0), id(3), id(100)));\n\nclient\n .deleteAsync(\n \ + \ \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"\ + color\", \"red\")).build())\n .get();\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc delete() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\t_, err = client.Delete(context.Background(), &qdrant.DeletePoints{\n\ + \t\tCollectionName: \"{collection_name}\",\n\t\tPoints: qdrant.NewPointsSelectorIDs([]*qdrant.PointId{\n\ + \t\t\tqdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(100),\n\t\ + \t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.Delete(context.Background(),\ + \ &qdrant.DeletePoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ + \tPoints: qdrant.NewPointsSelectorFilter(&qdrant.Filter{\n\t\t\tMust:\ + \ []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\ + \t\t\t},\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go + /collections/{collection_name}/points/discover: {} + /collections/{collection_name}/points/discover/batch: {} + /collections/{collection_name}/points/payload: + post: + description: Sets payload values for specified points. + summary: Set payload + tags: + - Points + x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nawait client.SetPayloadAsync(\n\ + \ collectionName: \"{collection_name}\",\n payload: new Dictionary { { \"property1\", \"string\" }, { \"property2\", \"string\"\ + \ } },\n ids: new ulong[] { 0, 3, 10 }\n);\n" + language: csharp + - code-samples: + - code: "# Set payload by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"payload\": {\n \"property1\"\ + : \"some_value\",\n \"property2\": 32,\n \"property3\": true\n \ + \ },\n \"points\": [\n 0,\n 3,\n 10\n ]\n}'\n\n# Set payload\ + \ by filter\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"filter\": {\n \"must\"\ + : [\n {\n \"key\": \"color\",\n \"match\": {\n \ + \ \"value\": \"red\"\n }\n }\n ]\n },\n \"payload\"\ + : {\n \"property1\": \"some_value\",\n \"property2\": 32,\n \"\ + property3\": true\n }\n}'" + language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{PointsIdsList, SetPayloadPointsBuilder};\n\ + use qdrant_client::{Qdrant, Payload};\nuse serde_json::json;\n\nlet client\ + \ = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet payload:\ + \ Payload = json!({\n \"property1\": \"string\",\n \"property2\"\ + : \"string\",\n})\n.try_into()\n.unwrap();\n\nclient\n .set_payload(\n\ + \ SetPayloadPointsBuilder::new(\"{collection_name}\", payload)\n\ + \ .points_selector(PointsIdsList {\n ids: vec![0.into(),\ + \ 3.into(), 10.into()],\n })\n .wait(true),\n \ + \ )\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.set_payload(\n collection_name=\"\ + {collection_name}\",\n payload={\n \"property1\": \"string\"\ + ,\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n\ + )\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.setPayload(\"{collection_name}\", {\n payload: {\n property1:\ + \ \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n\ + });\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ + \ io.qdrant.client.ValueFactory.value;\n\nimport java.util.List;\nimport\ + \ java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .setPayloadAsync(\n\ + \ \"{collection_name}\",\n Map.of(\"property1\", value(\"\ + string\"), \"property2\", value(\"string\")),\n List.of(id(0),\ + \ id(3), id(10)),\n true,\n null,\n null)\n .get();\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc setPayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tresults, err := client.SetPayload(context.Background(),\ + \ &qdrant.SetPayloadPoints{\n\t\tCollectionName: \"{collection_name}\"\ + ,\n\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\"property1\"\ + : \"string\",\n\t\t\t\"property2\": \"string\",\n\t\t}),\n\t\tPointsSelector:\ + \ qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(10)),\n\ + \t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results:\ + \ \", results)\n}\n" + language: go + /collections/{collection_name}/points/payload/clear: + post: + description: Removes the entire payload for specified points. + summary: Clear payload + tags: + - Points + x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ClearPayloadAsync("{collection_name}", [0, 3, 10]); + + ' + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload/clear'\ + \ \\\n --header 'Content-Type: application/json' \\\n --header 'api-key:\ + \ ' \\\n --data-raw '{\n \"points\": [\n 0,\n 3,\n\ + \ 100\n ]\n}'" + language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{ClearPayloadPointsBuilder, PointsIdsList};\n\ + use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .clear_payload(ClearPayloadPointsBuilder::new(\"\ + {collection_name}\").points(\n PointsIdsList {\n ids:\ + \ vec![0.into(), 3.into(), 100.into()],\n },\n ))\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.clear_payload(\n collection_name=\"\ + {collection_name}\",\n points_selector=[0, 3, 100],\n)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.clearPayload(\"{collection_name}\", {\n points: [0, 3, 100],\n\ + });\n" + language: typescript + - code-samples: + - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.clearPayloadAsync(\"{collection_name}\"\ + , List.of(id(0), id(3), id(100)), null, null, null)\n .get();\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc clearPayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\t_, err = client.ClearPayload(context.Background(),\ + \ &qdrant.ClearPayloadPoints{\n\t\tCollectionName: \"{collection_name}\"\ + ,\n\t\tPoints: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewID(\"\ + 3\"), qdrant.NewIDNum(100)),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\ + \t}\n}\n" + language: go + /collections/{collection_name}/points/payload/delete: + post: + description: Deletes a specified key payload for points. + summary: Delete payload + tags: + - Points + x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.DeletePayloadAsync("{collection_name}", ["color", "price"], + [0, 3, 10]); + + ' + language: csharp + - code-samples: + - code: "# Delete payload by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload/delete'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"keys\": [\n \"color\"\ + ,\n \"price\"\n ],\n \"points\": [\n 0,\n 3,\n 100\n ]\n\ + }'\n\n# Delete payload by filter\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload/delete'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"keys\": [\n \"color\"\ + ,\n \"price\"\n ],\n \"filter\": {\n \"must\": [\n {\n \ + \ \"key\": \"color\",\n \"match\": {\n \"value\"\ + : \"red\"\n }\n }\n ]\n }\n}'" + language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{DeletePayloadPointsBuilder, PointsIdsList};\n\ + use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .delete_payload(\n DeletePayloadPointsBuilder::new(\n\ + \ \"{collection_name}\",\n vec![\"color\".to_string(),\ + \ \"price\".to_string()],\n )\n .points_selector(PointsIdsList\ + \ {\n ids: vec![0.into(), 3.into(), 100.into()],\n })\n\ + \ .wait(true),\n )\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.delete_payload(\n collection_name=\"\ + {collection_name}\",\n keys=[\"color\", \"price\"],\n points=[0,\ + \ 3, 100],\n)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.deletePayload(\"{collection_name}\", {\n keys: [\"color\", \"\ + price\"],\n points: [0, 3, 100],\n});\n" + language: typescript + - code-samples: + - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .deletePayloadAsync(\n\ + \ \"{collection_name}\",\n List.of(\"color\", \"price\"\ + ),\n List.of(id(0), id(3), id(100)),\n true,\n null,\n\ + \ null)\n .get();\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc deletePayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\t_, err = client.DeletePayload(context.Background(),\ + \ &qdrant.DeletePayloadPoints{\n\t\tCollectionName: \"{collection_name}\"\ + ,\n\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3),\ + \ qdrant.NewIDNum(100)),\n\t\tKeys: []string{\"color\", \"price\"\ + },\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go + /collections/{collection_name}/points/query: {} + /collections/{collection_name}/points/query/batch: {} + /collections/{collection_name}/points/query/groups: {} + /collections/{collection_name}/points/recommend: + post: + description: Retrieves points that are closer to stored positive examples and + further from negative examples. + summary: Recommend points + tags: + - Search + x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\ + \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendAsync(\n\ + \ \"{collection_name}\",\n positive: new ulong[] { 100, 231 },\n\ + \ negative: new ulong[] { 718 },\n filter: MatchKeyword(\"city\"\ + , \"London\"),\n limit: 3\n);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"positive\": [\n 100,\n\ + \ 231\n ],\n \"negative\": [\n \"3a6e2150-f7b7-496e-92cd-687e63e215fd\"\ + ,\n [\n 0.2,\n 0.3,\n 0.4,\n 0.5\n ]\n ],\n\ + \ \"filter\": {\n \"must\": [\n {\n \"key\": \"city\"\ + ,\n \"match\": {\n \"value\": \"London\"\n }\n\ + \ }\n ]\n },\n \"limit\": 1\n}'" + language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{Condition, Filter, RecommendPointsBuilder,\ + \ RecommendStrategy};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"\ + http://localhost:6334\").build()?;\n\nclient\n .recommend(\n \ + \ RecommendPointsBuilder::new(\"{collection_name}\", 3)\n \ + \ .add_positive(100)\n .add_positive(200)\n .add_positive(vec![100.0,\ + \ 231.0])\n .add_negative(718)\n .add_negative(vec![0.2,\ + \ 0.3, 0.4, 0.5])\n .strategy(RecommendStrategy::AverageVector)\n\ + \ .filter(Filter::must([Condition::matches(\n \ + \ \"city\",\n \"London\".to_string(),\n )])),\n\ + \ )\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.recommend(\n collection_name=\"\ + {collection_name}\",\n positive=[100, 231],\n negative=[718, [0.2,\ + \ 0.3, 0.4, 0.5]],\n strategy=models.RecommendStrategy.AVERAGE_VECTOR,\n\ + \ query_filter=models.Filter(\n must=[\n models.FieldCondition(\n\ + \ key=\"city\",\n match=models.MatchValue(\n\ + \ value=\"London\",\n ),\n \ + \ )\n ]\n ),\n limit=3,\n)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.recommend(\"{collection_name}\", {\n positive: [100, 231],\n\ + \ negative: [718, [0.2, 0.3, 0.4, 0.5]],\n strategy: \"average_vector\"\ + ,\n filter: {\n must: [\n {\n key:\ + \ \"city\",\n match: {\n value: \"London\"\ + ,\n },\n },\n ],\n },\n limit:\ + \ 3,\n});\n" + language: typescript + - code-samples: + - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ + import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.RecommendPoints;\n\ + import io.qdrant.client.grpc.Points.RecommendStrategy;\n\nQdrantClient\ + \ client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\"\ + , 6334, false).build());\n\nclient\n .recommendAsync(\n RecommendPoints.newBuilder()\n\ + \ .setCollectionName(\"{collection_name}\")\n .addAllPositive(List.of(id(100),\ + \ id(200)))\n .addAllPositiveVectors(List.of(vector(100.0f,\ + \ 231.0f)))\n .addAllNegative(List.of(id(718)))\n \ + \ .addAllPositiveVectors(List.of(vector(0.2f, 0.3f, 0.4f, 0.5f)))\n\ + \ .setStrategy(RecommendStrategy.AverageVector)\n \ + \ .setFilter(Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\"\ + )))\n .setLimit(3)\n .build())\n .get();\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc recommend() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tresults, err := client.Query(context.Background(),\ + \ &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ + \tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\t\t\tPositive:\ + \ []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\ + \t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(231)),\n\t\t\t},\n\t\t\ + \tNegative: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\ + \t\t\t\tqdrant.NewVectorInput(0.2, 0.3, 0.4, 0.5),\n\t\t\t},\n\t\t\tStrategy:\ + \ qdrant.RecommendStrategy_AverageVector.Enum(),\n\t\t}),\n\t\tFilter:\ + \ &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"\ + city\", \"London\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\t\ + panic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" + language: go + /collections/{collection_name}/points/recommend/batch: + post: + description: Retrieves points in batches that are closer to stored positive + examples and further from negative examples. + summary: Recommend batch points + tags: + - Search + x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\ + \nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter =\ + \ MatchKeyword(\"city\", \"london\");\n\nawait client.RecommendBatchAsync(\n\ + \ collectionName: \"{collection_name}\",\n recommendSearches:\n [\n\ + \ new()\n {\n CollectionName = \"{collection_name}\",\n \ + \ Positive = { new PointId[] { 100, 231 } },\n Negative = { new\ + \ PointId[] { 718 } },\n Limit = 3,\n Filter = filter,\n \ + \ },\n new()\n {\n CollectionName = \"{collection_name}\",\n\ + \ Positive = { new PointId[] { 200, 67 } },\n Negative = { new\ + \ PointId[] { 300 } },\n Limit = 3,\n Filter = filter,\n \ + \ }\n ]\n);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend/batch'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \ + \ \"positive\": [\n 100,\n 231\n ],\n \"negative\"\ + : [\n \"9ad0884a-7bfe-43c0-b88f-c1d9a588b7e1\"\n ],\n \ + \ \"limit\": 1\n },\n {\n \"positive\": [\n 200,\n\ + \ 67\n ],\n \"negative\": [\n 300\n ],\n\ + \ \"limit\": 5\n }\n ]\n}'" + language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{\n Condition, Filter, RecommendBatchPointsBuilder,\ + \ RecommendPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\nlet client\ + \ = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet filter\ + \ = Filter::must([Condition::matches(\"city\", \"London\".to_string())]);\n\ + let recommend_queries = vec![\n RecommendPointsBuilder::new(\"{collection_name}\"\ + , 3)\n .add_positive(100)\n .add_positive(231)\n \ + \ .add_negative(718)\n .filter(filter.clone())\n .build(),\n\ + \ RecommendPointsBuilder::new(\"{collection_name}\", 3)\n .add_positive(200)\n\ + \ .add_positive(67)\n .add_negative(300)\n .filter(filter.clone())\n\ + \ .build(),\n];\n\nclient\n .recommend_batch(RecommendBatchPointsBuilder::new(\n\ + \ \"{collection_name}\",\n recommend_queries,\n ))\n\ + \ .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nrecommend_queries = [\n models.RecommendRequest(\n\ + \ positive=[100, 231], negative=[718], filter=filter_, limit=3\n\ + \ ),\n models.RecommendRequest(positive=[200, 67], negative=[300],\ + \ limit=3),\n]\n\nclient.recommend_batch(collection_name=\"{collection_name}\"\ + , requests=recommend_queries)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + const searches = [\n {\n positive: [100, 231],\n negative:\ + \ [718],\n limit: 3,\n },\n {\n positive: [200, 67],\n\ + \ negative: [300],\n limit: 3,\n },\n];\n\nclient.recommend_batch(\"\ + {collection_name}\", {\n searches,\n});\n" + language: typescript + - code-samples: + - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ + import static io.qdrant.client.PointIdFactory.id;\n\nimport io.qdrant.client.QdrantClient;\n\ + import io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\n\ + import io.qdrant.client.grpc.Points.RecommendPoints;\n\nQdrantClient client\ + \ =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334,\ + \ false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"\ + city\", \"London\")).build();\n\nList recommendQueries\ + \ =\n List.of(\n RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(100),\ + \ id(231)))\n .addAllNegative(List.of(id(718)))\n \ + \ .setFilter(filter)\n .setLimit(3)\n .build(),\n\ + \ RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(200),\ + \ id(67)))\n .addAllNegative(List.of(id(300)))\n \ + \ .setFilter(filter)\n .setLimit(3)\n .build());\n\ + \nclient.recommendBatchAsync(\"{collection_name}\", recommendQueries,\ + \ null).get();\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc recommendBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tresults, err := client.QueryBatch(context.Background(),\ + \ &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\"\ + ,\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName:\ + \ \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\ + \t\t\t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\ + \t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(231)),\n\t\t\t\t\t\ + },\n\t\t\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\ + \t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\tCollectionName:\ + \ \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\ + \t\t\t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\ + \t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(67)),\n\t\t\t\t\t\ + },\n\t\t\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(300)),\n\ + \t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\ + \t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" + language: go + /collections/{collection_name}/points/recommend/groups: {} + /collections/{collection_name}/points/scroll: + post: + description: 'Returns all points in a page-by-page manner. + + By default, all resulting points are sorted by {id}. + + To query the next page specify the last {id} in the offset field. + + Additionally, you can specify filters and sorting options. + + ' + summary: Scroll points + tags: + - Points + x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\ + \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.ScrollAsync(\n\ + \ collectionName: \"{collection_name}\",\n filter: MatchKeyword(\"color\"\ + , \"red\"),\n limit: 1,\n payloadSelector: true\n);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/scroll'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"with_payload\": [\n \"\ + city\",\n \"color\"\n ],\n \"filter\": {\n \"must\": [\n \ + \ {\n \"key\": \"color\",\n \"match\": {\n \"value\"\ + : \"red\"\n }\n }\n ]\n },\n \"limit\": 2,\n \"with_vector\"\ + : false\n}'" + language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{Condition, Filter, ScrollPointsBuilder};\n\ + use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .scroll(\n ScrollPointsBuilder::new(\"\ + {collection_name}\")\n .filter(Filter::must([Condition::matches(\n\ + \ \"color\",\n \"red\".to_string(),\n \ + \ )]))\n .limit(1)\n .with_payload(true)\n\ + \ .with_vectors(false),\n )\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.scroll(\n collection_name=\"{collection_name}\"\ + ,\n scroll_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"\ + color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n\ + \ limit=1,\n with_payload=True,\n with_vectors=False,\n)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.scroll(\"{collection_name}\", {\n filter: {\n must: [\n\ + \ {\n key: \"color\",\n match:\ + \ {\n value: \"red\",\n },\n \ + \ },\n ],\n },\n limit: 1,\n with_payload: true,\n\ + \ with_vector: false,\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\nimport\ + \ static io.qdrant.client.WithPayloadSelectorFactory.enable;\n\nimport\ + \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.ScrollPoints;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .scrollAsync(\n \ + \ ScrollPoints.newBuilder()\n .setCollectionName(\"{collection_name}\"\ + )\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"\ + color\", \"red\")).build())\n .setLimit(1)\n .setWithPayload(enable(true))\n\ + \ .build())\n .get();\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc scroll() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tlimit := uint32(1)\n\tresults, err := client.Scroll(context.Background(),\ + \ &qdrant.ScrollPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ + \tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\t\ + qdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t},\n\t\tLimit: \ + \ &limit,\n\t\tWithPayload: qdrant.NewWithPayloadEnable(true),\n\t\t\ + WithVectors: qdrant.NewWithVectorsEnable(false),\n\t})\n\tif err != nil\ + \ {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" + language: go + /collections/{collection_name}/points/search: + post: + description: Retrieves the closest points based on vector similarity and given + filtering conditions. + summary: Search points + tags: + - Search + x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\ + \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchAsync(\n\ + \ collectionName: \"{collection_name}\",\n vector: new float[] { 0.2f,\ + \ 0.1f, 0.9f, 0.7f },\n filter: MatchKeyword(\"city\", \"London\"),\n\ + \ limit: 3\n);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"vector\": [\n 0.2,\n \ + \ 0.1,\n 0.9,\n 0.7\n ],\n \"limit\": 1,\n \"filter\": {\n\ + \ \"must\": [\n {\n \"key\": \"city\",\n \"match\"\ + : {\n \"value\": \"London\"\n }\n }\n ]\n }\n\ + }'" + language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{Condition, Filter, SearchParamsBuilder,\ + \ SearchPointsBuilder};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"\ + http://localhost:6334\").build()?;\n\nclient\n .search_points(\n \ + \ SearchPointsBuilder::new(\"{collection_name}\", vec![0.2, 0.1,\ + \ 0.9, 0.7], 3)\n .filter(Filter::must([Condition::matches(\n\ + \ \"city\",\n \"London\".to_string(),\n\ + \ )]))\n .params(SearchParamsBuilder::default().hnsw_ef(128).exact(false)),\n\ + \ )\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.search(\n collection_name=\"{collection_name}\"\ + ,\n query_filter=models.Filter(\n must=[\n models.FieldCondition(\n\ + \ key=\"city\",\n match=models.MatchValue(\n\ + \ value=\"London\",\n ),\n \ + \ )\n ]\n ),\n query_vector=[0.2, 0.1, 0.9, 0.7],\n \ + \ limit=3,\n)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.search(\"{collection_name}\", {\n filter: {\n must: [\n\ + \ {\n key: \"city\",\n match:\ + \ {\n value: \"London\",\n },\n \ + \ },\n ],\n },\n vector: [0.2, 0.1, 0.9, 0.7],\n \ + \ limit: 3,\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ + import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .searchAsync(\n \ + \ SearchPoints.newBuilder()\n .setCollectionName(\"{collection_name}\"\ + )\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"\ + city\", \"London\")).build())\n .addAllVector(List.of(0.2f,\ + \ 0.1f, 0.9f, 0.7f))\n .setLimit(3)\n .build())\n\ + \ .get();\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc search() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tlimit := uint64(3)\n\tresults, err := client.Query(context.Background(),\ + \ &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ + \tQuery: qdrant.NewQuery(0.2, 0.1, 0.9, 0.7),\n\t\tFilter: &qdrant.Filter{\n\ + \t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"city\", \"\ + London\"),\n\t\t\t},\n\t\t},\n\t\tLimit: &limit,\n\t})\n\tif err != nil\ + \ {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" + language: go + /collections/{collection_name}/points/search/batch: + post: + description: Retrieves the closest points in batches based on vector similarity + and given filtering conditions. + summary: Search batch points + tags: + - Search + x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\ + \nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter =\ + \ MatchKeyword(\"city\", \"London\");\n\nvar searches = new List\n\ + {\n new()\n {\n Vector = { new float[] { 0.2f, 0.1f, 0.9f, 0.7f }\ + \ },\n Filter = filter,\n Limit = 3\n },\n new()\n {\n Vector\ + \ = { new float[] { 0.5f, 0.3f, 0.2f, 0.3f } },\n Filter = filter,\n\ + \ Limit = 3\n }\n};\n\nawait client.SearchBatchAsync(collectionName:\ + \ \"{collection_name}\", searches: searches);\n" + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search/batch'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \ + \ \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n \ + \ 0.7\n ],\n \"limit\": 3\n },\n {\n \"vector\":\ + \ [\n 0.5,\n 0.3,\n 0.2,\n 0.3\n ],\n\ + \ \"filter\": {\n \"must\": [\n {\n \"\ + key\": \"city\",\n \"match\": {\n \"value\": \"\ + London\"\n }\n }\n ]\n },\n \"limit\"\ + : 3\n }\n ]\n}'" + language: curl + - code-samples: + - code: "use qdrant_client::qdrant::{\n Condition, Filter, SearchBatchPointsBuilder,\ + \ SearchPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\nlet client =\ + \ Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet filter\ + \ = Filter::must([Condition::matches(\"city\", \"London\".to_string())]);\n\ + \nlet searches = vec![\n SearchPointsBuilder::new(\"{collection_name}\"\ + , vec![0.2, 0.1, 0.9, 0.7], 3)\n .filter(filter.clone())\n \ + \ .build(),\n SearchPointsBuilder::new(\"{collection_name}\", vec![0.5,\ + \ 0.3, 0.2, 0.3], 3)\n .filter(filter.clone())\n .build(),\n\ + ];\n\nclient\n .search_batch_points(SearchBatchPointsBuilder::new(\"\ + {collection_name}\", searches))\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nfilter_ = models.Filter(\n must=[\n \ + \ models.FieldCondition(\n key=\"city\",\n match=models.MatchValue(\n\ + \ value=\"London\",\n ),\n )\n ]\n\ + )\n\nsearch_queries = [\n models.SearchRequest(vector=[0.2, 0.1, 0.9,\ + \ 0.7], filter=filter_, limit=3),\n models.SearchRequest(vector=[0.5,\ + \ 0.3, 0.2, 0.3], filter=filter_, limit=3),\n]\n\nclient.search_batch(collection_name=\"\ + {collection_name}\", requests=search_queries)\n" + language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + const filter = {\n must: [\n {\n key: \"city\",\n\ + \ match: {\n value: \"London\",\n \ + \ },\n },\n ],\n};\n\nconst searches = [\n {\n vector:\ + \ [0.2, 0.1, 0.9, 0.7],\n filter,\n limit: 3,\n },\n\ + \ {\n vector: [0.5, 0.3, 0.2, 0.3],\n filter,\n \ + \ limit: 3,\n },\n];\n\nclient.searchBatch(\"{collection_name}\"\ + , {\n searches,\n});\n" + language: typescript + - code-samples: + - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\ + \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"\ + city\", \"London\")).build();\nList searches =\n List.of(\n\ + \ SearchPoints.newBuilder()\n .addAllVector(List.of(0.2f,\ + \ 0.1f, 0.9f, 0.7f))\n .setFilter(filter)\n .setLimit(3)\n\ + \ .build(),\n SearchPoints.newBuilder()\n \ + \ .addAllVector(List.of(0.5f, 0.3f, 0.2f, 0.3f))\n .setFilter(filter)\n\ + \ .setLimit(3)\n .build());\nclient.searchBatchAsync(\"\ + {collection_name}\", searches, null).get();\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc searchBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tfilter := qdrant.Filter{\n\t\tMust: []*qdrant.Condition{\n\ + \t\t\tqdrant.NewMatch(\"city\", \"London\"),\n\t\t},\n\t}\n\tlimit :=\ + \ uint64(3)\n\tresults, err := client.QueryBatch(context.Background(),\ + \ &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\"\ + ,\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName:\ + \ \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQuery(0.2,\ + \ 0.1, 0.9, 0.7),\n\t\t\t\tLimit: &limit,\n\t\t\t\tFilter: \ + \ &filter,\n\t\t\t},\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\"\ + ,\n\t\t\t\tQuery: qdrant.NewQuery(0.5, 0.3, 0.2, 0.3),\n\t\t\t\ + \tLimit: &limit,\n\t\t\t\tFilter: &filter,\n\t\t\t},\n\ + \t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"\ + Query results: \", results)\n}\n" + language: go + /collections/{collection_name}/points/search/groups: {} + /collections/{collection_name}/points/search/matrix/offsets: {} + /collections/{collection_name}/points/search/matrix/pairs: {} + /collections/{collection_name}/points/vectors: {} + /collections/{collection_name}/points/vectors/delete: {} + /collections/{collection_name}/points/{id}: + get: + description: Retrieves all details from a single point. + summary: Retrieve a point + tags: + - Points + /collections/{collection_name}/shards: {} + /collections/{collection_name}/shards/delete: {} + /collections/{collection_name}/shards/{shard_id}/snapshots: {} + /collections/{collection_name}/shards/{shard_id}/snapshots/recover: {} + /collections/{collection_name}/shards/{shard_id}/snapshots/upload: {} + /collections/{collection_name}/shards/{shard_id}/snapshots/{snapshot_name}: {} + /collections/{collection_name}/snapshots: + get: + description: Retrieves a list of all snapshots for a specified collection. + summary: List all snapshots (collection) + tags: + - Snapshots + x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ListSnapshotsAsync("{collection_name}"); + + ' + language: csharp + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/snapshots'\ + \ \\\n --header 'api-key: '" + language: curl + - code-samples: + - code: 'use qdrant_client::Qdrant; + + + let client = Qdrant::from_url("http://localhost:6334").build()?; + + + client.list_snapshots("{collection_name}").await?; + + ' + language: rust + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.list_snapshots(collection_name="{collection_name}") + + ' + language: python + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.listSnapshots("{collection_name}"); + + ' + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.listSnapshotAsync(\"{collection_name}\"\ + ).get();\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc listSnapshots() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tsnapshots, err := client.ListSnapshots(context.Background(),\ + \ \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"\ + Snapshots: \", snapshots)\n}\n" + language: go + post: + description: Creates a new snapshot for a specified collection. + summary: Create a snapshot (collection) + tags: + - Snapshots + x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.CreateSnapshotAsync("{collection_name}"); + + ' + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/snapshots'\ + \ \\\n --header 'api-key: '" + language: curl + - code-samples: + - code: 'use qdrant_client::Qdrant; + + + let client = Qdrant::from_url("http://localhost:6334").build()?; + + + client.create_snapshot("{collection_name}").await?; + + ' + language: rust + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.create_snapshot(collection_name="{collection_name}") + + ' + language: python + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.createSnapshot("{collection_name}"); + + ' + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.createSnapshotAsync(\"{collection_name}\"\ + ).get();\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc createSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tsnapshot, err := client.CreateSnapshot(context.Background(),\ + \ \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"\ + Snapshot created: \", snapshot.Name)\n}\n" + language: go + /collections/{collection_name}/snapshots/recover: {} + /collections/{collection_name}/snapshots/upload: {} + /collections/{collection_name}/snapshots/{snapshot_name}: + get: + description: Downloads the specified snapshot file from a collection. + summary: Download a snapshot (collection) + tags: + - Snapshots + /healthz: {} + /issues: {} + /livez: {} + /locks: + get: + description: Retrieves the current lock setting. If write is false, all write + operations and collection creation are restricted. + summary: Check write protection + tags: + - Service + post: + description: Restricts all write operations and forbids collection creation. + This endpoint also returns previous lock options. + summary: Set write protection + tags: + - Service + /metrics: {} + /readyz: {} + /snapshots: + get: + description: Returns a list of all snapshots for the entire storage. + summary: List all snapshots (storage) + tags: + - Snapshots + x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ListFullSnapshotsAsync(); + + ' + language: csharp + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/snapshots' \\\n --header\ + \ 'api-key: '" + language: curl + - code-samples: + - code: 'use qdrant_client::Qdrant; + + + let client = Qdrant::from_url("http://localhost:6334").build()?; + + + client.list_full_snapshots().await?; + + ' + language: rust + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.list_full_snapshots() + + ' + language: python + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.listFullSnapshots(); + + ' + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.listFullSnapshotAsync().get();\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc listFullSnapshots() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tsnapshots, err := client.ListFullSnapshots(context.Background())\n\ + \tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Full snapshots:\ + \ \", snapshots)\n}\n" + language: go + post: + description: Creates a new snapshot of the entire storage. + summary: Create a snapshot (storage) + tags: + - Snapshots + x-fern-examples: + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.CreateFullSnapshotAsync(); + + ' + language: csharp + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/snapshots' \\\n --header\ + \ 'api-key: '" + language: curl + - code-samples: + - code: 'use qdrant_client::Qdrant; + + + let client = Qdrant::from_url("http://localhost:6334").build()?; + + + client.create_full_snapshot().await?; + + ' + language: rust + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.create_full_snapshot() + + ' + language: python + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.createFullSnapshot(); + + ' + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.createFullSnapshotAsync().get();\n" + language: java + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc createFullSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tsnapshot, err := client.CreateFullSnapshot(context.Background())\n\ + \tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Snapshot created:\ + \ \", snapshot.Name)\n}\n" + language: go + /snapshots/{snapshot_name}: + get: + description: Downloads the specified snapshot of the entire storage as a file. + summary: Download a snapshot (storage) + tags: + - Snapshots + /telemetry: + get: + description: 'Collects telemetry data, such as: application info, system info, + collection info, cluster info, configs and statistics.' + summary: Collect telemetry data + tags: + - Service diff --git a/fern/apis/v0.11.1/openapi.json b/fern/apis/v0.11.1/openapi.json new file mode 100644 index 0000000..aeb83c3 --- /dev/null +++ b/fern/apis/v0.11.1/openapi.json @@ -0,0 +1,5910 @@ +{ + "paths": { + "/collections/{collection_name}": { + "get": { + "tags": [ + "collections" + ], + "summary": "Collection info", + "description": "Get detailed information about specified existing collection", + "operationId": "get_collection", + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the collection to retrieve", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "$ref": "#/components/schemas/CollectionInfo" + } + } + } + } + } + } + } + }, + "put": { + "tags": [ + "collections" + ], + "summary": "Create collection", + "description": "Create new collection with given parameters", + "operationId": "create_collection", + "requestBody": { + "description": "Parameters of a new collection", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCollection" + } + } + } + }, + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the new collection", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Wait for operation commit timeout in seconds. \nIf timeout is reached - request will return with service error.\n", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "patch": { + "tags": [ + "collections" + ], + "summary": "Update collection parameters", + "description": "Update parameters of the existing collection", + "operationId": "update_collection", + "requestBody": { + "description": "New parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateCollection" + } + } + } + }, + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the collection to update", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Wait for operation commit timeout in seconds. \nIf timeout is reached - request will return with service error.\n", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "delete": { + "tags": [ + "collections" + ], + "summary": "Delete collection", + "description": "Drop collection and all associated data", + "operationId": "delete_collection", + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the collection to delete", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Wait for operation commit timeout in seconds. \nIf timeout is reached - request will return with service error.\n", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/collections/{collection_name}/points": { + "post": { + "tags": [ + "points" + ], + "summary": "Get points", + "description": "Retrieve multiple points by specified IDs", + "operationId": "get_points", + "requestBody": { + "description": "List of points to retrieve", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PointRequest" + } + } + } + }, + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the collection to retrieve from", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Record" + } + } + } + } + } + } + } + } + }, + "put": { + "tags": [ + "points" + ], + "summary": "Upsert points", + "description": "Perform insert + updates on points. If point with given ID already exists - it will be overwritten.", + "operationId": "upsert_points", + "requestBody": { + "description": "Operation to perform on points", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PointInsertOperations" + } + } + } + }, + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the collection to update from", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "wait", + "in": "query", + "description": "If true, wait for changes to actually happen", + "required": false, + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "$ref": "#/components/schemas/UpdateResult" + } + } + } + } + } + } + } + } + }, + "/collections/{collection_name}/points/search": { + "post": { + "tags": [ + "points" + ], + "summary": "Search points", + "description": "Retrieve closest points based on vector similarity and given filtering conditions", + "operationId": "search_points", + "requestBody": { + "description": "Search request with optional filtering", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchRequest" + } + } + } + }, + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the collection to search in", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ScoredPoint" + } + } + } + } + } + } + } + } + } + }, + "/collections/{collection_name}/index": { + "put": { + "tags": [ + "collections" + ], + "summary": "Create index for field in collection", + "description": "Create index for field in collection", + "operationId": "create_field_index", + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the collection", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "wait", + "in": "query", + "description": "If true, wait for changes to actually happen", + "required": false, + "schema": { + "type": "boolean" + } + } + ], + "requestBody": { + "description": "Field name", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateFieldIndex" + } + } + } + }, + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "$ref": "#/components/schemas/UpdateResult" + } + } + } + } + } + } + } + } + }, + "/collections/{collection_name}/snapshots": { + "get": { + "tags": [ + "snapshots", + "collections" + ], + "summary": "List collection snapshots", + "description": "Get list of snapshots for a collection", + "operationId": "list_snapshots", + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the collection", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SnapshotDescription" + } + } + } + } + } + } + } + } + }, + "post": { + "tags": [ + "snapshots", + "collections" + ], + "summary": "Create collection snapshot", + "description": "Create new snapshot for a collection", + "operationId": "create_snapshot", + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the collection for which to create a snapshot", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "$ref": "#/components/schemas/SnapshotDescription" + } + } + } + } + } + } + } + } + }, + "/collections/aliases": { + "post": { + "tags": [ + "collections" + ], + "summary": "Update aliases of the collections", + "operationId": "update_aliases", + "requestBody": { + "description": "Alias update operations", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChangeAliasesOperation" + } + } + } + }, + "parameters": [ + { + "name": "timeout", + "in": "query", + "description": "Wait for operation commit timeout in seconds. \nIf timeout is reached - request will return with service error.\n", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/cluster": { + "get": { + "tags": [ + "cluster" + ], + "summary": "Get cluster status info", + "description": "Get information about the current state and composition of the cluster", + "operationId": "cluster_status", + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "$ref": "#/components/schemas/ClusterStatus" + } + } + } + } + } + } + } + } + }, + "/telemetry": { + "get": { + "summary": "Collect telemetry data", + "description": "Collect telemetry data including app info, system info, collections info, cluster info, configs and statistics", + "operationId": "telemetry", + "tags": [ + "service" + ], + "parameters": [ + { + "name": "anonymize", + "in": "query", + "description": "If true, anonymize result", + "required": false, + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TelemetryData" + } + } + } + } + } + } + } + } + } + }, + "/locks": { + "post": { + "summary": "Set lock options", + "description": "Set lock options. If write is locked, all write operations and collection creation are forbidden. Returns previous lock options", + "operationId": "post_locks", + "tags": [ + "service" + ], + "requestBody": { + "description": "Lock options and optional error message", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LocksOption" + } + } + } + }, + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "$ref": "#/components/schemas/LocksOption" + } + } + } + } + } + } + } + }, + "get": { + "summary": "Get lock options", + "description": "Get lock options. If write is locked, all write operations and collection creation are forbidden", + "operationId": "get_locks", + "tags": [ + "service" + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "$ref": "#/components/schemas/LocksOption" + } + } + } + } + } + } + } + } + }, + "/cluster/peer/{peer_id}": { + "delete": { + "tags": [ + "cluster" + ], + "summary": "Remove peer from the cluster", + "description": "Tries to remove peer from the cluster. Will return an error if peer has shards on it.", + "operationId": "remove_peer", + "parameters": [ + { + "name": "peer_id", + "in": "path", + "description": "Id of the peer", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "force", + "in": "query", + "description": "If true - removes peer even if it has shards/replicas on it.", + "schema": { + "type": "boolean", + "default": false + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/collections": { + "get": { + "tags": [ + "collections" + ], + "summary": "List collections", + "description": "Get list name of all existing collections", + "operationId": "get_collections", + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "$ref": "#/components/schemas/CollectionsResponse" + } + } + } + } + } + } + } + } + }, + "/collections/{collection_name}/index/{field_name}": { + "delete": { + "tags": [ + "collections" + ], + "summary": "Delete index for field in collection", + "description": "Delete field index for collection", + "operationId": "delete_field_index", + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the collection", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "field_name", + "in": "path", + "description": "Name of the field where to delete the index", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "wait", + "in": "query", + "description": "If true, wait for changes to actually happen", + "required": false, + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "$ref": "#/components/schemas/UpdateResult" + } + } + } + } + } + } + } + } + }, + "/collections/{collection_name}/cluster": { + "get": { + "tags": [ + "collections", + "cluster" + ], + "summary": "Collection cluster info", + "description": "Get cluster information for a collection", + "operationId": "collection_cluster_info", + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the collection to retrieve the cluster info for", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "$ref": "#/components/schemas/CollectionClusterInfo" + } + } + } + } + } + } + } + }, + "post": { + "tags": [ + "collections", + "cluster" + ], + "summary": "Update collection cluster setup", + "operationId": "update_collection_cluster", + "requestBody": { + "description": "Collection cluster update operations", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ClusterOperations" + } + } + } + }, + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the collection on which to to apply the cluster update operation", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "timeout", + "in": "query", + "description": "Wait for operation commit timeout in seconds. \nIf timeout is reached - request will return with service error.\n", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/collections/{collection_name}/snapshots/{snapshot_name}": { + "get": { + "tags": [ + "snapshots", + "collections" + ], + "summary": "Download collection snapshot", + "description": "Download specified snapshot from a collection as a file", + "operationId": "get_snapshot", + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the collection", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "snapshot_name", + "in": "path", + "description": "Name of the snapshot to download", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "Snapshot file", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "/snapshots": { + "get": { + "tags": [ + "snapshots" + ], + "summary": "List of storage snapshots", + "description": "Get list of snapshots of the whole storage", + "operationId": "list_full_snapshots", + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SnapshotDescription" + } + } + } + } + } + } + } + } + }, + "post": { + "tags": [ + "snapshots" + ], + "summary": "Create storage snapshot", + "description": "Create new snapshot of the whole storage", + "operationId": "create_full_snapshot", + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "$ref": "#/components/schemas/SnapshotDescription" + } + } + } + } + } + } + } + } + }, + "/snapshots/{snapshot_name}": { + "get": { + "tags": [ + "snapshots" + ], + "summary": "Download storage snapshot", + "description": "Download specified snapshot of the whole storage as a file", + "operationId": "get_full_snapshot", + "parameters": [ + { + "name": "snapshot_name", + "in": "path", + "description": "Name of the snapshot to download", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "Snapshot file", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "/collections/{collection_name}/points/{id}": { + "get": { + "tags": [ + "points" + ], + "summary": "Get point", + "description": "Retrieve full information of single point by id", + "operationId": "get_point", + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the collection to retrieve from", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "path", + "description": "Id of the point", + "required": true, + "schema": { + "$ref": "#/components/schemas/ExtendedPointId" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "$ref": "#/components/schemas/Record" + } + } + } + } + } + } + } + } + }, + "/collections/{collection_name}/points/delete": { + "post": { + "tags": [ + "points" + ], + "summary": "Delete points", + "description": "Delete points", + "operationId": "delete_points", + "requestBody": { + "description": "Operation to perform on points", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PointsSelector" + } + } + } + }, + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the collection to delete from", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "wait", + "in": "query", + "description": "If true, wait for changes to actually happen", + "required": false, + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "$ref": "#/components/schemas/UpdateResult" + } + } + } + } + } + } + } + } + }, + "/collections/{collection_name}/points/payload": { + "post": { + "tags": [ + "points" + ], + "summary": "Set payload", + "description": "Set payload for points", + "operationId": "set_payload", + "requestBody": { + "description": "Set payload on points", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetPayload" + } + } + } + }, + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the collection to set from", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "wait", + "in": "query", + "description": "If true, wait for changes to actually happen", + "required": false, + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "$ref": "#/components/schemas/UpdateResult" + } + } + } + } + } + } + } + } + }, + "/collections/{collection_name}/points/payload/delete": { + "post": { + "tags": [ + "points" + ], + "summary": "Delete payload", + "description": "Delete specified key payload for points", + "operationId": "delete_payload", + "requestBody": { + "description": "delete payload on points", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeletePayload" + } + } + } + }, + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the collection to delete from", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "wait", + "in": "query", + "description": "If true, wait for changes to actually happen", + "required": false, + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "$ref": "#/components/schemas/UpdateResult" + } + } + } + } + } + } + } + } + }, + "/collections/{collection_name}/points/payload/clear": { + "post": { + "tags": [ + "points" + ], + "summary": "Clear payload", + "description": "Remove all payload for specified points", + "operationId": "clear_payload", + "requestBody": { + "description": "clear payload on points", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PointsSelector" + } + } + } + }, + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the collection to clear payload from", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "wait", + "in": "query", + "description": "If true, wait for changes to actually happen", + "required": false, + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "$ref": "#/components/schemas/UpdateResult" + } + } + } + } + } + } + } + } + }, + "/collections/{collection_name}/points/scroll": { + "post": { + "tags": [ + "points" + ], + "summary": "Scroll points", + "description": "Scroll request - paginate over all points which matches given filtering condition", + "operationId": "scroll_points", + "requestBody": { + "description": "Pagination and filter parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScrollRequest" + } + } + } + }, + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the collection to retrieve from", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "$ref": "#/components/schemas/ScrollResult" + } + } + } + } + } + } + } + } + }, + "/collections/{collection_name}/points/search/batch": { + "post": { + "tags": [ + "points" + ], + "summary": "Search batch points", + "description": "Retrieve by batch the closest points based on vector similarity and given filtering conditions", + "operationId": "search_batch_points", + "requestBody": { + "description": "Search batch request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchRequestBatch" + } + } + } + }, + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the collection to search in", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ScoredPoint" + } + } + } + } + } + } + } + } + } + } + }, + "/collections/{collection_name}/points/recommend": { + "post": { + "tags": [ + "points" + ], + "summary": "Recommend points", + "description": "Look for the points which are closer to stored positive examples and at the same time further to negative examples.", + "operationId": "recommend_points", + "requestBody": { + "description": "Request points based on positive and negative examples.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RecommendRequest" + } + } + } + }, + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the collection to search in", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ScoredPoint" + } + } + } + } + } + } + } + } + } + }, + "/collections/{collection_name}/points/recommend/batch": { + "post": { + "tags": [ + "points" + ], + "summary": "Recommend batch points", + "description": "Look for the points which are closer to stored positive examples and at the same time further to negative examples.", + "operationId": "recommend_batch_points", + "requestBody": { + "description": "Request points based on positive and negative examples.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RecommendRequestBatch" + } + } + } + }, + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the collection to search in", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ScoredPoint" + } + } + } + } + } + } + } + } + } + } + }, + "/collections/{collection_name}/points/count": { + "post": { + "tags": [ + "points" + ], + "summary": "Count points", + "description": "Count points which matches given filtering condition", + "operationId": "count_points", + "requestBody": { + "description": "Request counts of points which matches given filtering condition", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CountRequest" + } + } + } + }, + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the collection to count in", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "default": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "4XX": { + "description": "error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "string", + "enum": [ + "ok" + ] + }, + "result": { + "$ref": "#/components/schemas/CountResult" + } + } + } + } + } + } + } + } + } + }, + "openapi": "3.0.1", + "security": [], + "info": { + "title": "Qdrant API", + "description": "API description for Qdrant vector search engine.\n\nThis document describes CRUD and search operations on collections of points (vectors with payload).\n\nQdrant supports any combinations of `should`, `must` and `must_not` conditions, which makes it possible to use in applications when object could not be described solely by vector. It could be location features, availability flags, and other custom properties businesses should take into account.\n## Examples\nThis examples cover the most basic use-cases - collection creation and basic vector search.\n### Create collection\nFirst - let's create a collection with dot-production metric.\n```\ncurl -X PUT 'http://localhost:6333/collections/test_collection' \\\n -H 'Content-Type: application/json' \\\n --data-raw '{\n \"vectors\": {\n \"size\": 4,\n \"distance\": \"Dot\"\n }\n }'\n\n```\nExpected response:\n```\n{\n \"result\": true,\n \"status\": \"ok\",\n \"time\": 0.031095451\n}\n```\nWe can ensure that collection was created:\n```\ncurl 'http://localhost:6333/collections/test_collection'\n```\nExpected response:\n```\n{\n \"result\": {\n \"status\": \"green\",\n \"vectors_count\": 0,\n \"segments_count\": 5,\n \"disk_data_size\": 0,\n \"ram_data_size\": 0,\n \"config\": {\n \"params\": {\n \"vectors\": {\n \"size\": 4,\n \"distance\": \"Dot\"\n }\n },\n \"hnsw_config\": {\n \"m\": 16,\n \"ef_construct\": 100,\n \"full_scan_threshold\": 10000\n },\n \"optimizer_config\": {\n \"deleted_threshold\": 0.2,\n \"vacuum_min_vector_number\": 1000,\n \"max_segment_number\": 5,\n \"memmap_threshold\": 50000,\n \"indexing_threshold\": 20000,\n \"flush_interval_sec\": 1\n },\n \"wal_config\": {\n \"wal_capacity_mb\": 32,\n \"wal_segments_ahead\": 0\n }\n }\n },\n \"status\": \"ok\",\n \"time\": 2.1199e-05\n}\n```\n\n### Add points\nLet's now add vectors with some payload:\n```\ncurl -L -X PUT 'http://localhost:6333/collections/test_collection/points?wait=true' \\ -H 'Content-Type: application/json' \\ --data-raw '{\n \"points\": [\n {\"id\": 1, \"vector\": [0.05, 0.61, 0.76, 0.74], \"payload\": {\"city\": \"Berlin\"}},\n {\"id\": 2, \"vector\": [0.19, 0.81, 0.75, 0.11], \"payload\": {\"city\": [\"Berlin\", \"London\"] }},\n {\"id\": 3, \"vector\": [0.36, 0.55, 0.47, 0.94], \"payload\": {\"city\": [\"Berlin\", \"Moscow\"] }},\n {\"id\": 4, \"vector\": [0.18, 0.01, 0.85, 0.80], \"payload\": {\"city\": [\"London\", \"Moscow\"] }},\n {\"id\": 5, \"vector\": [0.24, 0.18, 0.22, 0.44], \"payload\": {\"count\": [0]}},\n {\"id\": 6, \"vector\": [0.35, 0.08, 0.11, 0.44]}\n ]\n}'\n```\nExpected response:\n```\n{\n \"result\": {\n \"operation_id\": 0,\n \"status\": \"completed\"\n },\n \"status\": \"ok\",\n \"time\": 0.000206061\n}\n```\n### Search with filtering\nLet's start with a basic request:\n```\ncurl -L -X POST 'http://localhost:6333/collections/test_collection/points/search' \\ -H 'Content-Type: application/json' \\ --data-raw '{\n \"vector\": [0.2,0.1,0.9,0.7],\n \"top\": 3\n}'\n```\nExpected response:\n```\n{\n \"result\": [\n { \"id\": 4, \"score\": 1.362, \"payload\": null, \"version\": 0 },\n { \"id\": 1, \"score\": 1.273, \"payload\": null, \"version\": 0 },\n { \"id\": 3, \"score\": 1.208, \"payload\": null, \"version\": 0 }\n ],\n \"status\": \"ok\",\n \"time\": 0.000055785\n}\n```\nBut result is different if we add a filter:\n```\ncurl -L -X POST 'http://localhost:6333/collections/test_collection/points/search' \\ -H 'Content-Type: application/json' \\ --data-raw '{\n \"filter\": {\n \"should\": [\n {\n \"key\": \"city\",\n \"match\": {\n \"value\": \"London\"\n }\n }\n ]\n },\n \"vector\": [0.2, 0.1, 0.9, 0.7],\n \"top\": 3\n}'\n```\nExpected response:\n```\n{\n \"result\": [\n { \"id\": 4, \"score\": 1.362, \"payload\": null, \"version\": 0 },\n { \"id\": 2, \"score\": 0.871, \"payload\": null, \"version\": 0 }\n ],\n \"status\": \"ok\",\n \"time\": 0.000093972\n}\n```\n", + "contact": { + "email": "andrey@vasnetsov.com" + }, + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + }, + "version": "0.11.1" + }, + "externalDocs": { + "description": "Find out more about Qdrant applications and demo", + "url": "https://qdrant.tech/documentation/" + }, + "servers": [ + { + "url": "{protocol}://{hostname}:{port}", + "variables": { + "protocol": { + "enum": [ + "http", + "https" + ], + "default": "http" + }, + "hostname": { + "default": "localhost" + }, + "port": { + "default": "6333" + } + } + } + ], + "tags": [ + { + "name": "collections", + "description": "Searchable collections of points." + }, + { + "name": "points", + "description": "Float-point vectors with payload." + }, + { + "name": "cluster", + "description": "Service distributed setup" + }, + { + "name": "snapshots", + "description": "Storage and collections snapshots" + } + ], + "components": { + "schemas": { + "ErrorResponse": { + "type": "object", + "properties": { + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request" + }, + "status": { + "type": "object", + "properties": { + "error": { + "type": "string", + "description": "Description of the occurred error." + } + } + }, + "result": { + "type": "object", + "nullable": true + } + } + }, + "CollectionsResponse": { + "type": "object", + "required": [ + "collections" + ], + "properties": { + "collections": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CollectionDescription" + } + } + } + }, + "CollectionDescription": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + }, + "CollectionInfo": { + "description": "Current statistics and configuration of the collection", + "type": "object", + "required": [ + "config", + "indexed_vectors_count", + "optimizer_status", + "payload_schema", + "points_count", + "segments_count", + "status", + "vectors_count" + ], + "properties": { + "status": { + "$ref": "#/components/schemas/CollectionStatus" + }, + "optimizer_status": { + "$ref": "#/components/schemas/OptimizersStatus" + }, + "vectors_count": { + "description": "Number of vectors in collection All vectors in collection are available for querying Calculated as `points_count x vectors_per_point` Where `vectors_per_point` is a number of named vectors in schema", + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "indexed_vectors_count": { + "description": "Number of indexed vectors in the collection. Indexed vectors in large segments are faster to query, as it is stored in vector index (HNSW)", + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "points_count": { + "description": "Number of points (vectors + payloads) in collection Each point could be accessed by unique id", + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "segments_count": { + "description": "Number of segments in collection. Each segment has independent vector as payload indexes", + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "config": { + "$ref": "#/components/schemas/CollectionConfig" + }, + "payload_schema": { + "description": "Types of stored payload", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/PayloadIndexInfo" + } + } + } + }, + "CollectionStatus": { + "description": "Current state of the collection. `Green` - all good. `Yellow` - optimization is running, `Red` - some operations failed and was not recovered", + "type": "string", + "enum": [ + "green", + "yellow", + "red" + ] + }, + "OptimizersStatus": { + "description": "Current state of the collection", + "oneOf": [ + { + "description": "Optimizers are reporting as expected", + "type": "string", + "enum": [ + "ok" + ] + }, + { + "description": "Something wrong happened with optimizers", + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "CollectionConfig": { + "type": "object", + "required": [ + "hnsw_config", + "optimizer_config", + "params", + "wal_config" + ], + "properties": { + "params": { + "$ref": "#/components/schemas/CollectionParams" + }, + "hnsw_config": { + "$ref": "#/components/schemas/HnswConfig" + }, + "optimizer_config": { + "$ref": "#/components/schemas/OptimizersConfig" + }, + "wal_config": { + "$ref": "#/components/schemas/WalConfig" + } + } + }, + "CollectionParams": { + "type": "object", + "required": [ + "vectors" + ], + "properties": { + "vectors": { + "$ref": "#/components/schemas/VectorsConfig" + }, + "shard_number": { + "description": "Number of shards the collection has", + "default": 1, + "type": "integer", + "format": "uint32", + "minimum": 1 + }, + "replication_factor": { + "description": "Number of replicas for each shard", + "default": 1, + "type": "integer", + "format": "uint32", + "minimum": 1 + }, + "write_consistency_factor": { + "description": "Defines how many replicas should apply the operation for us to consider it successful. Increasing this number will make the collection more resilient to inconsistencies, but will also make it fail if not enough replicas are available. Does not have any performance impact.", + "default": 1, + "type": "integer", + "format": "uint32", + "minimum": 1 + }, + "on_disk_payload": { + "description": "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.", + "default": false, + "type": "boolean" + } + } + }, + "VectorsConfig": { + "description": "Vector params separator for single and multiple vector modes Single mode:\n\n{ \"size\": 128, \"distance\": \"Cosine\" }\n\nor multiple mode:\n\n{ \"default\": { \"size\": 128, \"distance\": \"Cosine\" } }", + "anyOf": [ + { + "$ref": "#/components/schemas/VectorParams" + }, + { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/VectorParams" + } + } + ] + }, + "VectorParams": { + "description": "Params of single vector data storage", + "type": "object", + "required": [ + "distance", + "size" + ], + "properties": { + "size": { + "description": "Size of a vectors used", + "type": "integer", + "format": "uint64", + "minimum": 1 + }, + "distance": { + "$ref": "#/components/schemas/Distance" + } + } + }, + "Distance": { + "description": "Type of internal tags, build from payload Distance function types used to compare vectors", + "type": "string", + "enum": [ + "Cosine", + "Euclid", + "Dot" + ] + }, + "HnswConfig": { + "description": "Config of HNSW index", + "type": "object", + "required": [ + "ef_construct", + "full_scan_threshold", + "m" + ], + "properties": { + "m": { + "description": "Number of edges per node in the index graph. Larger the value - more accurate the search, more space required.", + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "ef_construct": { + "description": "Number of neighbours to consider during the index building. Larger the value - more accurate the search, more time required to build index.", + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "full_scan_threshold": { + "description": "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", + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "max_indexing_threads": { + "description": "Number of parallel threads used for background index building. If 0 - auto selection.", + "default": 0, + "type": "integer", + "format": "uint", + "minimum": 0 + } + } + }, + "OptimizersConfig": { + "type": "object", + "required": [ + "default_segment_number", + "deleted_threshold", + "flush_interval_sec", + "indexing_threshold", + "max_optimization_threads", + "vacuum_min_vector_number" + ], + "properties": { + "deleted_threshold": { + "description": "The minimal fraction of deleted vectors in a segment, required to perform segment optimization", + "type": "number", + "format": "double" + }, + "vacuum_min_vector_number": { + "description": "The minimal number of vectors in a segment, required to perform segment optimization", + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "default_segment_number": { + "description": "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\n\nIt 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", + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "max_segment_size": { + "description": "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.\n\nIf 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 If not set, will be automatically selected considering the number of available CPUs.", + "default": null, + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + }, + "memmap_threshold": { + "description": "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. To enable memmap storage, lower the threshold Note: 1Kb = 1 vector of size 256 If not set, mmap will not be used.", + "default": null, + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + }, + "indexing_threshold": { + "description": "Maximum size (in KiloBytes) of vectors allowed for plain index. Default value based on Note: 1Kb = 1 vector of size 256", + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "flush_interval_sec": { + "description": "Minimum interval between forced flushes.", + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "max_optimization_threads": { + "description": "Maximum available threads for optimization workers", + "type": "integer", + "format": "uint", + "minimum": 0 + } + } + }, + "WalConfig": { + "type": "object", + "required": [ + "wal_capacity_mb", + "wal_segments_ahead" + ], + "properties": { + "wal_capacity_mb": { + "description": "Size of a single WAL segment in MB", + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "wal_segments_ahead": { + "description": "Number of WAL segments to create ahead of actually used ones", + "type": "integer", + "format": "uint", + "minimum": 0 + } + } + }, + "PayloadIndexInfo": { + "description": "Display payload field type & index information", + "type": "object", + "required": [ + "data_type", + "points" + ], + "properties": { + "data_type": { + "$ref": "#/components/schemas/PayloadSchemaType" + }, + "params": { + "anyOf": [ + { + "$ref": "#/components/schemas/PayloadSchemaParams" + }, + { + "nullable": true + } + ] + }, + "points": { + "description": "Number of points indexed with this index", + "type": "integer", + "format": "uint", + "minimum": 0 + } + } + }, + "PayloadSchemaType": { + "description": "All possible names of payload types", + "type": "string", + "enum": [ + "keyword", + "integer", + "float", + "geo", + "text" + ] + }, + "PayloadSchemaParams": { + "description": "Payload type with parameters", + "anyOf": [ + { + "$ref": "#/components/schemas/TextIndexParams" + } + ] + }, + "TextIndexParams": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/TextIndexType" + }, + "tokenizer": { + "$ref": "#/components/schemas/TokenizerType" + }, + "min_token_len": { + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + }, + "max_token_len": { + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + }, + "lowercase": { + "description": "If true, lowercase all tokens. Default: true", + "type": "boolean", + "nullable": true + } + } + }, + "TextIndexType": { + "type": "string", + "enum": [ + "text" + ] + }, + "TokenizerType": { + "type": "string", + "enum": [ + "prefix", + "whitespace", + "word" + ] + }, + "PointRequest": { + "type": "object", + "required": [ + "ids" + ], + "properties": { + "ids": { + "description": "Look for points with ids", + "type": "array", + "items": { + "$ref": "#/components/schemas/ExtendedPointId" + } + }, + "with_payload": { + "description": "Select which payload to return with the response. Default: All", + "anyOf": [ + { + "$ref": "#/components/schemas/WithPayloadInterface" + }, + { + "nullable": true + } + ] + }, + "with_vector": { + "$ref": "#/components/schemas/WithVector" + } + } + }, + "ExtendedPointId": { + "description": "Type, used for specifying point ID in user interface", + "anyOf": [ + { + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + { + "type": "string", + "format": "uuid" + } + ] + }, + "WithPayloadInterface": { + "description": "Options for specifying which payload to include or not", + "anyOf": [ + { + "description": "If `true` - return all payload, If `false` - do not return payload", + "type": "boolean" + }, + { + "description": "Specify which fields to return", + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "#/components/schemas/PayloadSelector" + } + ] + }, + "PayloadSelector": { + "description": "Specifies how to treat payload selector", + "anyOf": [ + { + "$ref": "#/components/schemas/PayloadSelectorInclude" + }, + { + "$ref": "#/components/schemas/PayloadSelectorExclude" + } + ] + }, + "PayloadSelectorInclude": { + "type": "object", + "required": [ + "include" + ], + "properties": { + "include": { + "description": "Only include this payload keys", + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "PayloadSelectorExclude": { + "type": "object", + "required": [ + "exclude" + ], + "properties": { + "exclude": { + "description": "Exclude this fields from returning payload", + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "WithVector": { + "description": "Options for specifying which vector to include", + "anyOf": [ + { + "description": "If `true` - return all vector, If `false` - do not return vector", + "type": "boolean" + }, + { + "description": "Specify which vector to return", + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "Record": { + "description": "Point data", + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "$ref": "#/components/schemas/ExtendedPointId" + }, + "payload": { + "description": "Payload - values assigned to the point", + "anyOf": [ + { + "$ref": "#/components/schemas/Payload" + }, + { + "nullable": true + } + ] + }, + "vector": { + "description": "Vector of the point", + "anyOf": [ + { + "$ref": "#/components/schemas/VectorStruct" + }, + { + "nullable": true + } + ] + } + } + }, + "Payload": { + "type": "object", + "additionalProperties": true + }, + "VectorStruct": { + "description": "Full vector data per point separator with single and multiple vector modes", + "anyOf": [ + { + "type": "array", + "items": { + "type": "number", + "format": "float" + } + }, + { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "number", + "format": "float" + } + } + } + ] + }, + "SearchRequest": { + "description": "Search request. Holds all conditions and parameters for the search of most similar points by vector similarity given the filtering restrictions.", + "type": "object", + "required": [ + "limit", + "vector" + ], + "properties": { + "vector": { + "$ref": "#/components/schemas/NamedVectorStruct" + }, + "filter": { + "description": "Look only for points which satisfies this conditions", + "anyOf": [ + { + "$ref": "#/components/schemas/Filter" + }, + { + "nullable": true + } + ] + }, + "params": { + "description": "Additional search params", + "anyOf": [ + { + "$ref": "#/components/schemas/SearchParams" + }, + { + "nullable": true + } + ] + }, + "limit": { + "description": "Max number of result to return", + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "offset": { + "description": "Offset of the first result to return. May be used to paginate results. Note: large offset values may cause performance issues.", + "default": 0, + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "with_payload": { + "description": "Select which payload to return with the response. Default: None", + "anyOf": [ + { + "$ref": "#/components/schemas/WithPayloadInterface" + }, + { + "nullable": true + } + ] + }, + "with_vector": { + "description": "Whether to return the point vector with the result?", + "default": null, + "anyOf": [ + { + "$ref": "#/components/schemas/WithVector" + }, + { + "nullable": true + } + ] + }, + "score_threshold": { + "description": "Define a minimal score threshold for the result. If defined, less similar results will not be returned. Score of the returned result might be higher or smaller than the threshold depending on the Distance function used. E.g. for cosine similarity only higher scores will be returned.", + "type": "number", + "format": "float", + "nullable": true + } + } + }, + "NamedVectorStruct": { + "description": "Vector data separator for named and unnamed modes Unanmed mode:\n\n{ \"vector\": [1.0, 2.0, 3.0] }\n\nor named mode:\n\n{ \"vector\": { \"vector\": [1.0, 2.0, 3.0], \"name\": \"image-embeddings\" } }", + "anyOf": [ + { + "type": "array", + "items": { + "type": "number", + "format": "float" + } + }, + { + "$ref": "#/components/schemas/NamedVector" + } + ] + }, + "NamedVector": { + "description": "Vector data with name", + "type": "object", + "required": [ + "name", + "vector" + ], + "properties": { + "name": { + "description": "Name of vector data", + "type": "string" + }, + "vector": { + "description": "Vector data", + "type": "array", + "items": { + "type": "number", + "format": "float" + } + } + } + }, + "Filter": { + "type": "object", + "properties": { + "should": { + "description": "At least one of those conditions should match", + "type": "array", + "items": { + "$ref": "#/components/schemas/Condition" + }, + "nullable": true + }, + "must": { + "description": "All conditions must match", + "type": "array", + "items": { + "$ref": "#/components/schemas/Condition" + }, + "nullable": true + }, + "must_not": { + "description": "All conditions must NOT match", + "type": "array", + "items": { + "$ref": "#/components/schemas/Condition" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "Condition": { + "anyOf": [ + { + "$ref": "#/components/schemas/FieldCondition" + }, + { + "$ref": "#/components/schemas/IsEmptyCondition" + }, + { + "$ref": "#/components/schemas/HasIdCondition" + }, + { + "$ref": "#/components/schemas/Filter" + } + ] + }, + "FieldCondition": { + "description": "All possible payload filtering conditions", + "type": "object", + "required": [ + "key" + ], + "properties": { + "key": { + "description": "Payload key", + "type": "string" + }, + "match": { + "description": "Check if point has field with a given value", + "anyOf": [ + { + "$ref": "#/components/schemas/Match" + }, + { + "nullable": true + } + ] + }, + "range": { + "description": "Check if points value lies in a given range", + "anyOf": [ + { + "$ref": "#/components/schemas/Range" + }, + { + "nullable": true + } + ] + }, + "geo_bounding_box": { + "description": "Check if points geo location lies in a given area", + "anyOf": [ + { + "$ref": "#/components/schemas/GeoBoundingBox" + }, + { + "nullable": true + } + ] + }, + "geo_radius": { + "description": "Check if geo point is within a given radius", + "anyOf": [ + { + "$ref": "#/components/schemas/GeoRadius" + }, + { + "nullable": true + } + ] + }, + "values_count": { + "description": "Check number of values of the field", + "anyOf": [ + { + "$ref": "#/components/schemas/ValuesCount" + }, + { + "nullable": true + } + ] + } + } + }, + "Match": { + "description": "Match filter request", + "anyOf": [ + { + "$ref": "#/components/schemas/MatchValue" + }, + { + "$ref": "#/components/schemas/MatchText" + } + ] + }, + "MatchValue": { + "description": "Exact match of the given value", + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "$ref": "#/components/schemas/ValueVariants" + } + } + }, + "ValueVariants": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer", + "format": "int64" + }, + { + "type": "boolean" + } + ] + }, + "MatchText": { + "description": "Full-text match of the strings.", + "type": "object", + "required": [ + "text" + ], + "properties": { + "text": { + "type": "string" + } + } + }, + "Range": { + "description": "Range filter request", + "type": "object", + "properties": { + "lt": { + "description": "point.key < range.lt", + "type": "number", + "format": "double", + "nullable": true + }, + "gt": { + "description": "point.key > range.gt", + "type": "number", + "format": "double", + "nullable": true + }, + "gte": { + "description": "point.key >= range.gte", + "type": "number", + "format": "double", + "nullable": true + }, + "lte": { + "description": "point.key <= range.lte", + "type": "number", + "format": "double", + "nullable": true + } + } + }, + "GeoBoundingBox": { + "description": "Geo filter request\n\nMatches coordinates inside the rectangle, described by coordinates of lop-left and bottom-right edges", + "type": "object", + "required": [ + "bottom_right", + "top_left" + ], + "properties": { + "top_left": { + "$ref": "#/components/schemas/GeoPoint" + }, + "bottom_right": { + "$ref": "#/components/schemas/GeoPoint" + } + } + }, + "GeoPoint": { + "description": "Geo point payload schema", + "type": "object", + "required": [ + "lat", + "lon" + ], + "properties": { + "lon": { + "type": "number", + "format": "double" + }, + "lat": { + "type": "number", + "format": "double" + } + } + }, + "GeoRadius": { + "description": "Geo filter request\n\nMatches coordinates inside the circle of `radius` and center with coordinates `center`", + "type": "object", + "required": [ + "center", + "radius" + ], + "properties": { + "center": { + "$ref": "#/components/schemas/GeoPoint" + }, + "radius": { + "description": "Radius of the area in meters", + "type": "number", + "format": "double" + } + } + }, + "ValuesCount": { + "description": "Values count filter request", + "type": "object", + "properties": { + "lt": { + "description": "point.key.length() < values_count.lt", + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + }, + "gt": { + "description": "point.key.length() > values_count.gt", + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + }, + "gte": { + "description": "point.key.length() >= values_count.gte", + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + }, + "lte": { + "description": "point.key.length() <= values_count.lte", + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + } + } + }, + "IsEmptyCondition": { + "description": "Select points with empty payload for a specified field", + "type": "object", + "required": [ + "is_empty" + ], + "properties": { + "is_empty": { + "$ref": "#/components/schemas/PayloadField" + } + } + }, + "PayloadField": { + "description": "Payload field", + "type": "object", + "required": [ + "key" + ], + "properties": { + "key": { + "description": "Payload field name", + "type": "string" + } + } + }, + "HasIdCondition": { + "description": "ID-based filtering condition", + "type": "object", + "required": [ + "has_id" + ], + "properties": { + "has_id": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExtendedPointId" + }, + "uniqueItems": true + } + } + }, + "SearchParams": { + "description": "Additional parameters of the search", + "type": "object", + "properties": { + "hnsw_ef": { + "description": "Params relevant to HNSW index /// Size of the beam in a beam-search. Larger the value - more accurate the result, more time required for search.", + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + }, + "exact": { + "description": "Search without approximation. If set to true, search may run long but with exact results.", + "default": false, + "type": "boolean" + } + } + }, + "ScoredPoint": { + "description": "Search result", + "type": "object", + "required": [ + "id", + "score", + "version" + ], + "properties": { + "id": { + "$ref": "#/components/schemas/ExtendedPointId" + }, + "version": { + "description": "Point version", + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "score": { + "description": "Points vector distance to the query vector", + "type": "number", + "format": "float" + }, + "payload": { + "description": "Payload - values assigned to the point", + "anyOf": [ + { + "$ref": "#/components/schemas/Payload" + }, + { + "nullable": true + } + ] + }, + "vector": { + "description": "Vector of the point", + "anyOf": [ + { + "$ref": "#/components/schemas/VectorStruct" + }, + { + "nullable": true + } + ] + } + } + }, + "UpdateResult": { + "type": "object", + "required": [ + "operation_id", + "status" + ], + "properties": { + "operation_id": { + "description": "Sequential number of the operation", + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "status": { + "$ref": "#/components/schemas/UpdateStatus" + } + } + }, + "UpdateStatus": { + "description": "`Acknowledged` - Request is saved to WAL and will be process in a queue. `Completed` - Request is completed, changes are actual.", + "type": "string", + "enum": [ + "acknowledged", + "completed" + ] + }, + "RecommendRequest": { + "description": "Recommendation request. Provides positive and negative examples of the vectors, which are already stored in the collection.\n\nService should look for the points which are closer to positive examples and at the same time further to negative examples. The concrete way of how to compare negative and positive distances is up to implementation in `segment` crate.", + "type": "object", + "required": [ + "limit", + "negative", + "positive" + ], + "properties": { + "positive": { + "description": "Look for vectors closest to those", + "type": "array", + "items": { + "$ref": "#/components/schemas/ExtendedPointId" + } + }, + "negative": { + "description": "Try to avoid vectors like this", + "type": "array", + "items": { + "$ref": "#/components/schemas/ExtendedPointId" + } + }, + "filter": { + "description": "Look only for points which satisfies this conditions", + "anyOf": [ + { + "$ref": "#/components/schemas/Filter" + }, + { + "nullable": true + } + ] + }, + "params": { + "description": "Additional search params", + "anyOf": [ + { + "$ref": "#/components/schemas/SearchParams" + }, + { + "nullable": true + } + ] + }, + "limit": { + "description": "Max number of result to return", + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "offset": { + "description": "Offset of the first result to return. May be used to paginate results. Note: large offset values may cause performance issues.", + "default": 0, + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "with_payload": { + "description": "Select which payload to return with the response. Default: None", + "anyOf": [ + { + "$ref": "#/components/schemas/WithPayloadInterface" + }, + { + "nullable": true + } + ] + }, + "with_vector": { + "description": "Whether to return the point vector with the result?", + "default": null, + "anyOf": [ + { + "$ref": "#/components/schemas/WithVector" + }, + { + "nullable": true + } + ] + }, + "score_threshold": { + "description": "Define a minimal score threshold for the result. If defined, less similar results will not be returned. Score of the returned result might be higher or smaller than the threshold depending on the Distance function used. E.g. for cosine similarity only higher scores will be returned.", + "type": "number", + "format": "float", + "nullable": true + }, + "using": { + "description": "Define which vector to use for recommendation, if not specified - try to use default vector", + "default": null, + "anyOf": [ + { + "$ref": "#/components/schemas/UsingVector" + }, + { + "nullable": true + } + ] + } + } + }, + "UsingVector": { + "anyOf": [ + { + "type": "string" + } + ] + }, + "ScrollRequest": { + "description": "Scroll request - paginate over all points which matches given condition", + "type": "object", + "properties": { + "offset": { + "description": "Start ID to read points from.", + "anyOf": [ + { + "$ref": "#/components/schemas/ExtendedPointId" + }, + { + "nullable": true + } + ] + }, + "limit": { + "description": "Page size. Default: 10", + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + }, + "filter": { + "description": "Look only for points which satisfies this conditions. If not provided - all points.", + "anyOf": [ + { + "$ref": "#/components/schemas/Filter" + }, + { + "nullable": true + } + ] + }, + "with_payload": { + "description": "Select which payload to return with the response. Default: All", + "anyOf": [ + { + "$ref": "#/components/schemas/WithPayloadInterface" + }, + { + "nullable": true + } + ] + }, + "with_vector": { + "$ref": "#/components/schemas/WithVector" + } + } + }, + "ScrollResult": { + "description": "Result of the points read request", + "type": "object", + "required": [ + "points" + ], + "properties": { + "points": { + "description": "List of retrieved points", + "type": "array", + "items": { + "$ref": "#/components/schemas/Record" + } + }, + "next_page_offset": { + "description": "Offset which should be used to retrieve a next page result", + "anyOf": [ + { + "$ref": "#/components/schemas/ExtendedPointId" + }, + { + "nullable": true + } + ] + } + } + }, + "CreateCollection": { + "description": "Operation for creating new collection and (optionally) specify index params", + "type": "object", + "required": [ + "vectors" + ], + "properties": { + "vectors": { + "$ref": "#/components/schemas/VectorsConfig" + }, + "shard_number": { + "description": "Number of shards in collection. Default is 1 for standalone, otherwise equal to the number of nodes Minimum is 1", + "default": null, + "type": "integer", + "format": "uint32", + "minimum": 0, + "nullable": true + }, + "replication_factor": { + "description": "Number of shards replicas. Default is 1 Minimum is 1", + "default": null, + "type": "integer", + "format": "uint32", + "minimum": 0, + "nullable": true + }, + "write_consistency_factor": { + "description": "Defines how many replicas should apply the operation for us to consider it successful. Increasing this number will make the collection more resilient to inconsistencies, but will also make it fail if not enough replicas are available. Does not have any performance impact.", + "default": null, + "type": "integer", + "format": "uint32", + "minimum": 0, + "nullable": true + }, + "on_disk_payload": { + "description": "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.", + "default": null, + "type": "boolean", + "nullable": true + }, + "hnsw_config": { + "description": "Custom params for HNSW index. If none - values from service configuration file are used.", + "anyOf": [ + { + "$ref": "#/components/schemas/HnswConfigDiff" + }, + { + "nullable": true + } + ] + }, + "wal_config": { + "description": "Custom params for WAL. If none - values from service configuration file are used.", + "anyOf": [ + { + "$ref": "#/components/schemas/WalConfigDiff" + }, + { + "nullable": true + } + ] + }, + "optimizers_config": { + "description": "Custom params for Optimizers. If none - values from service configuration file are used.", + "anyOf": [ + { + "$ref": "#/components/schemas/OptimizersConfigDiff" + }, + { + "nullable": true + } + ] + } + } + }, + "HnswConfigDiff": { + "type": "object", + "properties": { + "m": { + "description": "Number of edges per node in the index graph. Larger the value - more accurate the search, more space required.", + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + }, + "ef_construct": { + "description": "Number of neighbours to consider during the index building. Larger the value - more accurate the search, more time required to build index.", + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + }, + "full_scan_threshold": { + "description": "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", + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + } + } + }, + "WalConfigDiff": { + "type": "object", + "properties": { + "wal_capacity_mb": { + "description": "Size of a single WAL segment in MB", + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + }, + "wal_segments_ahead": { + "description": "Number of WAL segments to create ahead of actually used ones", + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + } + } + }, + "OptimizersConfigDiff": { + "type": "object", + "properties": { + "deleted_threshold": { + "description": "The minimal fraction of deleted vectors in a segment, required to perform segment optimization", + "type": "number", + "format": "double", + "nullable": true + }, + "vacuum_min_vector_number": { + "description": "The minimal number of vectors in a segment, required to perform segment optimization", + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + }, + "default_segment_number": { + "description": "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\n\nIt 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", + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + }, + "max_segment_size": { + "description": "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.\n\nIf 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", + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + }, + "memmap_threshold": { + "description": "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. To enable memmap storage, lower the threshold Note: 1Kb = 1 vector of size 256", + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + }, + "indexing_threshold": { + "description": "Maximum size (in KiloBytes) of vectors allowed for plain index. Default value based on Note: 1Kb = 1 vector of size 256", + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + }, + "flush_interval_sec": { + "description": "Minimum interval between forced flushes.", + "type": "integer", + "format": "uint64", + "minimum": 0, + "nullable": true + }, + "max_optimization_threads": { + "description": "Maximum available threads for optimization workers", + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + } + } + }, + "UpdateCollection": { + "description": "Operation for updating parameters of the existing collection", + "type": "object", + "properties": { + "optimizers_config": { + "description": "Custom params for Optimizers. If none - values from service configuration file are used. This operation is blocking, it will only proceed ones all current optimizations are complete", + "anyOf": [ + { + "$ref": "#/components/schemas/OptimizersConfigDiff" + }, + { + "nullable": true + } + ] + }, + "params": { + "description": "Collection base params. If none - values from service configuration file are used.", + "anyOf": [ + { + "$ref": "#/components/schemas/CollectionParamsDiff" + }, + { + "nullable": true + } + ] + } + } + }, + "CollectionParamsDiff": { + "type": "object", + "properties": { + "replication_factor": { + "description": "Number of replicas for each shard", + "type": "integer", + "format": "uint32", + "minimum": 1, + "nullable": true + }, + "write_consistency_factor": { + "description": "Minimal number successful responses from replicas to consider operation successful", + "type": "integer", + "format": "uint32", + "minimum": 1, + "nullable": true + } + } + }, + "ChangeAliasesOperation": { + "description": "Operation for performing changes of collection aliases. Alias changes are atomic, meaning that no collection modifications can happen between alias operations.", + "type": "object", + "required": [ + "actions" + ], + "properties": { + "actions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AliasOperations" + } + } + } + }, + "AliasOperations": { + "description": "Group of all the possible operations related to collection aliases", + "anyOf": [ + { + "$ref": "#/components/schemas/CreateAliasOperation" + }, + { + "$ref": "#/components/schemas/DeleteAliasOperation" + }, + { + "$ref": "#/components/schemas/RenameAliasOperation" + } + ] + }, + "CreateAliasOperation": { + "type": "object", + "required": [ + "create_alias" + ], + "properties": { + "create_alias": { + "$ref": "#/components/schemas/CreateAlias" + } + } + }, + "CreateAlias": { + "description": "Create alternative name for a collection. Collection will be available under both names for search, retrieve,", + "type": "object", + "required": [ + "alias_name", + "collection_name" + ], + "properties": { + "collection_name": { + "type": "string" + }, + "alias_name": { + "type": "string" + } + } + }, + "DeleteAliasOperation": { + "description": "Delete alias if exists", + "type": "object", + "required": [ + "delete_alias" + ], + "properties": { + "delete_alias": { + "$ref": "#/components/schemas/DeleteAlias" + } + } + }, + "DeleteAlias": { + "description": "Delete alias if exists", + "type": "object", + "required": [ + "alias_name" + ], + "properties": { + "alias_name": { + "type": "string" + } + } + }, + "RenameAliasOperation": { + "description": "Change alias to a new one", + "type": "object", + "required": [ + "rename_alias" + ], + "properties": { + "rename_alias": { + "$ref": "#/components/schemas/RenameAlias" + } + } + }, + "RenameAlias": { + "description": "Change alias to a new one", + "type": "object", + "required": [ + "new_alias_name", + "old_alias_name" + ], + "properties": { + "old_alias_name": { + "type": "string" + }, + "new_alias_name": { + "type": "string" + } + } + }, + "CreateFieldIndex": { + "type": "object", + "required": [ + "field_name" + ], + "properties": { + "field_name": { + "type": "string" + }, + "field_schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/PayloadFieldSchema" + }, + { + "nullable": true + } + ] + } + } + }, + "PayloadFieldSchema": { + "anyOf": [ + { + "$ref": "#/components/schemas/PayloadSchemaType" + }, + { + "$ref": "#/components/schemas/PayloadSchemaParams" + } + ] + }, + "PointsSelector": { + "anyOf": [ + { + "$ref": "#/components/schemas/PointIdsList" + }, + { + "$ref": "#/components/schemas/FilterSelector" + } + ] + }, + "PointIdsList": { + "type": "object", + "required": [ + "points" + ], + "properties": { + "points": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExtendedPointId" + } + } + } + }, + "FilterSelector": { + "type": "object", + "required": [ + "filter" + ], + "properties": { + "filter": { + "$ref": "#/components/schemas/Filter" + } + } + }, + "PointInsertOperations": { + "oneOf": [ + { + "$ref": "#/components/schemas/PointsBatch" + }, + { + "$ref": "#/components/schemas/PointsList" + } + ] + }, + "BatchVectorStruct": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "format": "float" + } + } + }, + { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "format": "float" + } + } + } + } + ] + }, + "PointStruct": { + "type": "object", + "required": [ + "id", + "vector" + ], + "properties": { + "id": { + "$ref": "#/components/schemas/ExtendedPointId" + }, + "vector": { + "$ref": "#/components/schemas/VectorStruct" + }, + "payload": { + "description": "Payload values (optional)", + "anyOf": [ + { + "$ref": "#/components/schemas/Payload" + }, + { + "nullable": true + } + ] + } + } + }, + "Batch": { + "type": "object", + "required": [ + "ids", + "vectors" + ], + "properties": { + "ids": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExtendedPointId" + } + }, + "vectors": { + "$ref": "#/components/schemas/BatchVectorStruct" + }, + "payloads": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Payload" + }, + { + "nullable": true + } + ] + }, + "nullable": true + } + } + }, + "PointsBatch": { + "required": [ + "batch" + ], + "properties": { + "batch": { + "$ref": "#/components/schemas/Batch" + } + } + }, + "PointsList": { + "type": "object", + "required": [ + "points" + ], + "properties": { + "points": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PointStruct" + } + } + } + }, + "SetPayload": { + "type": "object", + "required": [ + "payload", + "points" + ], + "properties": { + "payload": { + "$ref": "#/components/schemas/Payload" + }, + "points": { + "description": "Assigns payload to each point in this list", + "type": "array", + "items": { + "$ref": "#/components/schemas/ExtendedPointId" + } + } + } + }, + "DeletePayload": { + "type": "object", + "required": [ + "keys", + "points" + ], + "properties": { + "keys": { + "type": "array", + "items": { + "type": "string" + } + }, + "points": { + "description": "Deletes values from each point in this list", + "type": "array", + "items": { + "$ref": "#/components/schemas/ExtendedPointId" + } + } + } + }, + "ClusterStatus": { + "description": "Information about current cluster status and structure", + "oneOf": [ + { + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "type": "string", + "enum": [ + "disabled" + ] + } + } + }, + { + "description": "Description of enabled cluster", + "type": "object", + "required": [ + "consensus_thread_status", + "message_send_failures", + "peer_id", + "peers", + "raft_info", + "status" + ], + "properties": { + "status": { + "type": "string", + "enum": [ + "enabled" + ] + }, + "peer_id": { + "description": "ID of this peer", + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "peers": { + "description": "Peers composition of the cluster with main information", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/PeerInfo" + } + }, + "raft_info": { + "$ref": "#/components/schemas/RaftInfo" + }, + "consensus_thread_status": { + "$ref": "#/components/schemas/ConsensusThreadStatus" + }, + "message_send_failures": { + "description": "Consequent failures of message send operations in consensus by peer address. On the first success to send to that peer - entry is removed from this hashmap.", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/MessageSendErrors" + } + } + } + } + ] + }, + "PeerInfo": { + "description": "Information of a peer in the cluster", + "type": "object", + "required": [ + "uri" + ], + "properties": { + "uri": { + "type": "string" + } + } + }, + "RaftInfo": { + "description": "Summary information about the current raft state", + "type": "object", + "required": [ + "commit", + "is_voter", + "pending_operations", + "term" + ], + "properties": { + "term": { + "description": "Raft divides time into terms of arbitrary length, each beginning with an election. If a candidate wins the election, it remains the leader for the rest of the term. The term number increases monotonically. Each server stores the current term number which is also exchanged in every communication.", + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "commit": { + "description": "The index of the latest committed (finalized) operation that this peer is aware of.", + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "pending_operations": { + "description": "Number of consensus operations pending to be applied on this peer", + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "leader": { + "description": "Leader of the current term", + "type": "integer", + "format": "uint64", + "minimum": 0, + "nullable": true + }, + "role": { + "description": "Role of this peer in the current term", + "anyOf": [ + { + "$ref": "#/components/schemas/StateRole" + }, + { + "nullable": true + } + ] + }, + "is_voter": { + "description": "Is this peer a voter or a learner", + "type": "boolean" + } + } + }, + "StateRole": { + "description": "Role of the peer in the consensus", + "type": "string", + "enum": [ + "Follower", + "Candidate", + "Leader", + "PreCandidate" + ] + }, + "ConsensusThreadStatus": { + "description": "Information about current consensus thread status", + "oneOf": [ + { + "type": "object", + "required": [ + "consensus_thread_status", + "last_update" + ], + "properties": { + "consensus_thread_status": { + "type": "string", + "enum": [ + "working" + ] + }, + "last_update": { + "type": "string", + "format": "date-time" + } + } + }, + { + "type": "object", + "required": [ + "consensus_thread_status" + ], + "properties": { + "consensus_thread_status": { + "type": "string", + "enum": [ + "stopped" + ] + } + } + }, + { + "type": "object", + "required": [ + "consensus_thread_status", + "err" + ], + "properties": { + "consensus_thread_status": { + "type": "string", + "enum": [ + "stopped_with_err" + ] + }, + "err": { + "type": "string" + } + } + } + ] + }, + "MessageSendErrors": { + "description": "Message send failures for a particular peer", + "type": "object", + "required": [ + "count" + ], + "properties": { + "count": { + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "latest_error": { + "type": "string", + "nullable": true + } + } + }, + "SnapshotDescription": { + "type": "object", + "required": [ + "name", + "size" + ], + "properties": { + "name": { + "type": "string" + }, + "creation_time": { + "type": "string", + "format": "partial-date-time", + "nullable": true + }, + "size": { + "type": "integer", + "format": "uint64", + "minimum": 0 + } + } + }, + "CountRequest": { + "description": "Count Request Counts the number of points which satisfy the given filter. If filter is not provided, the count of all points in the collection will be returned.", + "type": "object", + "properties": { + "filter": { + "description": "Look only for points which satisfies this conditions", + "anyOf": [ + { + "$ref": "#/components/schemas/Filter" + }, + { + "nullable": true + } + ] + }, + "exact": { + "description": "If true, count exact number of points. If false, count approximate number of points faster. Approximate count might be unreliable during the indexing process. Default: true", + "default": true, + "type": "boolean" + } + } + }, + "CountResult": { + "type": "object", + "required": [ + "count" + ], + "properties": { + "count": { + "description": "Number of points which satisfy the conditions", + "type": "integer", + "format": "uint", + "minimum": 0 + } + } + }, + "CollectionClusterInfo": { + "description": "Current clustering distribution for the collection", + "type": "object", + "required": [ + "local_shards", + "peer_id", + "remote_shards", + "shard_count", + "shard_transfers" + ], + "properties": { + "peer_id": { + "description": "ID of this peer", + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "shard_count": { + "description": "Total number of shards", + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "local_shards": { + "description": "Local shards", + "type": "array", + "items": { + "$ref": "#/components/schemas/LocalShardInfo" + } + }, + "remote_shards": { + "description": "Remote shards", + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteShardInfo" + } + }, + "shard_transfers": { + "description": "Shard transfers", + "type": "array", + "items": { + "$ref": "#/components/schemas/ShardTransferInfo" + } + } + } + }, + "LocalShardInfo": { + "type": "object", + "required": [ + "points_count", + "shard_id", + "state" + ], + "properties": { + "shard_id": { + "description": "Local shard id", + "type": "integer", + "format": "uint32", + "minimum": 0 + }, + "points_count": { + "description": "Number of points in the shard", + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "state": { + "$ref": "#/components/schemas/ReplicaState" + } + } + }, + "ReplicaState": { + "description": "State of the single shard within a replica set.", + "type": "string", + "enum": [ + "Active", + "Dead", + "Partial" + ] + }, + "RemoteShardInfo": { + "type": "object", + "required": [ + "peer_id", + "shard_id", + "state" + ], + "properties": { + "shard_id": { + "description": "Remote shard id", + "type": "integer", + "format": "uint32", + "minimum": 0 + }, + "peer_id": { + "description": "Remote peer id", + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "state": { + "$ref": "#/components/schemas/ReplicaState" + } + } + }, + "ShardTransferInfo": { + "type": "object", + "required": [ + "from", + "shard_id", + "sync", + "to" + ], + "properties": { + "shard_id": { + "type": "integer", + "format": "uint32", + "minimum": 0 + }, + "from": { + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "to": { + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "sync": { + "description": "If `true` transfer is a synchronization of a replicas If `false` transfer is a moving of a shard from one peer to another", + "type": "boolean" + } + } + }, + "TelemetryData": { + "type": "object", + "required": [ + "app", + "cluster", + "collections", + "id", + "requests" + ], + "properties": { + "id": { + "type": "string" + }, + "app": { + "$ref": "#/components/schemas/AppBuildTelemetry" + }, + "collections": { + "$ref": "#/components/schemas/CollectionsTelemetry" + }, + "cluster": { + "$ref": "#/components/schemas/ClusterTelemetry" + }, + "requests": { + "$ref": "#/components/schemas/RequestsTelemetry" + } + } + }, + "AppBuildTelemetry": { + "type": "object", + "required": [ + "version" + ], + "properties": { + "version": { + "type": "string" + }, + "features": { + "anyOf": [ + { + "$ref": "#/components/schemas/AppFeaturesTelemetry" + }, + { + "nullable": true + } + ] + }, + "system": { + "anyOf": [ + { + "$ref": "#/components/schemas/RunningEnvironmentTelemetry" + }, + { + "nullable": true + } + ] + } + } + }, + "AppFeaturesTelemetry": { + "type": "object", + "required": [ + "debug", + "service_debug_feature", + "web_feature" + ], + "properties": { + "debug": { + "type": "boolean" + }, + "web_feature": { + "type": "boolean" + }, + "service_debug_feature": { + "type": "boolean" + } + } + }, + "RunningEnvironmentTelemetry": { + "type": "object", + "required": [ + "cpu_flags", + "is_docker" + ], + "properties": { + "distribution": { + "type": "string", + "nullable": true + }, + "distribution_version": { + "type": "string", + "nullable": true + }, + "is_docker": { + "type": "boolean" + }, + "cores": { + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + }, + "ram_size": { + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + }, + "disk_size": { + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + }, + "cpu_flags": { + "type": "string" + } + } + }, + "CollectionsTelemetry": { + "type": "object", + "required": [ + "number_of_collections" + ], + "properties": { + "number_of_collections": { + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "collections": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CollectionTelemetryEnum" + }, + "nullable": true + } + } + }, + "CollectionTelemetryEnum": { + "anyOf": [ + { + "$ref": "#/components/schemas/CollectionTelemetry" + }, + { + "$ref": "#/components/schemas/CollectionsAggregatedTelemetry" + } + ] + }, + "CollectionTelemetry": { + "type": "object", + "required": [ + "config", + "id", + "init_time_ms", + "shards" + ], + "properties": { + "id": { + "type": "string" + }, + "init_time_ms": { + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "config": { + "$ref": "#/components/schemas/CollectionConfig" + }, + "shards": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReplicaSetTelemetry" + } + } + } + }, + "ReplicaSetTelemetry": { + "type": "object", + "required": [ + "id", + "remote" + ], + "properties": { + "id": { + "type": "integer", + "format": "uint32", + "minimum": 0 + }, + "local": { + "anyOf": [ + { + "$ref": "#/components/schemas/LocalShardTelemetry" + }, + { + "nullable": true + } + ] + }, + "remote": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RemoteShardTelemetry" + } + } + } + }, + "LocalShardTelemetry": { + "type": "object", + "required": [ + "optimizations", + "segments" + ], + "properties": { + "variant_name": { + "type": "string", + "nullable": true + }, + "segments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SegmentTelemetry" + } + }, + "optimizations": { + "$ref": "#/components/schemas/OptimizerTelemetry" + } + } + }, + "SegmentTelemetry": { + "type": "object", + "required": [ + "config", + "info", + "payload_field_indices", + "vector_index_searches" + ], + "properties": { + "info": { + "$ref": "#/components/schemas/SegmentInfo" + }, + "config": { + "$ref": "#/components/schemas/SegmentConfig" + }, + "vector_index_searches": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VectorIndexSearchesTelemetry" + } + }, + "payload_field_indices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PayloadIndexTelemetry" + } + } + } + }, + "SegmentInfo": { + "description": "Aggregated information about segment", + "type": "object", + "required": [ + "disk_usage_bytes", + "index_schema", + "is_appendable", + "num_deleted_vectors", + "num_points", + "num_vectors", + "ram_usage_bytes", + "segment_type" + ], + "properties": { + "segment_type": { + "$ref": "#/components/schemas/SegmentType" + }, + "num_vectors": { + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "num_points": { + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "num_deleted_vectors": { + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "ram_usage_bytes": { + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "disk_usage_bytes": { + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "is_appendable": { + "type": "boolean" + }, + "index_schema": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/PayloadIndexInfo" + } + } + } + }, + "SegmentType": { + "description": "Type of segment", + "type": "string", + "enum": [ + "plain", + "indexed", + "special" + ] + }, + "SegmentConfig": { + "type": "object", + "required": [ + "index", + "storage_type", + "vector_data" + ], + "properties": { + "vector_data": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/VectorDataConfig" + } + }, + "index": { + "$ref": "#/components/schemas/Indexes" + }, + "storage_type": { + "$ref": "#/components/schemas/StorageType" + }, + "payload_storage_type": { + "$ref": "#/components/schemas/PayloadStorageType" + } + } + }, + "VectorDataConfig": { + "description": "Config of single vector data storage", + "type": "object", + "required": [ + "distance", + "size" + ], + "properties": { + "size": { + "description": "Size of a vectors used", + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "distance": { + "$ref": "#/components/schemas/Distance" + } + } + }, + "Indexes": { + "description": "Vector index configuration of the segment", + "oneOf": [ + { + "description": "Do not use any index, scan whole vector collection during search. Guarantee 100% precision, but may be time consuming on large collections.", + "type": "object", + "required": [ + "options", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "plain" + ] + }, + "options": { + "type": "object" + } + } + }, + { + "description": "Use filterable HNSW index for approximate search. Is very fast even on a very huge collections, but require additional space to store index and additional time to build it.", + "type": "object", + "required": [ + "options", + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "hnsw" + ] + }, + "options": { + "$ref": "#/components/schemas/HnswConfig" + } + } + } + ] + }, + "StorageType": { + "description": "Type of vector storage", + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "in_memory" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "mmap" + ] + } + } + } + ] + }, + "PayloadStorageType": { + "description": "Type of payload storage", + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "in_memory" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "on_disk" + ] + } + } + } + ] + }, + "VectorIndexSearchesTelemetry": { + "type": "object", + "required": [ + "filtered_exact", + "filtered_large_cardinality", + "filtered_plain", + "filtered_small_cardinality", + "unfiltered_exact", + "unfiltered_hnsw", + "unfiltered_plain" + ], + "properties": { + "index_name": { + "type": "string", + "nullable": true + }, + "unfiltered_plain": { + "$ref": "#/components/schemas/OperationDurationStatistics" + }, + "unfiltered_hnsw": { + "$ref": "#/components/schemas/OperationDurationStatistics" + }, + "filtered_plain": { + "$ref": "#/components/schemas/OperationDurationStatistics" + }, + "filtered_small_cardinality": { + "$ref": "#/components/schemas/OperationDurationStatistics" + }, + "filtered_large_cardinality": { + "$ref": "#/components/schemas/OperationDurationStatistics" + }, + "filtered_exact": { + "$ref": "#/components/schemas/OperationDurationStatistics" + }, + "unfiltered_exact": { + "$ref": "#/components/schemas/OperationDurationStatistics" + } + } + }, + "OperationDurationStatistics": { + "type": "object", + "required": [ + "count" + ], + "properties": { + "count": { + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "fail_count": { + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "avg_duration_micros": { + "type": "number", + "format": "float", + "nullable": true + }, + "min_duration_micros": { + "type": "number", + "format": "float", + "nullable": true + }, + "max_duration_micros": { + "type": "number", + "format": "float", + "nullable": true + } + } + }, + "PayloadIndexTelemetry": { + "type": "object", + "required": [ + "points_count", + "points_values_count" + ], + "properties": { + "field_name": { + "type": "string", + "nullable": true + }, + "points_values_count": { + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "points_count": { + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "histogram_bucket_size": { + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + } + } + }, + "OptimizerTelemetry": { + "type": "object", + "required": [ + "optimizations", + "status" + ], + "properties": { + "status": { + "$ref": "#/components/schemas/OptimizersStatus" + }, + "optimizations": { + "$ref": "#/components/schemas/OperationDurationStatistics" + } + } + }, + "RemoteShardTelemetry": { + "type": "object", + "required": [ + "searches", + "shard_id", + "updates" + ], + "properties": { + "shard_id": { + "type": "integer", + "format": "uint32", + "minimum": 0 + }, + "searches": { + "$ref": "#/components/schemas/OperationDurationStatistics" + }, + "updates": { + "$ref": "#/components/schemas/OperationDurationStatistics" + } + } + }, + "CollectionsAggregatedTelemetry": { + "type": "object", + "required": [ + "optimizers_status", + "params", + "vectors" + ], + "properties": { + "vectors": { + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "optimizers_status": { + "$ref": "#/components/schemas/OptimizersStatus" + }, + "params": { + "$ref": "#/components/schemas/CollectionParams" + } + } + }, + "ClusterTelemetry": { + "type": "object", + "required": [ + "enabled" + ], + "properties": { + "enabled": { + "type": "boolean" + }, + "status": { + "anyOf": [ + { + "$ref": "#/components/schemas/ClusterStatusTelemetry" + }, + { + "nullable": true + } + ] + }, + "config": { + "anyOf": [ + { + "$ref": "#/components/schemas/ClusterConfigTelemetry" + }, + { + "nullable": true + } + ] + } + } + }, + "ClusterStatusTelemetry": { + "type": "object", + "required": [ + "commit", + "is_voter", + "number_of_peers", + "pending_operations", + "term" + ], + "properties": { + "number_of_peers": { + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "term": { + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "commit": { + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "pending_operations": { + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "role": { + "anyOf": [ + { + "$ref": "#/components/schemas/StateRole" + }, + { + "nullable": true + } + ] + }, + "is_voter": { + "type": "boolean" + } + } + }, + "ClusterConfigTelemetry": { + "type": "object", + "required": [ + "consensus", + "grpc_timeout_ms", + "p2p" + ], + "properties": { + "grpc_timeout_ms": { + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "p2p": { + "$ref": "#/components/schemas/P2pConfigTelemetry" + }, + "consensus": { + "$ref": "#/components/schemas/ConsensusConfigTelemetry" + } + } + }, + "P2pConfigTelemetry": { + "type": "object", + "required": [ + "connection_pool_size" + ], + "properties": { + "connection_pool_size": { + "type": "integer", + "format": "uint", + "minimum": 0 + } + } + }, + "ConsensusConfigTelemetry": { + "type": "object", + "required": [ + "bootstrap_timeout_sec", + "max_message_queue_size", + "tick_period_ms" + ], + "properties": { + "max_message_queue_size": { + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "tick_period_ms": { + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "bootstrap_timeout_sec": { + "type": "integer", + "format": "uint64", + "minimum": 0 + } + } + }, + "RequestsTelemetry": { + "type": "object", + "required": [ + "grpc", + "rest" + ], + "properties": { + "rest": { + "$ref": "#/components/schemas/WebApiTelemetry" + }, + "grpc": { + "$ref": "#/components/schemas/GrpcTelemetry" + } + } + }, + "WebApiTelemetry": { + "type": "object", + "required": [ + "responses" + ], + "properties": { + "responses": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/OperationDurationStatistics" + } + } + } + } + }, + "GrpcTelemetry": { + "type": "object", + "required": [ + "responses" + ], + "properties": { + "responses": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/OperationDurationStatistics" + } + } + } + }, + "ClusterOperations": { + "anyOf": [ + { + "$ref": "#/components/schemas/MoveShardOperation" + }, + { + "$ref": "#/components/schemas/ReplicateShardOperation" + }, + { + "$ref": "#/components/schemas/AbortTransferOperation" + }, + { + "$ref": "#/components/schemas/DropReplicaOperation" + } + ] + }, + "MoveShardOperation": { + "type": "object", + "required": [ + "move_shard" + ], + "properties": { + "move_shard": { + "$ref": "#/components/schemas/MoveShard" + } + } + }, + "MoveShard": { + "type": "object", + "required": [ + "from_peer_id", + "shard_id", + "to_peer_id" + ], + "properties": { + "shard_id": { + "type": "integer", + "format": "uint32", + "minimum": 0 + }, + "to_peer_id": { + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "from_peer_id": { + "type": "integer", + "format": "uint64", + "minimum": 0 + } + } + }, + "ReplicateShardOperation": { + "type": "object", + "required": [ + "replicate_shard" + ], + "properties": { + "replicate_shard": { + "$ref": "#/components/schemas/MoveShard" + } + } + }, + "AbortTransferOperation": { + "type": "object", + "required": [ + "abort_transfer" + ], + "properties": { + "abort_transfer": { + "$ref": "#/components/schemas/MoveShard" + } + } + }, + "DropReplicaOperation": { + "type": "object", + "required": [ + "drop_replica" + ], + "properties": { + "drop_replica": { + "$ref": "#/components/schemas/Replica" + } + } + }, + "Replica": { + "type": "object", + "required": [ + "peer_id", + "shard_id" + ], + "properties": { + "shard_id": { + "type": "integer", + "format": "uint32", + "minimum": 0 + }, + "peer_id": { + "type": "integer", + "format": "uint64", + "minimum": 0 + } + } + }, + "SearchRequestBatch": { + "type": "object", + "required": [ + "searches" + ], + "properties": { + "searches": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SearchRequest" + } + } + } + }, + "RecommendRequestBatch": { + "type": "object", + "required": [ + "searches" + ], + "properties": { + "searches": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RecommendRequest" + } + } + } + }, + "LocksOption": { + "type": "object", + "required": [ + "write" + ], + "properties": { + "error_message": { + "type": "string", + "nullable": true + }, + "write": { + "type": "boolean" + } + } + } + } + } +} \ No newline at end of file diff --git a/fern/docs.yml b/fern/docs.yml index bda7ee4..fe2ac4f 100644 --- a/fern/docs.yml +++ b/fern/docs.yml @@ -13,6 +13,8 @@ versions: path: ./versions/v1.10.x.yml - display-name: v1.9.x path: ./versions/v1.9.x.yml + - display-name: v0.11.1 + path: ./versions/v0.11.1.yml - display-name: master path: ./versions/master.yml colors: diff --git a/fern/versions/v0.11.1.yml b/fern/versions/v0.11.1.yml new file mode 100644 index 0000000..46142a1 --- /dev/null +++ b/fern/versions/v0.11.1.yml @@ -0,0 +1,8 @@ +navigation: + - api: API Reference + api-name: v0.11.1 + summary: ../pages/api-summary.mdx + + + + \ No newline at end of file From ae0df7f627c7c6e609f9807238397cd392d1fad6 Mon Sep 17 00:00:00 2001 From: George Panchuk Date: Wed, 29 Jan 2025 18:40:22 +0100 Subject: [PATCH 14/14] remove manual deprecation --- fern/apis/v1.13.x/openapi-overrides.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/fern/apis/v1.13.x/openapi-overrides.yml b/fern/apis/v1.13.x/openapi-overrides.yml index ee4e475..fa09815 100644 --- a/fern/apis/v1.13.x/openapi-overrides.yml +++ b/fern/apis/v1.13.x/openapi-overrides.yml @@ -2576,7 +2576,6 @@ paths: language: go /collections/{collection_name}/points/search: post: - deprecated: true description: Retrieves the closest points based on vector similarity and given filtering conditions. summary: Search points