diff --git a/fern/api-ordering.yml b/fern/api-ordering.yml index 4ac7b13..a4ddeef 100644 --- a/fern/api-ordering.yml +++ b/fern/api-ordering.yml @@ -5,6 +5,7 @@ order: - path: /collections/{collection_name} - path: /collections/{collection_name}/points - path: /collections/{collection_name}/points/search + - path: /collections/{collection_name}/points/query - path: /collections/{collection_name}/index - path: /collections/{collection_name}/snapshots - path: /collections/aliases diff --git a/fern/apis/master/openapi-overrides.yml b/fern/apis/master/openapi-overrides.yml index d8f6113..a205c95 100644 --- a/fern/apis/master/openapi-overrides.yml +++ b/fern/apis/master/openapi-overrides.yml @@ -11,30 +11,8 @@ paths: get: x-fern-examples: - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.getAliases(); - -' - language: typescript - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/aliases' \\\n --header 'api-key: '" - language: curl - - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.get_aliases() - -' - language: python + - 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 @@ -50,40 +28,30 @@ paths: ' language: csharp - 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: 'use qdrant_client::Qdrant; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - let client = Qdrant::from_url("http://localhost:6334").build()?; + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.list_aliases().await?; + client.getAliases(); ' - language: rust - description: Retrieves a list of all existing aliases. - summary: List all aliases - tags: - - Aliases - /collections: - get: - x-fern-examples: + language: typescript - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: "curl -X GET \\\n 'http://localhost:6333/aliases' \\\n --header 'api-key: '" + language: curl + - code-samples: + - code: 'use qdrant_client::Qdrant; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + let client = Qdrant::from_url("http://localhost:6334").build()?; - client.getCollections(); + client.list_aliases().await?; ' - language: typescript - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections' \\\n --header 'api-key: '" - language: curl + language: rust - code-samples: - code: 'from qdrant_client import QdrantClient @@ -91,10 +59,20 @@ paths: client = QdrantClient(url="http://localhost:6333") - client.get_collections() + client.get_aliases() ' language: python + description: Retrieves a list of all existing aliases. + summary: List all aliases + tags: + - Aliases + /collections: + get: + x-fern-examples: + - 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 @@ -110,8 +88,19 @@ paths: ' language: csharp - 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: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.getCollections(); + +' + language: typescript + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/collections' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'use qdrant_client::Qdrant; @@ -123,6 +112,17 @@ paths: ' language: rust + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.get_collections() + +' + language: python description: Returns a list of all existing collections. summary: List all collections tags: @@ -131,14 +131,8 @@ paths: post: x-fern-examples: - 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: "# 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: "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: "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 @@ -157,11 +151,17 @@ paths: ' language: csharp - 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: "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: "# 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 description: Updates aliases for the specified collections. summary: Update collection aliases tags: @@ -170,30 +170,8 @@ paths: delete: x-fern-examples: - 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: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: '" - language: curl - - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.delete_collection(collection_name="{collection_name}") - -' - language: python + - 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 @@ -209,39 +187,30 @@ paths: ' language: csharp - 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: 'use qdrant_client::Qdrant; + - code: 'import { QdrantClient } from ''@qdrant/qdrant-js''; - let client = Qdrant::from_url("http://localhost:6334").build()?; + const client = new QdrantClient({url: ''http://127.0.0.1:6333''}); - client.delete_collection("{collection_name}").await?; + client.deleteCollection("{collection_name}"); ' - language: rust - description: Drops the specified collection and all associated data in it. - summary: Delete a collection - tags: - - Collections - get: - x-fern-examples: + language: typescript - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: '" + language: curl + - code-samples: + - code: 'use qdrant_client::Qdrant; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + let client = Qdrant::from_url("http://localhost:6334").build()?; - client.getCollection("{collection_name}"); + client.delete_collection("{collection_name}").await?; ' - language: typescript - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: '" - language: curl + language: rust - code-samples: - code: 'from qdrant_client import QdrantClient @@ -249,10 +218,19 @@ paths: client = QdrantClient(url="http://localhost:6333") - client.get_collection("{collection_name}") + client.delete_collection(collection_name="{collection_name}") ' language: python + 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 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 @@ -268,8 +246,19 @@ paths: ' language: csharp - 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: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.getCollection("{collection_name}"); + +' + language: typescript + - 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; @@ -281,6 +270,17 @@ paths: ' language: rust + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.get_collection("{collection_name}") + +' + language: python description: Retrieves parameters from the specified collection. summary: Get collection details tags: @@ -288,14 +288,8 @@ paths: patch: x-fern-examples: - 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 - - 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: "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: "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 @@ -303,11 +297,17 @@ paths: - 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: "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: "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: "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 + - 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 description: Updates the parameters of the specified collection. summary: Update collection parameters tags: @@ -315,14 +315,8 @@ paths: put: x-fern-examples: - 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 - - 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 },\n \"sparse_vectors\": {\n \"sparse-vector-name\": {\n \"index\": {\n \"on_disk\": true\n }\n }\n }\n}'\n" - language: curl - - 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: "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 @@ -330,11 +324,17 @@ paths: - 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: "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: "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: "# 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 },\n \"sparse_vectors\": {\n \"sparse-vector-name\": {\n \"index\": {\n \"on_disk\": true\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 + - 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 description: Creates a new collection with the given parameters. summary: Create a collection tags: @@ -343,47 +343,36 @@ paths: get: x-fern-examples: - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.getCollectionAliases("{collection_name}"); - -' - language: typescript + - 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: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/aliases' \\\n --header 'api-key: '" - language: curl + - 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: 'from qdrant_client import QdrantClient + - code: 'using Qdrant.Client; - client = QdrantClient(url="http://localhost:6333") + var client = new QdrantClient("localhost", 6334); - client.get_collection_aliases("{collection_name}") + await client.ListCollectionAliasesAsync("{collection_name}"); ' - language: python - - 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 + language: csharp - 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 + 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: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/aliases' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'use qdrant_client::Qdrant; @@ -395,6 +384,17 @@ paths: ' language: rust + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.get_collection_aliases("{collection_name}") + +' + language: python description: Retrieves a list of all aliases for the specified collection. summary: List collection aliases tags: @@ -403,28 +403,21 @@ paths: get: x-fern-examples: - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - + - code: 'import static io.qdrant.client.ConditionFactory.matchKeyword; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + import io.qdrant.client.QdrantClient; - client.collectionExists("{collection_name}"); + import io.qdrant.client.QdrantGrpcClient; -' - language: typescript - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/exists' \\\n --header 'api-key: '" - language: curl - - code-samples: - - code: 'from qdrant_client import QdrantClient + QdrantClient client = new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build()); - client = QdrantClient(url="http://localhost:6333") + client.collectionExistsAsync("{collection_name}").get(); - client.collection_exists(collection_name="{collection_name}")' - language: python +' + 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 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 @@ -440,21 +433,19 @@ paths: ' language: csharp - code-samples: - - code: 'import static io.qdrant.client.ConditionFactory.matchKeyword; - - - import io.qdrant.client.QdrantClient; - - import io.qdrant.client.QdrantGrpcClient; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - QdrantClient client = new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build()); + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.collectionExistsAsync("{collection_name}").get(); + client.collectionExists("{collection_name}"); ' - language: java + language: typescript + - 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; @@ -466,6 +457,15 @@ paths: ' language: rust + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.collection_exists(collection_name="{collection_name}")' + language: python description: Checks whether the specified collection exists. summary: Check collection existence tags: @@ -474,11 +474,8 @@ paths: post: x-fern-examples: - 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 - - code-samples: - - 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: "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 @@ -486,11 +483,14 @@ paths: - 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: "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: "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: "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 + - code-samples: + - 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 description: Retrieves facets for the specified payload field. summary: Payload field facets tags: @@ -499,14 +499,8 @@ paths: put: x-fern-examples: - 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 - - 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: "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: "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 @@ -514,11 +508,17 @@ paths: - 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: "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: "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: "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 + - 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 description: Creates a payload index for a field in the specified collection. summary: Create payload index tags: @@ -526,6 +526,15 @@ paths: /collections/{collection_name}/index/{field_name}: delete: x-fern-examples: + - 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: "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: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -540,6 +549,9 @@ paths: - 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 @@ -551,18 +563,6 @@ paths: ' language: python - - 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: "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: "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: "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 description: Deletes a payload index for a field in the specified collection. summary: Delete payload index tags: @@ -571,14 +571,8 @@ paths: post: x-fern-examples: - 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 - - 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: "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: "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 @@ -586,11 +580,17 @@ paths: - 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: "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: "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: "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 description: Retrieves all details from multiple points. summary: Retrieve points tags: @@ -598,14 +598,8 @@ paths: put: x-fern-examples: - 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 - - 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: "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: "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 @@ -613,11 +607,17 @@ paths: - 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: "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: "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: "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 + - 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 description: Performs the insert + update action on specified points. Any point with an existing {id} will be overwritten. summary: Upsert points tags: @@ -626,14 +626,8 @@ paths: post: x-fern-examples: - 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 - - 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: "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: "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 @@ -641,11 +635,17 @@ paths: - 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: "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: "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: "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 + - code-samples: + - 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 description: Batch updates points, including their respective vectors and payloads. summary: Batch update points tags: @@ -654,14 +654,8 @@ paths: post: x-fern-examples: - 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 - - 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: "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: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Common.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 @@ -669,11 +663,17 @@ paths: - 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: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Common.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: "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: "# 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 + - 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 description: Counts the number of points that match a specified filtering condition. summary: Count points tags: @@ -682,14 +682,8 @@ paths: post: x-fern-examples: - 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: "# 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: "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: "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.Common.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 @@ -708,11 +702,17 @@ paths: ' language: csharp - 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.Common.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: "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: "# 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 description: Deletes specified points from the collection. summary: Delete points tags: @@ -721,14 +721,8 @@ paths: post: x-fern-examples: - 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 - - 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: "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: "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 @@ -736,11 +730,17 @@ paths: - 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: "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: "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: "# 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 + - 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 description: Sets payload values for specified points. summary: Set payload tags: @@ -748,14 +748,8 @@ paths: put: x-fern-examples: - 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 - - 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: "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: "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 @@ -763,11 +757,17 @@ paths: - 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: "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: "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: "# 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 + - 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 description: Replaces the entire payload of a specified point with a new payload. summary: Overwrite payload tags: @@ -776,14 +776,8 @@ paths: post: x-fern-examples: - 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: "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: "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: "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 @@ -799,11 +793,17 @@ paths: ' language: csharp - 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: "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: "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 description: Removes the entire payload for specified points. summary: Clear payload tags: @@ -812,14 +812,8 @@ paths: post: x-fern-examples: - 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: "# 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: "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: "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 @@ -835,11 +829,17 @@ paths: ' language: csharp - 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: "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: "# 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 description: Deletes a specified key payload for points. summary: Delete payload tags: @@ -848,14 +848,8 @@ paths: post: x-fern-examples: - 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\n// Score boost depending on payload conditions (as of 1.14.0)\nconst tag_boosted = await client.query(\"{collection_name}\", {\n prefetch: {\n query: [0.2, 0.8, 0.1, 0.9],\n limit: 50\n },\n query: {\n formula: {\n sum: [\n \"$score\",\n {\n mult: [ 0.5, { key: \"tag\", match: { any: [\"h1\", \"h2\", \"h3\", \"h4\"] }} ]\n },\n {\n mult: [ 0.25, { key: \"tag\", match: { any: [\"p\", \"li\"] }} ]\n }\n ]\n }\n }\n});\n\n// Score boost geographically closer points (as of 1.14.0)\nconst distance_boosted = await client.query(\"{collection_name}\", {\n prefetch: {\n query: [0.2, 0.8, ...],\n limit: 50\n },\n query: {\n formula: {\n sum: [\n \"$score\",\n {\n gauss_decay: {\n x: {\n geo_distance: {\n origin: { lat: 52.504043, lon: 13.393236 }, // Berlin\n to: \"geo.location\"\n }\n },\n scale: 5000 // 5km\n }\n }\n ]\n },\n defaults: { \"geo.location\": { lat: 48.137154, lon: 11.576124 } } // Munich\n }\n});\n" - language: typescript - - 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\n# Score boost depending on payload conditions (as of 1.14.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 \"prefetch\": {\n \"query\": [0.2, 0.8, ...], // <-- dense vector\n \"limit\": 50\n }\n \"query\": {\n \"formula\": {\n \"sum\": [\n \"$score,\n { \"mult\": [ 0.5, { \"key\": \"tag\", \"match\": { \"any\": [\"h1\", \"h2\", \"h3\", \"h4\"] } } ] },\n { \"mult\": [ 0.25, { \"key\": \"tag\", \"match\": { \"any\": [\"p\", \"li\"] } } ] }\n ]\n }\n }\n}'\n\n# Score boost geographically closer points (as of 1.14.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 \"prefetch\": { \"query\": [0.2, 0.8, ...], \"limit\": 50 },\n \"query\": {\n \"formula\": {\n \"sum\": [\n \"$score\",\n {\n \"gauss_decay\": {\n \"x\": {\n \"geo_distance\": {\n \"origin\": { \"lat\": 52.504043, \"lon\": 13.393236 } // Berlin\n \"to\": \"geo.location\"\n }\n },\n \"scale\": 5000 // 5km\n }\n }\n ]\n },\n \"defaults\": { \"geo.location\": {\"lat\": 48.137154, \"lon\": 11.576124} } // Munich\n }\n}'\n" - language: curl - - 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, ...], # <─┐\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\n# Score boost depending on payload conditions (as of 1.14.0)\ntag_boosted = client.query_points(\n collection_name=\"{collection_name}\",\n prefetch=models.Prefetch(\n query=[0.2, 0.8, ...], # <-- dense vector\n limit=50\n ),\n query=models.FormulaQuery(\n formula=models.SumExpression(sum=[\n \"$score\",\n models.MultExpression(mult=[0.5, models.FieldCondition(key=\"tag\", match=models.MatchAny(any=[\"h1\", \"h2\", \"h3\", \"h4\"]))]),\n models.MultExpression(mult=[0.25, models.FieldCondition(key=\"tag\", match=models.MatchAny(any=[\"p\", \"li\"]))])\n ]\n ))\n)\n\n# Score boost geographically closer points (as of 1.14.0)\ngeo_boosted = client.query_points(\n collection_name=\"{collection_name}\",\n prefetch=models.Prefetch(\n query=[0.2, 0.8, ...], # <-- dense vector\n limit=50\n ),\n query=models.FormulaQuery(\n formula=models.SumExpression(sum=[\n \"$score\",\n models.GaussDecayExpression(\n gauss_decay=models.DecayParamsExpression(\n x=models.GeoDistance(\n geo_distance=models.GeoDistanceParams(\n origin=models.GeoPoint(\n lat=52.504043,\n lon=13.393236\n ), # Berlin\n to=\"geo.location\"\n )\n ),\n scale=5000 # 5km\n )\n )\n ]),\n defaults={\"geo.location\": models.GeoPoint(lat=48.137154, lon=11.576124)} # Munich\n )\n)\n" - language: python + - 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\n// Score boost depending on payload conditions (as of 1.14.0)\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 formula(\n Formula.newBuilder()\n .setExpression(\n sum(\n SumExpression.newBuilder()\n .addSum(variable(\"$score\"))\n .addSum(\n mult(\n MultExpression.newBuilder()\n .addMult(constant(0.5f))\n .addMult(\n condition(\n matchKeywords(\n \"tag\",\n List.of(\"h1\", \"h2\", \"h3\", \"h4\"))))\n .build()))\n .addSum(mult(MultExpression.newBuilder()\n .addMult(constant(0.25f))\n .addMult(\n condition(\n matchKeywords(\n \"tag\",\n List.of(\"p\", \"li\"))))\n .build()))\n .build()))\n .build()))\n .build())\n .get();\n\n// Score boost geographically closer points (as of 1.14.0)\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 formula(\n Formula.newBuilder()\n .setExpression(\n sum(\n SumExpression.newBuilder()\n .addSum(variable(\"$score\"))\n .addSum(\n expDecay(\n DecayParamsExpression.newBuilder()\n .setX(\n geoDistance(\n GeoDistance.newBuilder()\n .setOrigin(\n GeoPoint.newBuilder()\n .setLat(52.504043)\n .setLon(13.393236)\n .build())\n .setTo(\"geo.location\")\n .build()))\n .setScale(5000)\n .build()))\n .build()))\n .putDefaults(\n \"geo.location\",\n value(\n Map.of(\n \"lat\", value(48.137154),\n \"lon\", value(11.576124))))\n .build()))\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\t// Score boost depending on payload conditions (as of 1.14.0)\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.NewQueryFormula(&qdrant.Formula{\n\t\t\tExpression: qdrant.NewExpressionSum(&qdrant.SumExpression{\n\t\t\t\tSum: []*qdrant.Expression{\n\t\t\t\t\tqdrant.NewExpressionVariable(\"$score\"),\n\t\t\t\t\tqdrant.NewExpressionMult(&qdrant.MultExpression{\n\t\t\t\t\t\tMult: []*qdrant.Expression{\n\t\t\t\t\t\t\tqdrant.NewExpressionConstant(0.5),\n\t\t\t\t\t\t\tqdrant.NewExpressionCondition(qdrant.NewMatchKeywords(\"tag\", \"h1\", \"h2\", \"h3\", \"h4\")),\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t\tqdrant.NewExpressionMult(&qdrant.MultExpression{\n\t\t\t\t\t\tMult: []*qdrant.Expression{\n\t\t\t\t\t\t\tqdrant.NewExpressionConstant(0.25),\n\t\t\t\t\t\t\tqdrant.NewExpressionCondition(qdrant.NewMatchKeywords(\"tag\", \"p\", \"li\")),\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\n\t// Score boost geographically closer points (as of 1.14.0)\n\tclient.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.2, 0.8),\n\t\t\t},\n\t\t},\n\t\tQuery: qdrant.NewQueryFormula(&qdrant.Formula{\n\t\t\tExpression: qdrant.NewExpressionSum(&qdrant.SumExpression{\n\t\t\t\tSum: []*qdrant.Expression{\n\t\t\t\t\tqdrant.NewExpressionVariable(\"$score\"),\n\t\t\t\t\tqdrant.NewExpressionExpDecay(&qdrant.DecayParamsExpression{\n\t\t\t\t\t\tX: qdrant.NewExpressionGeoDistance(&qdrant.GeoDistance{\n\t\t\t\t\t\t\tOrigin: &qdrant.GeoPoint{\n\t\t\t\t\t\t\t\tLat: 52.504043,\n\t\t\t\t\t\t\t\tLon: 13.393236,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tTo: \"geo.location\",\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\tDefaults: qdrant.NewValueMap(map[string]any{\n\t\t\t\t\"geo.location\": map[string]any{\n\t\t\t\t\t\"lat\": 48.137154,\n\t\t\t\t\t\"lon\": 11.576124,\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t})\n}\n" language: go @@ -863,11 +857,17 @@ paths: - 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\n// Score boost depending on payload conditions (as of 1.14.0)\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tprefetch:\n\t[\n\t\tnew PrefetchQuery { Query = new float[] { 0.01f, 0.45f, 0.67f }, Limit = 100 },\n\t],\n\tquery: new Formula\n\t{\n\t\tExpression = new SumExpression\n\t\t{\n\t\t\tSum =\n\t\t\t{\n\t\t\t\t\"$score\",\n\t\t\t\tnew MultExpression\n\t\t\t\t{\n\t\t\t\t\tMult = { 0.5f, Match(\"tag\", [\"h1\", \"h2\", \"h3\", \"h4\"]) },\n\t\t\t\t},\n\t\t\t\tnew MultExpression { Mult = { 0.25f, Match(\"tag\", [\"p\", \"li\"]) } },\n\t\t\t},\n\t\t},\n\t},\n\tlimit: 10\n);\n\n// Score boost geographically closer points (as of 1.14.0)\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tprefetch:\n\t[\n\t\tnew PrefetchQuery { Query = new float[] { 0.01f, 0.45f, 0.67f }, Limit = 100 },\n\t],\n\tquery: new Formula\n\t{\n\t\tExpression = new SumExpression\n\t\t{\n\t\t\tSum =\n\t\t\t{\n\t\t\t\t\"$score\",\n\t\t\t\tWithExpDecay(\n\t\t\t\t\tnew()\n\t\t\t\t\t{\n\t\t\t\t\t\tX = new GeoDistance\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tOrigin = new GeoPoint { Lat = 52.504043, Lon = 13.393236 },\n\t\t\t\t\t\t\tTo = \"geo.location\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\tScale = 5000,\n\t\t\t\t\t}\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t\tDefaults =\n\t\t{\n\t\t\t[\"geo.location\"] = new Dictionary\n\t\t\t{\n\t\t\t\t[\"lat\"] = 48.137154,\n\t\t\t\t[\"lon\"] = 11.576124,\n\t\t\t},\n\t\t},\n\t}\n);\n" language: csharp - 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\n// Score boost depending on payload conditions (as of 1.14.0)\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 formula(\n Formula.newBuilder()\n .setExpression(\n sum(\n SumExpression.newBuilder()\n .addSum(variable(\"$score\"))\n .addSum(\n mult(\n MultExpression.newBuilder()\n .addMult(constant(0.5f))\n .addMult(\n condition(\n matchKeywords(\n \"tag\",\n List.of(\"h1\", \"h2\", \"h3\", \"h4\"))))\n .build()))\n .addSum(mult(MultExpression.newBuilder()\n .addMult(constant(0.25f))\n .addMult(\n condition(\n matchKeywords(\n \"tag\",\n List.of(\"p\", \"li\"))))\n .build()))\n .build()))\n .build()))\n .build())\n .get();\n\n// Score boost geographically closer points (as of 1.14.0)\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 formula(\n Formula.newBuilder()\n .setExpression(\n sum(\n SumExpression.newBuilder()\n .addSum(variable(\"$score\"))\n .addSum(\n expDecay(\n DecayParamsExpression.newBuilder()\n .setX(\n geoDistance(\n GeoDistance.newBuilder()\n .setOrigin(\n GeoPoint.newBuilder()\n .setLat(52.504043)\n .setLon(13.393236)\n .build())\n .setTo(\"geo.location\")\n .build()))\n .setScale(5000)\n .build()))\n .build()))\n .putDefaults(\n \"geo.location\",\n value(\n Map.of(\n \"lat\", value(48.137154),\n \"lon\", value(11.576124))))\n .build()))\n .build())\n .get();\n" - language: java + - 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\n// Score boost depending on payload conditions (as of 1.14.0)\nconst tag_boosted = await client.query(\"{collection_name}\", {\n prefetch: {\n query: [0.2, 0.8, 0.1, 0.9],\n limit: 50\n },\n query: {\n formula: {\n sum: [\n \"$score\",\n {\n mult: [ 0.5, { key: \"tag\", match: { any: [\"h1\", \"h2\", \"h3\", \"h4\"] }} ]\n },\n {\n mult: [ 0.25, { key: \"tag\", match: { any: [\"p\", \"li\"] }} ]\n }\n ]\n }\n }\n});\n\n// Score boost geographically closer points (as of 1.14.0)\nconst distance_boosted = await client.query(\"{collection_name}\", {\n prefetch: {\n query: [0.2, 0.8, ...],\n limit: 50\n },\n query: {\n formula: {\n sum: [\n \"$score\",\n {\n gauss_decay: {\n x: {\n geo_distance: {\n origin: { lat: 52.504043, lon: 13.393236 }, // Berlin\n to: \"geo.location\"\n }\n },\n scale: 5000 // 5km\n }\n }\n ]\n },\n defaults: { \"geo.location\": { lat: 48.137154, lon: 11.576124 } } // Munich\n }\n});\n" + language: typescript + - 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\n# Score boost depending on payload conditions (as of 1.14.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 \"prefetch\": {\n \"query\": [0.2, 0.8, ...], // <-- dense vector\n \"limit\": 50\n }\n \"query\": {\n \"formula\": {\n \"sum\": [\n \"$score,\n { \"mult\": [ 0.5, { \"key\": \"tag\", \"match\": { \"any\": [\"h1\", \"h2\", \"h3\", \"h4\"] } } ] },\n { \"mult\": [ 0.25, { \"key\": \"tag\", \"match\": { \"any\": [\"p\", \"li\"] } } ] }\n ]\n }\n }\n}'\n\n# Score boost geographically closer points (as of 1.14.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 \"prefetch\": { \"query\": [0.2, 0.8, ...], \"limit\": 50 },\n \"query\": {\n \"formula\": {\n \"sum\": [\n \"$score\",\n {\n \"gauss_decay\": {\n \"x\": {\n \"geo_distance\": {\n \"origin\": { \"lat\": 52.504043, \"lon\": 13.393236 } // Berlin\n \"to\": \"geo.location\"\n }\n },\n \"scale\": 5000 // 5km\n }\n }\n ]\n },\n \"defaults\": { \"geo.location\": {\"lat\": 48.137154, \"lon\": 11.576124} } // Munich\n }\n}'\n" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{\n Condition, DecayParamsExpressionBuilder, Expression, FormulaBuilder, Fusion, GeoPoint,\n PointId, PrefetchQueryBuilder, Query, QueryPointsBuilder, RecommendInputBuilder,\n Sample,\n};\nuse qdrant_client::Qdrant;\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(PointId::from(\"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(vec![(1, 0.22), (42, 0.8)])\n .using(\"sparse\")\n .limit(20u64)\n )\n .add_prefetch(PrefetchQueryBuilder::default()\n .query(vec![0.01, 0.45, 0.67])\n .using(\"dense\")\n .limit(20u64)\n )\n .query(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(vec![0.01, 0.45, 0.67])\n .limit(100u64)\n )\n .query(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\n// Score boost depending on payload conditions (as of 1.14.0)\nlet _tag_boosted = client.query(\n QueryPointsBuilder::new(\"{collection_name}\")\n .add_prefetch(PrefetchQueryBuilder::default()\n .query(vec![0.01, 0.45, 0.67])\n .limit(100u64)\n )\n .query(FormulaBuilder::new(Expression::sum_with([\n Expression::score(),\n Expression::mult_with([\n Expression::constant(0.5),\n Expression::condition(Condition::matches(\"tag\", [\"h1\", \"h2\", \"h3\", \"h4\"])),\n ]),\n Expression::mult_with([\n Expression::constant(0.25),\n Expression::condition(Condition::matches(\"tag\", [\"p\", \"li\"])),\n ]),\n ])))\n .limit(10)\n ).await?;\n\n// Score boost geographically closer points (as of 1.14.0)\nlet _geo_boosted = client.query(\n QueryPointsBuilder::new(\"{collection_name}\")\n .add_prefetch(\n PrefetchQueryBuilder::default()\n .query(vec![0.01, 0.45, 0.67])\n .limit(100u64),\n )\n .query(\n FormulaBuilder::new(Expression::sum_with([\n Expression::score(),\n Expression::exp_decay(\n DecayParamsExpressionBuilder::new(Expression::geo_distance_with(\n // Berlin\n GeoPoint { lat: 52.504043, lon: 13.393236 },\n \"geo.location\",\n ))\n .scale(5_000.0),\n ),\n ]))\n // Munich\n .add_default(\"geo.location\", GeoPoint { lat: 48.137154, lon: 11.576124 }),\n )\n .limit(10),\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, ...], # <─┐\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\n# Score boost depending on payload conditions (as of 1.14.0)\ntag_boosted = client.query_points(\n collection_name=\"{collection_name}\",\n prefetch=models.Prefetch(\n query=[0.2, 0.8, ...], # <-- dense vector\n limit=50\n ),\n query=models.FormulaQuery(\n formula=models.SumExpression(sum=[\n \"$score\",\n models.MultExpression(mult=[0.5, models.FieldCondition(key=\"tag\", match=models.MatchAny(any=[\"h1\", \"h2\", \"h3\", \"h4\"]))]),\n models.MultExpression(mult=[0.25, models.FieldCondition(key=\"tag\", match=models.MatchAny(any=[\"p\", \"li\"]))])\n ]\n ))\n)\n\n# Score boost geographically closer points (as of 1.14.0)\ngeo_boosted = client.query_points(\n collection_name=\"{collection_name}\",\n prefetch=models.Prefetch(\n query=[0.2, 0.8, ...], # <-- dense vector\n limit=50\n ),\n query=models.FormulaQuery(\n formula=models.SumExpression(sum=[\n \"$score\",\n models.GaussDecayExpression(\n gauss_decay=models.DecayParamsExpression(\n x=models.GeoDistance(\n geo_distance=models.GeoDistanceParams(\n origin=models.GeoPoint(\n lat=52.504043,\n lon=13.393236\n ), # Berlin\n to=\"geo.location\"\n )\n ),\n scale=5000 # 5km\n )\n )\n ]),\n defaults={\"geo.location\": models.GeoPoint(lat=48.137154, lon=11.576124)} # Munich\n )\n)\n" + language: python 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: @@ -876,14 +876,8 @@ paths: post: x-fern-examples: - 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 - - 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: "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: "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 @@ -891,11 +885,17 @@ paths: - 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: "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: "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: "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 + - code-samples: + - 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 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: @@ -904,14 +904,8 @@ paths: post: x-fern-examples: - 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 - - 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: "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: "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 @@ -919,11 +913,17 @@ paths: - 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: "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: "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: "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 + - code-samples: + - 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 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: @@ -932,14 +932,8 @@ paths: post: x-fern-examples: - 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 - - 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: "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: "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.Common.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 @@ -947,11 +941,17 @@ paths: - 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: "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.Common.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: "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: "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 + - 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 description: 'Returns all points in a page-by-page manner. By default, all resulting points are sorted by {id}. @@ -968,11 +968,8 @@ paths: post: x-fern-examples: - 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 - - code-samples: - - 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: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\nimport io.qdrant.client.grpc.Common.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 @@ -980,11 +977,14 @@ paths: - 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: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\nimport io.qdrant.client.grpc.Common.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: "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: "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 + - code-samples: + - 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 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: @@ -993,11 +993,8 @@ paths: post: x-fern-examples: - 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 - - code-samples: - - 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: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\nimport io.qdrant.client.grpc.Common.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 @@ -1005,11 +1002,14 @@ paths: - 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: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\nimport io.qdrant.client.grpc.Common.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: "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: "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 + - code-samples: + - 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 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: @@ -1018,14 +1018,8 @@ paths: put: x-fern-examples: - 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 - - 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: "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: "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 @@ -1033,11 +1027,17 @@ paths: - 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: "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: "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: "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 + - code-samples: + - 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 description: Updates specified vectors on points. All other unspecified vectors will stay intact. summary: Update vectors tags: @@ -1046,14 +1046,8 @@ paths: post: x-fern-examples: - 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: "# 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: "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: "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 @@ -1069,11 +1063,17 @@ paths: ' language: csharp - 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: "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: "# 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 description: Deletes specified vectors from points. All other unspecified vectors will stay intact. summary: Delete vectors tags: @@ -1081,12 +1081,24 @@ paths: /collections/{collection_name}/shards: put: x-fern-examples: + - 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: "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: "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: "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 - code-samples: - code: 'from qdrant_client import QdrantClient @@ -1098,18 +1110,6 @@ paths: ' language: python - - 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: "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: "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: "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 description: Creates one or more shard keys for a specified collection. summary: Create a shard key tags: @@ -1118,22 +1118,8 @@ paths: post: x-fern-examples: - 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 - - 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: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.delete_shard_key("{collection_name}", "{shard_key}") - -' - language: python + - 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 @@ -1141,32 +1127,14 @@ paths: - 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: "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: "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 - description: Deletes one or more shard keys for a specified collection. - summary: Delete a shard key - tags: - - Distributed - /collections/{collection_name}/snapshots: - get: - x-fern-examples: - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.listSnapshots("{collection_name}"); - -' + - 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: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/snapshots' \\\n --header 'api-key: '" + - 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 - code-samples: - code: 'from qdrant_client import QdrantClient @@ -1174,10 +1142,20 @@ paths: client = QdrantClient(url="http://localhost:6333") - client.list_snapshots(collection_name="{collection_name}") + client.delete_shard_key("{collection_name}", "{shard_key}") ' language: python + description: Deletes one or more shard keys for a specified collection. + summary: Delete a shard key + tags: + - Distributed + /collections/{collection_name}/snapshots: + get: + x-fern-examples: + - 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 @@ -1193,39 +1171,30 @@ paths: ' language: csharp - 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: 'use qdrant_client::Qdrant; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - let client = Qdrant::from_url("http://localhost:6334").build()?; + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.list_snapshots("{collection_name}").await?; + client.listSnapshots("{collection_name}"); ' - language: rust - description: Retrieves a list of all snapshots for a specified collection. - summary: List all snapshots (collection) - tags: - - Snapshots - post: - x-fern-examples: + language: typescript - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - 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; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + let client = Qdrant::from_url("http://localhost:6334").build()?; - client.createSnapshot("{collection_name}"); + client.list_snapshots("{collection_name}").await?; ' - language: typescript - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/snapshots' \\\n --header 'api-key: '" - language: curl + language: rust - code-samples: - code: 'from qdrant_client import QdrantClient @@ -1233,10 +1202,19 @@ paths: client = QdrantClient(url="http://localhost:6333") - client.create_snapshot(collection_name="{collection_name}") + client.list_snapshots(collection_name="{collection_name}") ' language: python + 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 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 @@ -1252,8 +1230,19 @@ paths: ' language: csharp - 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: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.createSnapshot("{collection_name}"); + +' + language: typescript + - 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; @@ -1265,6 +1254,17 @@ paths: ' 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 description: Creates a new snapshot for a specified collection. summary: Create a snapshot (collection) tags: @@ -1299,22 +1299,8 @@ paths: delete: x-fern-examples: - 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 - - 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: "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: "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 @@ -1330,11 +1316,25 @@ paths: ' language: csharp - 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: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.deleteSnapshot("{collection_name}", "{snapshot_name}"); + +' + language: typescript + - 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\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 description: Deletes the specified snapshot for a collection. summary: Delete a snapshot (collection) tags: @@ -1348,30 +1348,8 @@ paths: get: x-fern-examples: - 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: "curl -X GET \\\n 'http://localhost:6333/snapshots' \\\n --header 'api-key: '" - language: curl - - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.list_full_snapshots() - -' - language: python + - 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 @@ -1387,39 +1365,30 @@ paths: ' language: csharp - 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: 'use qdrant_client::Qdrant; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - let client = Qdrant::from_url("http://localhost:6334").build()?; + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.list_full_snapshots().await?; + client.listFullSnapshots(); ' - language: rust - description: Returns a list of all snapshots for the entire storage. - summary: List all snapshots (storage) - tags: - - Snapshots - post: - x-fern-examples: + language: typescript - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: "curl -X GET \\\n 'http://localhost:6333/snapshots' \\\n --header 'api-key: '" + language: curl + - code-samples: + - code: 'use qdrant_client::Qdrant; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + let client = Qdrant::from_url("http://localhost:6334").build()?; - client.createFullSnapshot(); + client.list_full_snapshots().await?; ' - language: typescript - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/snapshots' \\\n --header 'api-key: '" - language: curl + language: rust - code-samples: - code: 'from qdrant_client import QdrantClient @@ -1427,10 +1396,19 @@ paths: client = QdrantClient(url="http://localhost:6333") - client.create_full_snapshot() + client.list_full_snapshots() ' language: python + 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 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 @@ -1446,40 +1424,30 @@ paths: ' language: csharp - 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: 'use qdrant_client::Qdrant; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - let client = Qdrant::from_url("http://localhost:6334").build()?; + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.create_full_snapshot().await?; + client.createFullSnapshot(); ' - language: rust - description: Creates a new snapshot of the entire storage. - summary: Create a snapshot (storage) - tags: - - Snapshots - /snapshots/{snapshot_name}: - delete: - x-fern-examples: + language: typescript - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: "curl -X POST \\\n 'http://localhost:6333/snapshots' \\\n --header 'api-key: '" + language: curl + - code-samples: + - code: 'use qdrant_client::Qdrant; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + let client = Qdrant::from_url("http://localhost:6334").build()?; - client.deleteFullSnapshot("{snapshot_name}"); + client.create_full_snapshot().await?; ' - language: typescript - - code-samples: - - code: "curl -X DELETE \\\n 'http://localhost:6333/snapshots/snapshot_name' \\\n --header 'api-key: '" - language: curl + language: rust - code-samples: - code: 'from qdrant_client import QdrantClient @@ -1487,10 +1455,20 @@ paths: client = QdrantClient(url="http://localhost:6333") - client.delete_full_snapshot(snapshot_name="{snapshot_name}") + client.create_full_snapshot() ' language: python + description: Creates a new snapshot of the entire storage. + summary: Create a snapshot (storage) + tags: + - Snapshots + /snapshots/{snapshot_name}: + delete: + x-fern-examples: + - 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 @@ -1506,8 +1484,19 @@ paths: ' language: csharp - 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: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.deleteFullSnapshot("{snapshot_name}"); + +' + language: typescript + - 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; @@ -1519,6 +1508,17 @@ paths: ' language: rust + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.delete_full_snapshot(snapshot_name="{snapshot_name}") + +' + language: python 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 12ec726..05e3775 100644 --- a/fern/apis/master/openapi.json +++ b/fern/apis/master/openapi.json @@ -583,6 +583,114 @@ } } }, + "/collections/{collection_name}/points/query": { + "post": { + "tags": [ + "Search" + ], + "summary": "Query points", + "description": "Universally query points. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries.", + "operationId": "query_points", + "requestBody": { + "description": "Describes the query to make to the collection", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueryRequest" + } + } + } + }, + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the collection to query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "consistency", + "in": "query", + "description": "Define read consistency guarantees for the operation", + "required": false, + "schema": { + "$ref": "#/components/schemas/ReadConsistency" + } + }, + { + "name": "timeout", + "in": "query", + "description": "If set, overrides global timeout for this request. Unit is seconds.", + "required": false, + "schema": { + "type": "integer", + "minimum": 1 + } + } + ], + "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": { + "usage": { + "default": null, + "anyOf": [ + { + "$ref": "#/components/schemas/Usage" + }, + { + "nullable": true + } + ] + }, + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request", + "example": 0.002 + }, + "status": { + "type": "string", + "example": "ok" + }, + "result": { + "$ref": "#/components/schemas/QueryResponse" + } + } + } + } + } + } + } + } + }, "/collections/{collection_name}/index": { "put": { "tags": [ @@ -4451,6 +4559,16 @@ "schema": { "$ref": "#/components/schemas/ReadConsistency" } + }, + { + "name": "timeout", + "in": "query", + "description": "If set, overrides global timeout for this request. Unit is seconds.", + "required": false, + "schema": { + "type": "integer", + "minimum": 1 + } } ], "responses": { @@ -5774,114 +5892,6 @@ } } }, - "/collections/{collection_name}/points/query": { - "post": { - "tags": [ - "Search" - ], - "summary": "Query points", - "description": "Universally query points. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries.", - "operationId": "query_points", - "requestBody": { - "description": "Describes the query to make to the collection", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QueryRequest" - } - } - } - }, - "parameters": [ - { - "name": "collection_name", - "in": "path", - "description": "Name of the collection to query", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "consistency", - "in": "query", - "description": "Define read consistency guarantees for the operation", - "required": false, - "schema": { - "$ref": "#/components/schemas/ReadConsistency" - } - }, - { - "name": "timeout", - "in": "query", - "description": "If set, overrides global timeout for this request. Unit is seconds.", - "required": false, - "schema": { - "type": "integer", - "minimum": 1 - } - } - ], - "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": { - "usage": { - "default": null, - "anyOf": [ - { - "$ref": "#/components/schemas/Usage" - }, - { - "nullable": true - } - ] - }, - "time": { - "type": "number", - "format": "float", - "description": "Time spent to process this request", - "example": 0.002 - }, - "status": { - "type": "string", - "example": "ok" - }, - "result": { - "$ref": "#/components/schemas/QueryResponse" - } - } - } - } - } - } - } - } - }, "/collections/{collection_name}/points/query/batch": { "post": { "tags": [ @@ -6766,6 +6776,7 @@ "description": "Size of a vectors used", "type": "integer", "format": "uint64", + "maximum": 65536, "minimum": 1 }, "distance": { @@ -11839,6 +11850,11 @@ "default": true, "type": "boolean" }, + "async_hnsw_graph": { + "description": "Allow the batched io_uring-based HNSW graph search. When disabled, the HNSW graph is *never* opened on io_uring. When enabled, the graph backend is decided based on `storage.performance.io_uring` option and links placement.", + "default": false, + "type": "boolean" + }, "write_segment_manifest": { "description": "Write a segment manifest (`segments_manifest.json`, next to the `segments/` directory) listing the shard's segments and their state, so out-of-process readers can discover segments without scanning the filesystem.", "default": false, @@ -11854,8 +11870,23 @@ "default": false, "type": "boolean" }, + "append_only_storages": { + "description": "Create Blobstore-backed storages (payload storage, appendable field indexes, sparse vectors) in the append-only Logstore mode. Gates creation only: an existing storage keeps its persisted mode, and both modes are always readable.\n\nImplies [`Self::append_only_mutations`], enforced by [`init_feature_flags`].", + "default": false, + "type": "boolean" + }, + "transfer_raw_points": { + "description": "Transfer points as storage-native bytes (raw points), for every collection rather than only those whose vector storage would lose precision in a decode-encode round-trip (TurboQuant).\n\nRead on the sending side only, where the transfer batch is prepared: nodes accept raw points regardless.", + "default": false, + "type": "boolean" + }, + "transfer_raw_payloads": { + "description": "Send the payload of a raw point as the byte blob it is stored as, so the sending node does not parse it and neither node builds a protobuf value tree for it. The receiving node still parses the blob, once, when the operation is applied. Only has an effect on points transferred raw, see [`Self::transfer_raw_points`].\n\nRead on the sending side only: nodes accept raw payloads regardless.", + "default": false, + "type": "boolean" + }, "serverless_compatible": { - "description": "Serverless-compatible deployment mode. Automatically enables [`Self::write_segment_manifest`], [`Self::append_only_mutations`] and [`Self::compact_bitmask`].\n\nNote that this will only be applied when passed into [`init_feature_flags`].", + "description": "Serverless-compatible deployment mode. Automatically enables [`Self::write_segment_manifest`], [`Self::append_only_mutations`], [`Self::compact_bitmask`] and [`Self::append_only_storages`].\n\nNote that this will only be applied when passed into [`init_feature_flags`].", "default": false, "type": "boolean" } @@ -11903,6 +11934,7 @@ "RunningEnvironmentTelemetry": { "type": "object", "required": [ + "container_runtime", "cpu_flags", "is_docker" ], @@ -11918,6 +11950,9 @@ "is_docker": { "type": "boolean" }, + "container_runtime": { + "$ref": "#/components/schemas/ContainerRuntime" + }, "cores": { "type": "integer", "format": "uint", @@ -11966,6 +12001,16 @@ } } }, + "ContainerRuntime": { + "description": "Container runtime Qdrant is running under (`none` if bare metal).", + "type": "string", + "enum": [ + "none", + "docker", + "kubernetes", + "other" + ] + }, "CpuEndian": { "type": "string", "enum": [ @@ -14188,7 +14233,7 @@ "format": "uri" }, "priority": { - "description": "Defines which data should be used as a source of truth if there are other replicas in the cluster. If set to `Snapshot`, the snapshot will be used as a source of truth, and the current state will be overwritten. If set to `Replica`, the current state will be used as a source of truth, and after recovery if will be synchronized with the snapshot.", + "description": "Defines which data should be used as a source of truth if there are other replicas in the cluster. If set to `Snapshot`, the snapshot will be used as a source of truth, and the current state will be overwritten. If set to `Replica`, the current state will be used as a source of truth, and after recovery it will be synchronized from other replicas.", "default": null, "anyOf": [ { @@ -15226,6 +15271,12 @@ { "$ref": "#/components/schemas/SumExpression" }, + { + "$ref": "#/components/schemas/MaxExpression" + }, + { + "$ref": "#/components/schemas/MinExpression" + }, { "$ref": "#/components/schemas/NegExpression" }, @@ -15250,6 +15301,9 @@ { "$ref": "#/components/schemas/LnExpression" }, + { + "$ref": "#/components/schemas/AcoshExpression" + }, { "$ref": "#/components/schemas/LinDecayExpression" }, @@ -15338,6 +15392,36 @@ } } }, + "MaxExpression": { + "description": "Largest of the given expressions. Requires at least one operand.", + "type": "object", + "required": [ + "max" + ], + "properties": { + "max": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Expression" + } + } + } + }, + "MinExpression": { + "description": "Smallest of the given expressions. Requires at least one operand.", + "type": "object", + "required": [ + "min" + ], + "properties": { + "min": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Expression" + } + } + } + }, "NegExpression": { "type": "object", "required": [ @@ -15461,6 +15545,17 @@ } } }, + "AcoshExpression": { + "type": "object", + "required": [ + "acosh" + ], + "properties": { + "acosh": { + "$ref": "#/components/schemas/Expression" + } + } + }, "LinDecayExpression": { "type": "object", "required": [ diff --git a/fern/apis/v1.19.x/openapi-overrides.yml b/fern/apis/v1.19.x/openapi-overrides.yml index 1f38ac4..f635c3f 100644 --- a/fern/apis/v1.19.x/openapi-overrides.yml +++ b/fern/apis/v1.19.x/openapi-overrides.yml @@ -18,31 +18,10 @@ paths: - Aliases x-fern-examples: - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.getAliases(); - - ' - language: typescript - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/aliases' \\\n --header\ - \ 'api-key: '" - language: curl - - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.get_aliases() - - ' - language: python + - 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\ @@ -63,10 +42,20 @@ paths: ' language: csharp - 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: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.getAliases(); + + ' + language: typescript + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/aliases' \\\n --header\ + \ 'api-key: '" + language: curl - code-samples: - code: 'use qdrant_client::Qdrant; @@ -78,6 +67,17 @@ paths: ' language: rust + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.get_aliases() + + ' + language: python /cluster: get: description: Returns information about the cluster's current state and composition. @@ -105,6 +105,30 @@ paths: tags: - Collections x-fern-examples: + - 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: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ListCollectionsAsync(); + + ' + language: csharp - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -120,6 +144,17 @@ paths: - 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 @@ -131,13 +166,32 @@ paths: ' language: python + /collections/aliases: + post: + description: Updates aliases for the specified collections. + summary: Update collection aliases + tags: + - Aliases + x-fern-examples: - 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\ + - 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\tcollections, err := client.ListCollections(context.Background())\n\ - \tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Collections: \"\ - , collections)\n}\n" + \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: 'using Qdrant.Client; @@ -146,33 +200,14 @@ paths: var client = new QdrantClient("localhost", 6334); - await client.ListCollectionsAsync(); - - ' - language: csharp - - 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: 'use qdrant_client::Qdrant; - - - let client = Qdrant::from_url("http://localhost:6334").build()?; + await client.CreateAliasAsync(aliasName: "production_collection", collectionName: + "example_collection"); - client.list_collections().await?; + await client.DeleteAliasAsync("production_collection"); ' - language: rust - /collections/aliases: - post: - description: Updates aliases for the specified collections. - summary: Update collection aliases - tags: - - Aliases - x-fern-examples: + language: csharp - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ @@ -199,6 +234,14 @@ 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\ @@ -209,16 +252,25 @@ paths: \ delete_alias=models.DeleteAlias(alias_name=\"production_collection\"\ )\n ),\n ]\n)\n" language: python + /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: "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 updateAlias() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \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.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" + \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 - code-samples: - code: 'using Qdrant.Client; @@ -227,38 +279,10 @@ paths: var client = new QdrantClient("localhost", 6334); - await client.CreateAliasAsync(aliasName: "production_collection", collectionName: - "example_collection"); - - - await client.DeleteAliasAsync("production_collection"); + await client.DeleteCollectionAsync("{collection_name}"); ' language: csharp - - 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: "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 - /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: 'import { QdrantClient } from ''@qdrant/qdrant-js''; @@ -274,6 +298,17 @@ paths: - 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 @@ -285,12 +320,25 @@ paths: ' language: python + get: + description: Retrieves parameters from the specified collection. + summary: Get collection details + tags: + - Collections + x-fern-examples: - 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\ + - 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\terr = client.DeleteCollection(context.Background(),\ - \ \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + \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: 'using Qdrant.Client; @@ -299,41 +347,18 @@ paths: var client = new QdrantClient("localhost", 6334); - await client.DeleteCollectionAsync("{collection_name}"); + await client.GetCollectionInfoAsync("{collection_name}"); ' language: csharp - 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: 'use qdrant_client::Qdrant; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - let client = Qdrant::from_url("http://localhost:6334").build()?; + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.delete_collection("{collection_name}").await?; - - ' - language: rust - get: - description: Retrieves parameters from the specified collection. - summary: Get collection details - tags: - - Collections - x-fern-examples: - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.getCollection("{collection_name}"); + client.getCollection("{collection_name}"); ' language: typescript @@ -342,52 +367,27 @@ paths: \ \\\n --header 'api-key: '" language: curl - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.get_collection("{collection_name}") - - ' - language: python - - 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: 'using Qdrant.Client; + - code: 'use qdrant_client::Qdrant; - var client = new QdrantClient("localhost", 6334); + let client = Qdrant::from_url("http://localhost:6334").build()?; - await client.GetCollectionInfoAsync("{collection_name}"); + client.collection_info("{collection_name}").await?; ' - language: csharp - - 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 + language: rust - code-samples: - - code: 'use qdrant_client::Qdrant; + - code: 'from qdrant_client import QdrantClient - let client = Qdrant::from_url("http://localhost:6334").build()?; + client = QdrantClient(url="http://localhost:6333") - client.collection_info("{collection_name}").await?; + client.get_collection("{collection_name}") ' - language: rust + language: python patch: description: Updates the parameters of the specified collection. summary: Update collection parameters @@ -395,23 +395,16 @@ paths: - Collections x-fern-examples: - 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: "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: "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: "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\ @@ -429,16 +422,17 @@ paths: \ { IndexingThreshold = 10000 }\n);\n" language: csharp - 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: "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: "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\"\ @@ -446,6 +440,12 @@ paths: {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 put: description: Creates a new collection with the given parameters. summary: Create a collection @@ -453,33 +453,20 @@ paths: - Collections x-fern-examples: - 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: "# 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 },\n\ - \ \"sparse_vectors\": {\n \"sparse-vector-name\": {\n \"index\"\ - : {\n \"on_disk\": true\n }\n }\n }\n}'\n" - language: curl - - 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: "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\ @@ -501,20 +488,27 @@ paths: \ OnDisk = false,\n }\n })\n);" language: csharp - 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: "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: "# 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 },\n\ + \ \"sparse_vectors\": {\n \"sparse-vector-name\": {\n \"index\"\ + : {\n \"on_disk\": true\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\"\ @@ -522,6 +516,12 @@ paths: {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 /collections/{collection_name}/aliases: get: description: Retrieves a list of all aliases for the specified collection. @@ -530,31 +530,11 @@ paths: - Aliases x-fern-examples: - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.getCollectionAliases("{collection_name}"); - - ' - language: typescript - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/aliases'\ - \ \\\n --header 'api-key: '" - language: curl - - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.get_collection_aliases("{collection_name}") - - ' - language: python + - 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\ @@ -575,11 +555,20 @@ paths: ' language: csharp - 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: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.getCollectionAliases("{collection_name}"); + + ' + language: typescript + - 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; @@ -591,6 +580,17 @@ paths: ' language: rust + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.get_collection_aliases("{collection_name}") + + ' + language: python /collections/{collection_name}/cluster: get: description: Retrieves cluster details for a specified collection. @@ -610,29 +610,22 @@ paths: - Collections x-fern-examples: - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'import static io.qdrant.client.ConditionFactory.matchKeyword; - const client = new QdrantClient({ host: "localhost", port: 6333 }); - + import io.qdrant.client.QdrantClient; - client.collectionExists("{collection_name}"); + import io.qdrant.client.QdrantGrpcClient; - ' - language: typescript - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/exists'\ - \ \\\n --header 'api-key: '" - language: curl - - code-samples: - - code: 'from qdrant_client import QdrantClient + QdrantClient client = new QdrantClient(QdrantGrpcClient.newBuilder("localhost", + 6334, false).build()); - client = QdrantClient(url="http://localhost:6333") + client.collectionExistsAsync("{collection_name}").get(); - client.collection_exists(collection_name="{collection_name}")' - language: python + ' + 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 collectionExists() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -653,22 +646,20 @@ paths: ' language: csharp - code-samples: - - code: 'import static io.qdrant.client.ConditionFactory.matchKeyword; - - - import io.qdrant.client.QdrantClient; - - import io.qdrant.client.QdrantGrpcClient; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - QdrantClient client = new QdrantClient(QdrantGrpcClient.newBuilder("localhost", - 6334, false).build()); + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.collectionExistsAsync("{collection_name}").get(); + client.collectionExists("{collection_name}"); ' - language: java + language: typescript + - 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; @@ -680,6 +671,15 @@ paths: ' language: rust + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.collection_exists(collection_name="{collection_name}")' + language: python /collections/{collection_name}/facet: post: description: Retrieves facets for the specified payload field. @@ -688,20 +688,17 @@ paths: - Points x-fern-examples: - 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 - - code-samples: - - 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: "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\ @@ -721,17 +718,14 @@ paths: key: \"my-payload-key\",\n\tlimit: 10\n);" language: csharp - 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: "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: "use qdrant_client::qdrant::{Condition, FacetCountsBuilder, Filter};\n\ use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ @@ -741,6 +735,12 @@ paths: \ \"color\",\n \"red\".to_string(),\n \ \ )])),\n )\n .await?;" language: rust + - code-samples: + - 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 /collections/{collection_name}/index: put: description: Creates a payload index for a field in the specified collection. @@ -749,23 +749,14 @@ paths: - Indexes x-fern-examples: - 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: "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: "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: "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\ @@ -782,14 +773,17 @@ paths: {collection_name}\",\n fieldName: \"name_of_the_field_to_index\"\n);\n" language: csharp - 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: "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: "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\"\ @@ -797,6 +791,12 @@ paths: \ \"{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 /collections/{collection_name}/index/{field_name}: delete: description: Deletes a payload index for a field in the specified collection. @@ -804,6 +804,26 @@ paths: tags: - Indexes x-fern-examples: + - 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 + - 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: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -819,6 +839,13 @@ paths: - 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 @@ -830,33 +857,6 @@ paths: ' language: python - - 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 - - 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: "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: "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 /collections/{collection_name}/points: post: description: Retrieves all details from multiple points. @@ -865,21 +865,12 @@ paths: - Points x-fern-examples: - 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: "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: "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: "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\ @@ -897,18 +888,27 @@ paths: );\n" language: csharp - 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: "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: "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 put: description: Performs the insert + update action on specified points. Any point with an existing {id} will be overwritten. @@ -917,40 +917,26 @@ paths: - Points x-fern-examples: - 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: "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: "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: "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\ @@ -981,26 +967,28 @@ paths: ] = \"blue\" }\n }\n }\n);\n" language: csharp - 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: "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: "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\ @@ -1021,6 +1009,18 @@ paths: \ ),\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 /collections/{collection_name}/points/batch: post: description: Batch updates points, including their respective vectors and payloads. @@ -1029,55 +1029,40 @@ paths: - Points x-fern-examples: - 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 - - 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: "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: "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\ + \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;\n\ + import io.qdrant.client.grpc.Points.PointsIdsList;\nimport io.qdrant.client.grpc.Points.PointsSelector;\n\ + import io.qdrant.client.grpc.Points.PointsUpdateOperation;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation.PointStructList;\n\ + import io.qdrant.client.grpc.Points.PointsUpdateOperation.SetPayload;\n\ + import 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\ @@ -1113,40 +1098,37 @@ paths: ] = 2, [\"test_payload_3\"] = 3 }\n }\n }\n ]\n);\n" language: csharp - 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\ - \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;\n\ - import io.qdrant.client.grpc.Points.PointsIdsList;\nimport io.qdrant.client.grpc.Points.PointsSelector;\n\ - import io.qdrant.client.grpc.Points.PointsUpdateOperation;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation.PointStructList;\n\ - import io.qdrant.client.grpc.Points.PointsUpdateOperation.SetPayload;\n\ - import 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: "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: "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,\ @@ -1179,40 +1161,39 @@ paths: \ })),\n },\n ],\n )\n \ \ .wait(true),\n )\n .await?;\n" language: rust - /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: "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: "# 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: "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" + - 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 + /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: "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.Common.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\ @@ -1230,13 +1211,25 @@ paths: , \"red\"),\n exact: true\n);\n" language: csharp - 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.Common.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: "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: "# 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\"\ @@ -1245,6 +1238,13 @@ paths: \ \"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 /collections/{collection_name}/points/delete: post: description: Deletes specified points from the collection. @@ -1253,35 +1253,16 @@ paths: - Points x-fern-examples: - 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: "# 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: "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: "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.Common.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\ @@ -1312,16 +1293,25 @@ paths: ' language: csharp - 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.Common.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: "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: "# 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(\"\ @@ -1334,6 +1324,16 @@ paths: \ \"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 /collections/{collection_name}/points/discover: {} /collections/{collection_name}/points/discover/batch: {} /collections/{collection_name}/points/payload: @@ -1343,6 +1343,35 @@ paths: tags: - Points x-fern-examples: + - 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: "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: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ @@ -1364,6 +1393,17 @@ 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=\"\ @@ -1371,52 +1411,40 @@ paths: ,\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n\ )\n" language: python + 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: "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\ + - 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\ + import 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\tresults, err := client.SetPayload(context.Background(),\ + \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\tfmt.Println(\"Results:\ - \ \", results)\n}\n" + \t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.SetPayloadAsync(\n\ + \ 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: "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: "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 - 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: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ @@ -1437,41 +1465,6 @@ paths: \ \"must\": [\n {\n \"key\": \"color\",\n \"match\"\ : {\n \"value\": \"red\"\n }\n }\n ]\n }\n}'" language: curl - - 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: "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: "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: "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\ - import 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: "use qdrant_client::qdrant::{\n points_selector::PointsSelectorOneOf,\ \ PointsIdsList, SetPayloadPointsBuilder,\n};\nuse qdrant_client::{Qdrant,\ @@ -1483,6 +1476,13 @@ paths: \ {\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 /collections/{collection_name}/points/payload/clear: post: description: Removes the entire payload for specified points. @@ -1491,22 +1491,12 @@ paths: - Points x-fern-examples: - 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: "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: "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: "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\ @@ -1529,12 +1519,17 @@ paths: ' language: csharp - 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: "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: "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\"\ @@ -1542,6 +1537,11 @@ paths: {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 /collections/{collection_name}/points/payload/delete: post: description: Deletes a specified key payload for points. @@ -1550,29 +1550,14 @@ paths: - Points x-fern-examples: - 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: "# 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: "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: "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\ @@ -1596,14 +1581,23 @@ paths: ' language: csharp - 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: "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: "# 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\"\ @@ -1613,6 +1607,12 @@ paths: \ {\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 /collections/{collection_name}/points/query: post: description: Universally query points. This endpoint covers all capabilities @@ -1623,148 +1623,103 @@ paths: - Search x-fern-examples: - 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\n// Score boost depending on payload\ - \ conditions (as of 1.14.0)\nconst tag_boosted = await client.query(\"\ - {collection_name}\", {\n prefetch: {\n query: [0.2, 0.8, 0.1, 0.9],\n\ - \ limit: 50\n },\n query: {\n formula: {\n sum: [\n \ - \ \"$score\",\n {\n mult: [ 0.5, { key: \"tag\", match:\ - \ { any: [\"h1\", \"h2\", \"h3\", \"h4\"] }} ]\n },\n {\n\ - \ mult: [ 0.25, { key: \"tag\", match: { any: [\"p\", \"li\"\ - ] }} ]\n }\n ]\n }\n }\n});\n\n// Score boost geographically\ - \ closer points (as of 1.14.0)\nconst distance_boosted = await client.query(\"\ - {collection_name}\", {\n prefetch: {\n query: [0.2, 0.8, ...],\n \ - \ limit: 50\n },\n query: {\n formula: {\n sum: [\n \ - \ \"$score\",\n {\n gauss_decay: {\n x: {\n\ - \ geo_distance: {\n origin: { lat: 52.504043,\ - \ lon: 13.393236 }, // Berlin\n to: \"geo.location\"\n\ - \ }\n },\n scale: 5000 // 5km\n \ - \ }\n }\n ]\n },\n defaults: { \"geo.location\"\ - : { lat: 48.137154, lon: 11.576124 } } // Munich\n }\n});\n" - language: typescript - - 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\n# Score boost depending on payload conditions\ - \ (as of 1.14.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 \"prefetch\": {\n \ - \ \"query\": [0.2, 0.8, ...], // <-- dense vector\n \"limit\"\ - : 50\n }\n \"query\": {\n \"formula\": {\n \"\ - sum\": [\n \"$score,\n { \"mult\": [ 0.5,\ - \ { \"key\": \"tag\", \"match\": { \"any\": [\"h1\", \"h2\", \"h3\", \"\ - h4\"] } } ] },\n { \"mult\": [ 0.25, { \"key\": \"tag\"\ - , \"match\": { \"any\": [\"p\", \"li\"] } } ] }\n ]\n \ - \ }\n }\n}'\n\n# Score boost geographically closer points (as of\ - \ 1.14.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 \"prefetch\": { \"query\"\ - : [0.2, 0.8, ...], \"limit\": 50 },\n \"query\": {\n \"formula\"\ - : {\n \"sum\": [\n \"$score\",\n \ - \ {\n \"gauss_decay\": {\n \ - \ \"x\": {\n \"geo_distance\": {\n \ - \ \"origin\": { \"lat\": 52.504043, \"lon\"\ - : 13.393236 } // Berlin\n \"to\": \"geo.location\"\ - \n }\n },\n \ - \ \"scale\": 5000 // 5km\n }\n \ - \ }\n ]\n },\n \"defaults\": { \"geo.location\"\ - : {\"lat\": 48.137154, \"lon\": 11.576124} } // Munich\n }\n}'\n" - language: curl - - 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\n# Score boost depending on payload conditions (as of 1.14.0)\ntag_boosted\ - \ = client.query_points(\n collection_name=\"{collection_name}\",\n\ - \ prefetch=models.Prefetch(\n query=[0.2, 0.8, ...], # <--\ - \ dense vector\n limit=50\n ),\n query=models.FormulaQuery(\n\ - \ formula=models.SumExpression(sum=[\n \"$score\",\n\ - \ models.MultExpression(mult=[0.5, models.FieldCondition(key=\"\ - tag\", match=models.MatchAny(any=[\"h1\", \"h2\", \"h3\", \"h4\"]))]),\n\ - \ models.MultExpression(mult=[0.25, models.FieldCondition(key=\"\ - tag\", match=models.MatchAny(any=[\"p\", \"li\"]))])\n ]\n ))\n\ - )\n\n# Score boost geographically closer points (as of 1.14.0)\ngeo_boosted\ - \ = client.query_points(\n collection_name=\"{collection_name}\",\n\ - \ prefetch=models.Prefetch(\n query=[0.2, 0.8, ...], # <--\ - \ dense vector\n limit=50\n ),\n query=models.FormulaQuery(\n\ - \ formula=models.SumExpression(sum=[\n \"$score\",\n\ - \ models.GaussDecayExpression(\n gauss_decay=models.DecayParamsExpression(\n\ - \ x=models.GeoDistance(\n geo_distance=models.GeoDistanceParams(\n\ - \ origin=models.GeoPoint(\n \ - \ lat=52.504043,\n lon=13.393236\n\ - \ ), # Berlin\n \ - \ to=\"geo.location\"\n )\n \ - \ ),\n scale=5000 # 5km\n )\n \ - \ )\n ]),\n defaults={\"geo.location\": models.GeoPoint(lat=48.137154,\ - \ lon=11.576124)} # Munich\n )\n)\n" - language: python + - code: "import static io.qdrant.client.QueryFactory.fusion;\nimport static\ + \ io.qdrant.client.QueryFactory.nearest;\nimport static io.qdrant.client.QueryFactory.recommend;\n\ + import static io.qdrant.client.VectorInputFactory.vectorInput;\n\nimport\ + \ java.util.UUID;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + import io.qdrant.client.grpc.Points.Fusion;\nimport io.qdrant.client.grpc.Points.PrefetchQuery;\n\ + import 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)\n\ + client\n .queryAsync(\n QueryPoints.newBuilder()\n \ + \ .setCollectionName(\"{collection_name}\")\n .setQuery(sample(Sample.Random))\n\ + \ .build())\n .get();\n\n// Score boost depending on payload\ + \ conditions (as of 1.14.0)\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 formula(\n \ + \ Formula.newBuilder()\n .setExpression(\n\ + \ sum(\n SumExpression.newBuilder()\n\ + \ .addSum(variable(\"$score\"))\n \ + \ .addSum(\n \ + \ mult(\n MultExpression.newBuilder()\n\ + \ .addMult(constant(0.5f))\n\ + \ .addMult(\n \ + \ condition(\n \ + \ matchKeywords(\n \ + \ \"tag\",\n \ + \ List.of(\"h1\",\ + \ \"h2\", \"h3\", \"h4\"))))\n \ + \ .build()))\n .addSum(mult(MultExpression.newBuilder()\n\ + \ .addMult(constant(0.25f))\n \ + \ .addMult(\n \ + \ condition(\n \ + \ matchKeywords(\n \"\ + tag\",\n List.of(\"p\"\ + , \"li\"))))\n .build()))\n \ + \ .build()))\n .build()))\n\ + \ .build())\n .get();\n\n// Score boost geographically closer\ + \ points (as of 1.14.0)\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 formula(\n \ + \ Formula.newBuilder()\n .setExpression(\n\ + \ sum(\n SumExpression.newBuilder()\n\ + \ .addSum(variable(\"$score\"))\n \ + \ .addSum(\n \ + \ expDecay(\n \ + \ DecayParamsExpression.newBuilder()\n \ + \ .setX(\n \ + \ geoDistance(\n \ + \ GeoDistance.newBuilder()\n \ + \ .setOrigin(\n \ + \ GeoPoint.newBuilder()\n \ + \ .setLat(52.504043)\n\ + \ .setLon(13.393236)\n\ + \ .build())\n\ + \ .setTo(\"\ + geo.location\")\n \ + \ .build()))\n .setScale(5000)\n\ + \ .build()))\n \ + \ .build()))\n .putDefaults(\n\ + \ \"geo.location\",\n \ + \ value(\n Map.of(\n \ + \ \"lat\", value(48.137154),\n \ + \ \"lon\", value(11.576124))))\n \ + \ .build()))\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\ @@ -1872,103 +1827,101 @@ paths: \t\t\t\t[\"lon\"] = 11.576124,\n\t\t\t},\n\t\t},\n\t}\n);\n" language: csharp - 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\ - import static io.qdrant.client.VectorInputFactory.vectorInput;\n\nimport\ - \ java.util.UUID;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - import io.qdrant.client.grpc.Points.Fusion;\nimport io.qdrant.client.grpc.Points.PrefetchQuery;\n\ - import 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)\n\ - client\n .queryAsync(\n QueryPoints.newBuilder()\n \ - \ .setCollectionName(\"{collection_name}\")\n .setQuery(sample(Sample.Random))\n\ - \ .build())\n .get();\n\n// Score boost depending on payload\ - \ conditions (as of 1.14.0)\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 formula(\n \ - \ Formula.newBuilder()\n .setExpression(\n\ - \ sum(\n SumExpression.newBuilder()\n\ - \ .addSum(variable(\"$score\"))\n \ - \ .addSum(\n \ - \ mult(\n MultExpression.newBuilder()\n\ - \ .addMult(constant(0.5f))\n\ - \ .addMult(\n \ - \ condition(\n \ - \ matchKeywords(\n \ - \ \"tag\",\n \ - \ List.of(\"h1\",\ - \ \"h2\", \"h3\", \"h4\"))))\n \ - \ .build()))\n .addSum(mult(MultExpression.newBuilder()\n\ - \ .addMult(constant(0.25f))\n \ - \ .addMult(\n \ - \ condition(\n \ - \ matchKeywords(\n \"\ - tag\",\n List.of(\"p\"\ - , \"li\"))))\n .build()))\n \ - \ .build()))\n .build()))\n\ - \ .build())\n .get();\n\n// Score boost geographically closer\ - \ points (as of 1.14.0)\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 formula(\n \ - \ Formula.newBuilder()\n .setExpression(\n\ - \ sum(\n SumExpression.newBuilder()\n\ - \ .addSum(variable(\"$score\"))\n \ - \ .addSum(\n \ - \ expDecay(\n \ - \ DecayParamsExpression.newBuilder()\n \ - \ .setX(\n \ - \ geoDistance(\n \ - \ GeoDistance.newBuilder()\n \ - \ .setOrigin(\n \ - \ GeoPoint.newBuilder()\n \ - \ .setLat(52.504043)\n\ - \ .setLon(13.393236)\n\ - \ .build())\n\ - \ .setTo(\"\ - geo.location\")\n \ - \ .build()))\n .setScale(5000)\n\ - \ .build()))\n \ - \ .build()))\n .putDefaults(\n\ - \ \"geo.location\",\n \ - \ value(\n Map.of(\n \ - \ \"lat\", value(48.137154),\n \ - \ \"lon\", value(11.576124))))\n \ - \ .build()))\n .build())\n .get();\n" - language: java + - 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\n// Score boost depending on payload\ + \ conditions (as of 1.14.0)\nconst tag_boosted = await client.query(\"\ + {collection_name}\", {\n prefetch: {\n query: [0.2, 0.8, 0.1, 0.9],\n\ + \ limit: 50\n },\n query: {\n formula: {\n sum: [\n \ + \ \"$score\",\n {\n mult: [ 0.5, { key: \"tag\", match:\ + \ { any: [\"h1\", \"h2\", \"h3\", \"h4\"] }} ]\n },\n {\n\ + \ mult: [ 0.25, { key: \"tag\", match: { any: [\"p\", \"li\"\ + ] }} ]\n }\n ]\n }\n }\n});\n\n// Score boost geographically\ + \ closer points (as of 1.14.0)\nconst distance_boosted = await client.query(\"\ + {collection_name}\", {\n prefetch: {\n query: [0.2, 0.8, ...],\n \ + \ limit: 50\n },\n query: {\n formula: {\n sum: [\n \ + \ \"$score\",\n {\n gauss_decay: {\n x: {\n\ + \ geo_distance: {\n origin: { lat: 52.504043,\ + \ lon: 13.393236 }, // Berlin\n to: \"geo.location\"\n\ + \ }\n },\n scale: 5000 // 5km\n \ + \ }\n }\n ]\n },\n defaults: { \"geo.location\"\ + : { lat: 48.137154, lon: 11.576124 } } // Munich\n }\n});\n" + language: typescript + - 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\n# Score boost depending on payload conditions\ + \ (as of 1.14.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 \"prefetch\": {\n \ + \ \"query\": [0.2, 0.8, ...], // <-- dense vector\n \"limit\"\ + : 50\n }\n \"query\": {\n \"formula\": {\n \"\ + sum\": [\n \"$score,\n { \"mult\": [ 0.5,\ + \ { \"key\": \"tag\", \"match\": { \"any\": [\"h1\", \"h2\", \"h3\", \"\ + h4\"] } } ] },\n { \"mult\": [ 0.25, { \"key\": \"tag\"\ + , \"match\": { \"any\": [\"p\", \"li\"] } } ] }\n ]\n \ + \ }\n }\n}'\n\n# Score boost geographically closer points (as of\ + \ 1.14.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 \"prefetch\": { \"query\"\ + : [0.2, 0.8, ...], \"limit\": 50 },\n \"query\": {\n \"formula\"\ + : {\n \"sum\": [\n \"$score\",\n \ + \ {\n \"gauss_decay\": {\n \ + \ \"x\": {\n \"geo_distance\": {\n \ + \ \"origin\": { \"lat\": 52.504043, \"lon\"\ + : 13.393236 } // Berlin\n \"to\": \"geo.location\"\ + \n }\n },\n \ + \ \"scale\": 5000 // 5km\n }\n \ + \ }\n ]\n },\n \"defaults\": { \"geo.location\"\ + : {\"lat\": 48.137154, \"lon\": 11.576124} } // Munich\n }\n}'\n" + language: curl - code-samples: - code: "use qdrant_client::qdrant::{\n Condition, DecayParamsExpressionBuilder,\ \ Expression, FormulaBuilder, Fusion, GeoPoint,\n PointId, PrefetchQueryBuilder,\ @@ -2022,6 +1975,53 @@ paths: \ lon: 11.576124 }),\n )\n .limit(10),\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\n# Score boost depending on payload conditions (as of 1.14.0)\ntag_boosted\ + \ = client.query_points(\n collection_name=\"{collection_name}\",\n\ + \ prefetch=models.Prefetch(\n query=[0.2, 0.8, ...], # <--\ + \ dense vector\n limit=50\n ),\n query=models.FormulaQuery(\n\ + \ formula=models.SumExpression(sum=[\n \"$score\",\n\ + \ models.MultExpression(mult=[0.5, models.FieldCondition(key=\"\ + tag\", match=models.MatchAny(any=[\"h1\", \"h2\", \"h3\", \"h4\"]))]),\n\ + \ models.MultExpression(mult=[0.25, models.FieldCondition(key=\"\ + tag\", match=models.MatchAny(any=[\"p\", \"li\"]))])\n ]\n ))\n\ + )\n\n# Score boost geographically closer points (as of 1.14.0)\ngeo_boosted\ + \ = client.query_points(\n collection_name=\"{collection_name}\",\n\ + \ prefetch=models.Prefetch(\n query=[0.2, 0.8, ...], # <--\ + \ dense vector\n limit=50\n ),\n query=models.FormulaQuery(\n\ + \ formula=models.SumExpression(sum=[\n \"$score\",\n\ + \ models.GaussDecayExpression(\n gauss_decay=models.DecayParamsExpression(\n\ + \ x=models.GeoDistance(\n geo_distance=models.GeoDistanceParams(\n\ + \ origin=models.GeoPoint(\n \ + \ lat=52.504043,\n lon=13.393236\n\ + \ ), # Berlin\n \ + \ to=\"geo.location\"\n )\n \ + \ ),\n scale=5000 # 5km\n )\n \ + \ )\n ]),\n defaults={\"geo.location\": models.GeoPoint(lat=48.137154,\ + \ lon=11.576124)} # Munich\n )\n)\n" + language: python /collections/{collection_name}/points/query/batch: post: description: Universally query points in batch. This endpoint covers all capabilities @@ -2032,28 +2032,15 @@ paths: - Search x-fern-examples: - 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 - - 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: "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: "import static io.qdrant.client.QueryFactory.nearest;\n\nimport java.util.List;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + import 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\ @@ -2075,15 +2062,21 @@ paths: \ { Query = new float[] { 0.4f, 0.5f, 0.6f }, }\n\t}\n);\n" language: csharp - 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\ - import 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: "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: "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(\"\ @@ -2093,6 +2086,13 @@ paths: \ vec![0.3; 8],\n )).into(),\n]);\n\nlet response =\ \ client.query_batch(request).await?;" language: rust + - code-samples: + - 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 /collections/{collection_name}/points/query/groups: post: description: Universally query points and group results by a specified payload @@ -2103,25 +2103,15 @@ paths: - Search x-fern-examples: - 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 - - 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: "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: "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\ @@ -2140,15 +2130,19 @@ paths: \ new float[] {\n 0.01f, 0.45f, 0.67f\n }\n);\n" language: csharp - 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: "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: "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\ @@ -2156,6 +2150,12 @@ paths: , \"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 + - code-samples: + - 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 /collections/{collection_name}/points/recommend: {} /collections/{collection_name}/points/recommend/batch: {} /collections/{collection_name}/points/recommend/groups: {} @@ -2175,30 +2175,17 @@ paths: - Points x-fern-examples: - 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: "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: "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: "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.Common.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\ @@ -2218,17 +2205,23 @@ paths: , \"red\"),\n limit: 1,\n payloadSelector: true\n);\n" language: csharp - 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.Common.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: "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: "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\"\ @@ -2238,6 +2231,13 @@ paths: \ )]))\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 /collections/{collection_name}/points/search: {} /collections/{collection_name}/points/search/batch: {} /collections/{collection_name}/points/search/groups: {} @@ -2251,22 +2251,17 @@ paths: - Search x-fern-examples: - 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 - - code-samples: - - 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: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ + import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + import io.qdrant.client.grpc.Common.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\ @@ -2286,17 +2281,14 @@ paths: ),\n sample: 100,\n limit: 5\n);" language: csharp - code-samples: - - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ - import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - import io.qdrant.client.grpc.Common.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: "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: "use qdrant_client::qdrant::{Condition, SearchMatrixPointsBuilder,\ \ Filter};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"\ @@ -2306,6 +2298,14 @@ paths: color\",\n \"red\".to_string(),\n )]))\n \ \ .sample(100)\n .limit(5),\n )\n .await?;" language: rust + - code-samples: + - 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 /collections/{collection_name}/points/search/matrix/pairs: post: description: Retrieves sparse matrix of pairwise distances between points sampled @@ -2315,22 +2315,17 @@ paths: - Search x-fern-examples: - 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 - - code-samples: - - 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: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ + import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + import io.qdrant.client.grpc.Common.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\ @@ -2350,17 +2345,14 @@ paths: ),\n sample: 100,\n limit: 5\n);" language: csharp - code-samples: - - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ - import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - import io.qdrant.client.grpc.Common.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: "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: "use qdrant_client::qdrant::{Condition, SearchMatrixPointsBuilder,\ \ Filter};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"\ @@ -2370,6 +2362,14 @@ paths: color\",\n \"red\".to_string(),\n )]))\n \ \ .sample(100)\n .limit(5),\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_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 /collections/{collection_name}/points/vectors: put: description: Updates specified vectors on points. All other unspecified vectors @@ -2379,34 +2379,21 @@ paths: - Points x-fern-examples: - 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 - - 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: "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: "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\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\ @@ -2431,21 +2418,24 @@ paths: \ }\n }\n);\n" language: csharp - 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\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: "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: "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\ @@ -2464,6 +2454,16 @@ paths: \ },\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.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 /collections/{collection_name}/points/vectors/delete: post: description: Deletes specified vectors from points. All other unspecified vectors @@ -2473,29 +2473,13 @@ paths: - Points x-fern-examples: - 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: "# 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: "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: "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\ @@ -2520,13 +2504,23 @@ paths: ' language: csharp - 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: "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: "# 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(\"\ @@ -2537,6 +2531,12 @@ paths: \ {\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 /collections/{collection_name}/points/{id}: get: description: Retrieves all details from a single point. @@ -2551,28 +2551,16 @@ paths: - Distributed x-fern-examples: - 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 - - 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: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.create_shard_key("{collection_name}", "{shard_key}") - - ' - language: python + - 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\ @@ -2587,45 +2575,27 @@ paths: \ \"{collection_name}\",\n new CreateShardKey { ShardKey = new ShardKey\ \ { Keyword = \"{shard_key}\", } }\n);\n" language: csharp - - 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: "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 - /collections/{collection_name}/shards/delete: - post: - description: Deletes one or more shard keys for a specified collection. - summary: Delete a shard key - tags: - - Distributed - x-fern-examples: - 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:\ + });\n\nclient.createShardKey(\"{collection_name}\", {\n shard_key:\ \ \"{shard_key}\"\n});\n" language: typescript - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/shards/delete'\ + - 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 - code-samples: - code: 'from qdrant_client import QdrantClient @@ -2633,10 +2603,28 @@ paths: client = QdrantClient(url="http://localhost:6333") - client.delete_shard_key("{collection_name}", "{shard_key}") + client.create_shard_key("{collection_name}", "{shard_key}") ' language: python + /collections/{collection_name}/shards/delete: + post: + description: Deletes one or more shard keys for a specified collection. + summary: Delete a shard key + tags: + - Distributed + x-fern-examples: + - 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\ @@ -2652,16 +2640,17 @@ paths: \ { Keyword = \"shard_key\", } }\n);\n" language: csharp - 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: "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: "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\"\ @@ -2669,6 +2658,17 @@ paths: {collection_name}\")\n .key(Key::Keyword(\"{shard_key}\".to_string())),\n\ \ )\n .await?;\n" language: rust + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.delete_shard_key("{collection_name}", "{shard_key}") + + ' + language: python /collections/{collection_name}/shards/{shard_id}/snapshots: get: description: Returns a list of all snapshots for a shard from a collection. @@ -2714,31 +2714,11 @@ paths: - Snapshots x-fern-examples: - 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: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/snapshots'\ - \ \\\n --header 'api-key: '" - language: curl - - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.list_snapshots(collection_name="{collection_name}") - - ' - language: python + - 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\ @@ -2759,43 +2739,31 @@ paths: ' language: csharp - 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: 'use qdrant_client::Qdrant; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - let client = Qdrant::from_url("http://localhost:6334").build()?; + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.list_snapshots("{collection_name}").await?; + client.listSnapshots("{collection_name}"); ' - language: rust - post: - description: Creates a new snapshot for a specified collection. - summary: Create a snapshot (collection) - tags: - - Snapshots - x-fern-examples: + language: typescript - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - 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; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + let client = Qdrant::from_url("http://localhost:6334").build()?; - client.createSnapshot("{collection_name}"); + client.list_snapshots("{collection_name}").await?; ' - language: typescript - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/snapshots'\ - \ \\\n --header 'api-key: '" - language: curl + language: rust - code-samples: - code: 'from qdrant_client import QdrantClient @@ -2803,10 +2771,22 @@ paths: client = QdrantClient(url="http://localhost:6333") - client.create_snapshot(collection_name="{collection_name}") + client.list_snapshots(collection_name="{collection_name}") ' language: python + post: + description: Creates a new snapshot for a specified collection. + summary: Create a snapshot (collection) + tags: + - Snapshots + x-fern-examples: + - 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\ @@ -2827,11 +2807,20 @@ paths: ' language: csharp - 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: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.createSnapshot("{collection_name}"); + + ' + language: typescript + - 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; @@ -2843,6 +2832,17 @@ paths: ' 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 /collections/{collection_name}/snapshots/recover: put: description: Recovers local collection data from a snapshot. This will overwrite @@ -2890,25 +2890,11 @@ paths: - Snapshots x-fern-examples: - 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 - - 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: "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: "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\ @@ -2929,11 +2915,20 @@ paths: ' language: csharp - 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: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.deleteSnapshot("{collection_name}", "{snapshot_name}"); + + ' + language: typescript + - 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\ @@ -2941,6 +2936,11 @@ paths: \ \"{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 get: description: Downloads the specified snapshot file from a collection. summary: Download a snapshot (collection) @@ -2991,31 +2991,10 @@ paths: - Snapshots x-fern-examples: - 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: "curl -X GET \\\n 'http://localhost:6333/snapshots' \\\n --header\ - \ 'api-key: '" - language: curl - - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.list_full_snapshots() - - ' - language: python + - 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\ @@ -3036,42 +3015,31 @@ paths: ' language: csharp - 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: 'use qdrant_client::Qdrant; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - let client = Qdrant::from_url("http://localhost:6334").build()?; + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.list_full_snapshots().await?; + client.listFullSnapshots(); ' - language: rust - post: - description: Creates a new snapshot of the entire storage. - summary: Create a snapshot (storage) - tags: - - Snapshots - x-fern-examples: + language: typescript - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: "curl -X GET \\\n 'http://localhost:6333/snapshots' \\\n --header\ + \ 'api-key: '" + language: curl + - code-samples: + - code: 'use qdrant_client::Qdrant; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + let client = Qdrant::from_url("http://localhost:6334").build()?; - client.createFullSnapshot(); + client.list_full_snapshots().await?; ' - language: typescript - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/snapshots' \\\n --header\ - \ 'api-key: '" - language: curl + language: rust - code-samples: - code: 'from qdrant_client import QdrantClient @@ -3079,10 +3047,21 @@ paths: client = QdrantClient(url="http://localhost:6333") - client.create_full_snapshot() + client.list_full_snapshots() ' language: python + post: + description: Creates a new snapshot of the entire storage. + summary: Create a snapshot (storage) + tags: + - Snapshots + x-fern-examples: + - 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\ @@ -3103,43 +3082,31 @@ paths: ' language: csharp - 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: 'use qdrant_client::Qdrant; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - let client = Qdrant::from_url("http://localhost:6334").build()?; + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.create_full_snapshot().await?; + client.createFullSnapshot(); ' - language: rust - /snapshots/{snapshot_name}: - delete: - description: Deletes the specified snapshot of the entire storage. - summary: Delete a snapshot (storage) - tags: - - Snapshots - x-fern-examples: + language: typescript - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: "curl -X POST \\\n 'http://localhost:6333/snapshots' \\\n --header\ + \ 'api-key: '" + language: curl + - code-samples: + - code: 'use qdrant_client::Qdrant; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + let client = Qdrant::from_url("http://localhost:6334").build()?; - client.deleteFullSnapshot("{snapshot_name}"); + client.create_full_snapshot().await?; ' - language: typescript - - code-samples: - - code: "curl -X DELETE \\\n 'http://localhost:6333/snapshots/snapshot_name'\ - \ \\\n --header 'api-key: '" - language: curl + language: rust - code-samples: - code: 'from qdrant_client import QdrantClient @@ -3147,10 +3114,23 @@ paths: client = QdrantClient(url="http://localhost:6333") - client.delete_full_snapshot(snapshot_name="{snapshot_name}") + client.create_full_snapshot() ' language: python + /snapshots/{snapshot_name}: + delete: + description: Deletes the specified snapshot of the entire storage. + summary: Delete a snapshot (storage) + tags: + - Snapshots + x-fern-examples: + - 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\ @@ -3170,11 +3150,20 @@ paths: ' language: csharp - 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: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.deleteFullSnapshot("{snapshot_name}"); + + ' + language: typescript + - 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; @@ -3186,6 +3175,17 @@ paths: ' language: rust + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.delete_full_snapshot(snapshot_name="{snapshot_name}") + + ' + language: python get: description: Downloads the specified snapshot of the entire storage as a file. summary: Download a snapshot (storage) diff --git a/fern/apis/v1.19.x/openapi.json b/fern/apis/v1.19.x/openapi.json index add7d48..54ef299 100644 --- a/fern/apis/v1.19.x/openapi.json +++ b/fern/apis/v1.19.x/openapi.json @@ -583,6 +583,114 @@ } } }, + "/collections/{collection_name}/points/query": { + "post": { + "tags": [ + "Search" + ], + "summary": "Query points", + "description": "Universally query points. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries.", + "operationId": "query_points", + "requestBody": { + "description": "Describes the query to make to the collection", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueryRequest" + } + } + } + }, + "parameters": [ + { + "name": "collection_name", + "in": "path", + "description": "Name of the collection to query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "consistency", + "in": "query", + "description": "Define read consistency guarantees for the operation", + "required": false, + "schema": { + "$ref": "#/components/schemas/ReadConsistency" + } + }, + { + "name": "timeout", + "in": "query", + "description": "If set, overrides global timeout for this request. Unit is seconds.", + "required": false, + "schema": { + "type": "integer", + "minimum": 1 + } + } + ], + "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": { + "usage": { + "default": null, + "anyOf": [ + { + "$ref": "#/components/schemas/Usage" + }, + { + "nullable": true + } + ] + }, + "time": { + "type": "number", + "format": "float", + "description": "Time spent to process this request", + "example": 0.002 + }, + "status": { + "type": "string", + "example": "ok" + }, + "result": { + "$ref": "#/components/schemas/QueryResponse" + } + } + } + } + } + } + } + } + }, "/collections/{collection_name}/index": { "put": { "tags": [ @@ -5774,114 +5882,6 @@ } } }, - "/collections/{collection_name}/points/query": { - "post": { - "tags": [ - "Search" - ], - "summary": "Query points", - "description": "Universally query points. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries.", - "operationId": "query_points", - "requestBody": { - "description": "Describes the query to make to the collection", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QueryRequest" - } - } - } - }, - "parameters": [ - { - "name": "collection_name", - "in": "path", - "description": "Name of the collection to query", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "consistency", - "in": "query", - "description": "Define read consistency guarantees for the operation", - "required": false, - "schema": { - "$ref": "#/components/schemas/ReadConsistency" - } - }, - { - "name": "timeout", - "in": "query", - "description": "If set, overrides global timeout for this request. Unit is seconds.", - "required": false, - "schema": { - "type": "integer", - "minimum": 1 - } - } - ], - "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": { - "usage": { - "default": null, - "anyOf": [ - { - "$ref": "#/components/schemas/Usage" - }, - { - "nullable": true - } - ] - }, - "time": { - "type": "number", - "format": "float", - "description": "Time spent to process this request", - "example": 0.002 - }, - "status": { - "type": "string", - "example": "ok" - }, - "result": { - "$ref": "#/components/schemas/QueryResponse" - } - } - } - } - } - } - } - } - }, "/collections/{collection_name}/points/query/batch": { "post": { "tags": [