From 4823551699d6e93a4d9be3ff1ad0e0898954a7e6 Mon Sep 17 00:00:00 2001 From: andres-qd Date: Fri, 5 Jun 2026 17:20:15 -0500 Subject: [PATCH 1/4] chore: add Dependabot configuration --- .github/dependabot.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..52e565f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,19 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 5 + groups: + security-updates: + applies-to: security-updates + patterns: + - "*" + version-updates: + applies-to: version-updates + update-types: + - "minor" + - "patch" + patterns: + - "*" From 495bddee0ad7020c6a8460da5fc66d1a8d860526 Mon Sep 17 00:00:00 2001 From: andres-qd <177576014+andres-qd@users.noreply.github.com> Date: Fri, 5 Jun 2026 22:20:32 +0000 Subject: [PATCH 2/4] Sync OpenAPI --- fern/apis/master/openapi-overrides.yml | 1188 ++++---- fern/apis/master/openapi.json | 29 +- fern/apis/v1.18.x/openapi-overrides.yml | 3500 +++++++++++------------ 3 files changed, 2367 insertions(+), 2350 deletions(-) diff --git a/fern/apis/master/openapi-overrides.yml b/fern/apis/master/openapi-overrides.yml index 9ca676b..b2c06ed 100644 --- a/fern/apis/master/openapi-overrides.yml +++ b/fern/apis/master/openapi-overrides.yml @@ -10,6 +10,9 @@ paths: /aliases: get: x-fern-examples: + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/aliases' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'using Qdrant.Client; @@ -22,16 +25,8 @@ paths: ' language: csharp - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.get_aliases() - -' - language: python + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc listAliases() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\taliases, err := client.ListAliases(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Aliases: \", aliases)\n}\n" + language: go - code-samples: - code: 'use qdrant_client::Qdrant; @@ -43,15 +38,6 @@ paths: ' language: rust - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listAliasesAsync().get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc listAliases() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\taliases, err := client.ListAliases(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Aliases: \", aliases)\n}\n" - language: go - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/aliases' \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -63,6 +49,20 @@ paths: ' language: typescript + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.get_aliases() + +' + language: python + - 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 description: Retrieves a list of all existing aliases. summary: List all aliases tags: @@ -70,6 +70,9 @@ paths: /collections: get: x-fern-examples: + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/collections' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'using Qdrant.Client; @@ -82,16 +85,8 @@ paths: ' language: csharp - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.get_collections() - -' - language: python + - 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: 'use qdrant_client::Qdrant; @@ -103,15 +98,6 @@ paths: ' language: rust - - 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: "curl -X GET \\\n 'http://localhost:6333/collections' \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -123,6 +109,20 @@ paths: ' language: typescript + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.get_collections() + +' + language: python + - 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 description: Returns a list of all existing collections. summary: List all collections tags: @@ -130,6 +130,9 @@ paths: /collections/aliases: post: x-fern-examples: + - 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: 'using Qdrant.Client; @@ -144,24 +147,21 @@ paths: ' language: csharp - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.update_collection_aliases(\n change_aliases_operations=[\n models.CreateAliasOperation(\n create_alias=models.CreateAlias(\n collection_name=\"example_collection\", alias_name=\"production_collection\"\n )\n )\n ]\n)\n\nclient.update_collection_aliases(\n change_aliases_operations=[\n models.DeleteAliasOperation(\n delete_alias=models.DeleteAlias(alias_name=\"production_collection\")\n ),\n ]\n)\n" - language: python - - code-samples: - - code: "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: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.DeleteShardKey;\nimport io.qdrant.client.grpc.Collections.DeleteShardKeyRequest;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createAliasAsync(\"production_collection\", \"example_collection\").get();\n\nclient.deleteAliasAsync(\"production_collection\").get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc updateAlias() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.CreateAlias(context.Background(), \"production_collection\", \"example_collection\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteAlias(context.Background(), \"production_collection\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.RenameAlias(context.Background(), \"production_collection\", \"legacy_collection\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "# 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: "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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.update_collection_aliases(\n change_aliases_operations=[\n models.CreateAliasOperation(\n create_alias=models.CreateAlias(\n collection_name=\"example_collection\", alias_name=\"production_collection\"\n )\n )\n ]\n)\n\nclient.update_collection_aliases(\n change_aliases_operations=[\n models.DeleteAliasOperation(\n delete_alias=models.DeleteAlias(alias_name=\"production_collection\")\n ),\n ]\n)\n" + language: python + - code-samples: + - code: "import 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 description: Updates aliases for the specified collections. summary: Update collection aliases tags: @@ -169,6 +169,9 @@ paths: /collections/{collection_name}: delete: x-fern-examples: + - code-samples: + - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'using Qdrant.Client; @@ -181,16 +184,8 @@ paths: ' language: csharp - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.delete_collection(collection_name="{collection_name}") - -' - language: python + - 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 - code-samples: - code: 'use qdrant_client::Qdrant; @@ -202,15 +197,6 @@ paths: ' language: rust - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteCollectionAsync(\"{collection_name}\").get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteCollection(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go - - code-samples: - - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'import { QdrantClient } from ''@qdrant/qdrant-js''; @@ -222,12 +208,29 @@ paths: ' language: typescript + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.delete_collection(collection_name="{collection_name}") + +' + language: python + - code-samples: + - code: "import 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 description: Drops the specified collection and all associated data in it. summary: Delete a collection tags: - Collections get: x-fern-examples: + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'using Qdrant.Client; @@ -240,16 +243,8 @@ paths: ' language: csharp - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.get_collection("{collection_name}") - -' - language: python + - 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: 'use qdrant_client::Qdrant; @@ -261,15 +256,6 @@ paths: ' language: rust - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.getCollectionInfoAsync(\"{collection_name}\").get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc getCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tinfo, err := client.GetCollectionInfo(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Collection info: \", info)\n}\n" - language: go - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -281,60 +267,74 @@ paths: ' language: typescript + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.get_collection("{collection_name}") + +' + language: python + - code-samples: + - code: "import 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 description: Retrieves parameters from the specified collection. summary: Get collection details tags: - Collections patch: x-fern-examples: + - 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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.update_collection(\n collection_name=\"{collection_name}\",\n optimizer_config=models.OptimizersConfigDiff(indexing_threshold=10000),\n)\n" - language: python - - code-samples: - - code: "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: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.OptimizersConfigDiff;\nimport io.qdrant.client.grpc.Collections.UpdateCollection;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.updateCollectionAsync(\n UpdateCollection.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setOptimizersConfig(\n OptimizersConfigDiff.newBuilder().setIndexingThreshold(10000).build())\n .build());\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc updateCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tthreshold := uint64(10000)\n\terr = client.UpdateCollection(context.Background(), &qdrant.UpdateCollection{\n\t\tCollectionName: \"{collection_name}\",\n\t\tOptimizersConfig: &qdrant.OptimizersConfigDiff{\n\t\t\tIndexingThreshold: &threshold,\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "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: "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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.update_collection(\n collection_name=\"{collection_name}\",\n optimizer_config=models.OptimizersConfigDiff(indexing_threshold=10000),\n)\n" + language: python + - code-samples: + - code: "import 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 description: Updates the parameters of the specified collection. summary: Update collection parameters tags: - Collections put: x-fern-examples: + - 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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.create_collection(\n collection_name=\"{collection_name}\",\n vectors_config=models.VectorParams(size=100, distance=models.Distance.COSINE),\n)\n" - language: python - - code-samples: - - code: "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: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.Distance;\nimport io.qdrant.client.grpc.Collections.VectorParams;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createCollectionAsync(\"{collection_name}\",\n VectorParams.newBuilder().setDistance(Distance.Cosine).setSize(100).build()).get();\n\n// Or with sparse vectors\n\nclient.createCollectionAsync(\n CreateCollection.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setSparseVectorsConfig(\n Collections.SparseVectorConfig.newBuilder().putMap(\n \"splade-model-name\",\n Collections.SparseVectorParams.newBuilder()\n .setIndex(\n Collections.SparseIndexConfig\n .newBuilder()\n .setOnDisk(false)\n .build()\n ).build()\n ).build()\n ).build()\n).get();" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc createCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.CreateCollection(context.Background(), &qdrant.CreateCollection{\n\t\tCollectionName: \"{collection_name}\",\n\t\tVectorsConfig: qdrant.NewVectorsConfig(&qdrant.VectorParams{\n\t\t\tSize: 100,\n\t\t\tDistance: qdrant.Distance_Cosine,\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "# 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: "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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.create_collection(\n collection_name=\"{collection_name}\",\n vectors_config=models.VectorParams(size=100, distance=models.Distance.COSINE),\n)\n" + language: python + - code-samples: + - code: "import 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 description: Creates a new collection with the given parameters. summary: Create a collection tags: @@ -342,6 +342,9 @@ paths: /collections/{collection_name}/aliases: get: x-fern-examples: + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/aliases' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'using Qdrant.Client; @@ -354,16 +357,8 @@ paths: ' language: csharp - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.get_collection_aliases("{collection_name}") - -' - language: python + - 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: 'use qdrant_client::Qdrant; @@ -375,15 +370,6 @@ paths: ' language: rust - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listCollectionAliasesAsync(\"{collection_name}\").get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc listCollectionAliases() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\taliases, err := client.ListCollectionAliases(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Collection aliases: \", aliases)\n}\n" - language: go - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/aliases' \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -395,6 +381,20 @@ paths: ' language: typescript + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.get_collection_aliases("{collection_name}") + +' + language: python + - 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 description: Retrieves a list of all aliases for the specified collection. summary: List collection aliases tags: @@ -402,6 +402,9 @@ paths: /collections/{collection_name}/exists: get: x-fern-examples: + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/exists' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'using Qdrant.Client; @@ -414,14 +417,8 @@ paths: ' language: csharp - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.collection_exists(collection_name="{collection_name}")' - language: python + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc collectionExists() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\texists, err := client.CollectionExists(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Collection exists: \", exists)\n}\n" + language: go - code-samples: - code: 'use qdrant_client::Qdrant; @@ -434,38 +431,41 @@ paths: ' language: rust - code-samples: - - code: 'import static io.qdrant.client.ConditionFactory.matchKeyword; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - import io.qdrant.client.QdrantClient; + const client = new QdrantClient({ host: "localhost", port: 6333 }); - import io.qdrant.client.QdrantGrpcClient; + client.collectionExists("{collection_name}"); - QdrantClient client = new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build()); +' + language: typescript + - code-samples: + - code: 'from qdrant_client import QdrantClient - client.collectionExistsAsync("{collection_name}").get(); + client = QdrantClient(url="http://localhost:6333") -' - 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 - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/exists' \\\n --header 'api-key: '" - language: curl + + client.collection_exists(collection_name="{collection_name}")' + language: python - 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; + import io.qdrant.client.QdrantGrpcClient; - client.collectionExists("{collection_name}"); + + QdrantClient client = new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build()); + + + client.collectionExistsAsync("{collection_name}").get(); ' - language: typescript + language: java description: Checks whether the specified collection exists. summary: Check collection existence tags: @@ -477,20 +477,20 @@ 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: "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: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc facet() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tlimit := uint64(10)\n\tresults, err := client.Facet(context.Background(), &qdrant.FacetCounts{\n\t\tCollectionName: \"{collection_name}\",\n\t\tKey: \"my-payload-key\",\n\t\tLimit: &limit,\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" + language: go - code-samples: - code: "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: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\nimport io.qdrant.client.grpc.Points;\nimport io.qdrant.client.grpc.Filter;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .facetAsync(\n Points.FacetCounts.newBuilder()\n .setCollectionName(collection_name)\n .setKey(\"my-payload-key\")\n .setFilter(\n Filter.newBuilder()\n .addMust(matchKeyword(\"color\", \"red\"))\n .build())\n .build())\n .get();" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc facet() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tlimit := uint64(10)\n\tresults, err := client.Facet(context.Background(), &qdrant.FacetCounts{\n\t\tCollectionName: \"{collection_name}\",\n\t\tKey: \"my-payload-key\",\n\t\tLimit: &limit,\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" - language: go - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.facet(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n key: \"my-payload-key\",\n limit: 10,\n});\n" language: typescript + - 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-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 description: Retrieves facets for the specified payload field. summary: Payload field facets tags: @@ -498,27 +498,27 @@ paths: /collections/{collection_name}/index: put: x-fern-examples: + - 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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.create_payload_index(\n collection_name=\"{collection_name}\",\n field_name=\"name_of_the_field_to_index\",\n field_schema=\"keyword\",\n)\n" - language: python - - code-samples: - - code: "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: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.PayloadSchemaType;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createPayloadIndexAsync(\n \"{collection_name}\",\n \"{field_name}\",\n PayloadSchemaType.Keyword,\n null,\n true,\n null,\n null);\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc createFieldIndex() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.CreateFieldIndex(context.Background(), &qdrant.CreateFieldIndexCollection{\n\t\tCollectionName: \"{collection_name}\",\n\t\tFieldName: \"name_of_the_field_to_index\",\n\t\tFieldType: qdrant.FieldType_FieldTypeKeyword.Enum(),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "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: "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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.create_payload_index(\n collection_name=\"{collection_name}\",\n field_name=\"name_of_the_field_to_index\",\n field_schema=\"keyword\",\n)\n" + language: python + - code-samples: + - code: "import 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 description: Creates a payload index for a field in the specified collection. summary: Create payload index tags: @@ -526,32 +526,18 @@ paths: /collections/{collection_name}/index/{field_name}: delete: x-fern-examples: + - 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: "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: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.delete_payload_index("{collection_name}", "{field_name}"); - -' - language: python - - 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: "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: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/index/field_name' \\\n --header 'api-key: '" - language: curl + - 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: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -563,6 +549,20 @@ paths: ' language: typescript + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.delete_payload_index("{collection_name}", "{field_name}"); + +' + language: python + - code-samples: + - code: "import 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 description: Deletes a payload index for a field in the specified collection. summary: Delete payload index tags: @@ -570,54 +570,54 @@ paths: /collections/{collection_name}/points: post: x-fern-examples: + - 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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.retrieve(\n collection_name=\"{collection_name}\",\n ids=[0, 3, 100],\n)\n" - language: python - - code-samples: - - code: "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: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .retrieveAsync(\"{collection_name}\", List.of(id(0), id(30), id(100)), false, false, null)\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc getPoints() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tpoints, err := client.Get(context.Background(), &qdrant.GetPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tIds: []*qdrant.PointId{\n\t\t\tqdrant.NewIDNum(0), qdrant.NewID(\"3\"), qdrant.NewIDNum(100),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Points: \", points)\n}\n" language: go - code-samples: - - code: "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: "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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.retrieve(\n collection_name=\"{collection_name}\",\n ids=[0, 3, 100],\n)\n" + language: python + - code-samples: + - code: "import 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 description: Retrieves all details from multiple points. summary: Retrieve points tags: - Points put: x-fern-examples: + - 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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.upsert(\n collection_name=\"{collection_name}\",\n points=[\n models.PointStruct(\n id=1,\n payload={\n \"color\": \"red\",\n },\n vector=[0.9, 0.1, 0.1],\n ),\n models.PointStruct(\n id=2,\n payload={\n \"color\": \"green\",\n },\n vector=[0.1, 0.9, 0.1],\n ),\n models.PointStruct(\n id=3,\n payload={\n \"color\": \"blue\",\n },\n vector=[0.1, 0.1, 0.9],\n ),\n ],\n)\n" - language: python - - code-samples: - - code: "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: "import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.PointStruct;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .upsertAsync(\n \"{collection_name}\",\n List.of(\n PointStruct.newBuilder()\n .setId(id(1))\n .setVectors(\n namedVectors(\n Map.of(\n \"image\",\n vector(List.of(0.9f, 0.1f, 0.1f, 0.2f)),\n \"text\",\n vector(List.of(0.4f, 0.7f, 0.1f, 0.8f, 0.1f, 0.1f, 0.9f, 0.2f)))))\n .build(),\n PointStruct.newBuilder()\n .setId(id(2))\n .setVectors(\n namedVectors(\n Map.of(\n \"image\",\n List.of(0.2f, 0.1f, 0.3f, 0.9f),\n \"text\",\n List.of(0.5f, 0.2f, 0.7f, 0.4f, 0.7f, 0.2f, 0.3f, 0.9f))))\n .build()))\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc upsert() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresponse, err := client.Upsert(context.Background(), &qdrant.UpsertPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: []*qdrant.PointStruct{\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(1),\n\t\t\t\tVectors: qdrant.NewVectors(0.9, 0.1, 0.1),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\t\t\"color\": \"red\",\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(2),\n\t\t\t\tVectors: qdrant.NewVectors(0.1, 0.9, 0.1),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\t\t\"color\": \"green\",\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(3),\n\t\t\t\tVectors: qdrant.NewVectors(0.1, 0.1, 0.9),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\t\t\"color\": \"blue\",\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Upsert status: \", response.GetStatus())\n}\n" language: go - code-samples: - - code: "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: "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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.upsert(\n collection_name=\"{collection_name}\",\n points=[\n models.PointStruct(\n id=1,\n payload={\n \"color\": \"red\",\n },\n vector=[0.9, 0.1, 0.1],\n ),\n models.PointStruct(\n id=2,\n payload={\n \"color\": \"green\",\n },\n vector=[0.1, 0.9, 0.1],\n ),\n models.PointStruct(\n id=3,\n payload={\n \"color\": \"blue\",\n },\n vector=[0.1, 0.1, 0.9],\n ),\n ],\n)\n" + language: python + - code-samples: + - code: "import 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 description: Performs the insert + update action on specified points. Any point with an existing {id} will be overwritten. summary: Upsert points tags: @@ -625,27 +625,27 @@ paths: /collections/{collection_name}/points/batch: post: x-fern-examples: + - 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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.batch_update_points(\n collection_name=\"{collection_name}\",\n update_operations=[\n models.UpsertOperation(\n upsert=models.PointsList(\n points=[\n models.PointStruct(\n id=1,\n vector=[1.0, 2.0, 3.0, 4.0],\n payload={},\n ),\n ]\n )\n ),\n models.UpdateVectorsOperation(\n update_vectors=models.UpdateVectors(\n points=[\n models.PointVectors(\n id=1,\n vector=[1.0, 2.0, 3.0, 4.0],\n )\n ]\n )\n ),\n models.SetPayloadOperation(\n set_payload=models.SetPayload(\n payload={\n \"test_payload_2\": 2,\n \"test_payload_3\": 3,\n },\n points=[1],\n )\n ),\n ],\n)\n" - language: python - - code-samples: - - code: "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: "import java.util.List;\nimport java.util.Map;\n\nimport static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.ValueFactory.value;\nimport static io.qdrant.client.VectorsFactory.vectors;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.PointStruct;\nimport io.qdrant.client.grpc.Points.PointVectors;\nimport io.qdrant.client.grpc.Points.PointsIdsList;\nimport io.qdrant.client.grpc.Points.PointsSelector;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation.PointStructList;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation.SetPayload;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation.UpdateVectors;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .batchUpdateAsync(\n \"{collection_name}\",\n List.of(\n PointsUpdateOperation.newBuilder()\n .setUpsert(\n PointStructList.newBuilder()\n .addPoints(\n PointStruct.newBuilder()\n .setId(id(1))\n .setVectors(vectors(\n 1.0 f,\n 2.0 f,\n 3.0 f,\n 4.0 f))\n .build())\n .build())\n .build(),\n PointsUpdateOperation.newBuilder()\n .setUpdateVectors(\n UpdateVectors.newBuilder()\n .addPoints(\n PointVectors.newBuilder()\n .setId(id(1))\n .setVectors(vectors(\n 1.0 f,\n 2.0 f,\n 3.0 f,\n 4.0 f))\n .build())\n .build())\n .build(),\n PointsUpdateOperation.newBuilder()\n .setSetPayload(\n SetPayload.newBuilder()\n .setPointsSelector(\n PointsSelector.newBuilder()\n .setPoints(PointsIdsList\n .newBuilder()\n .addIds(id(1))\n .build())\n .build())\n .putAllPayload(\n Map.of(\"test_payload_2\",\n value(2),\n \"test_payload_3\",\n value(3)))\n .build())\n .build()))\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc batchUpdate() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.UpdateBatch(context.Background(), &qdrant.UpdateBatchPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tOperations: []*qdrant.PointsUpdateOperation{\n\t\t\tqdrant.NewPointsUpdateUpsert(&qdrant.PointsUpdateOperation_PointStructList{\n\t\t\t\tPoints: []*qdrant.PointStruct{{\n\t\t\t\t\tId: qdrant.NewIDNum(1),\n\t\t\t\t\tVectors: qdrant.NewVectors(1.0, 2.0, 3.0, 4.0),\n\t\t\t\t}},\n\t\t\t}),\n\t\t\tqdrant.NewPointsUpdateUpdateVectors(&qdrant.PointsUpdateOperation_UpdateVectors{\n\t\t\t\tPoints: []*qdrant.PointVectors{\n\t\t\t\t\t{\n\t\t\t\t\t\tId: qdrant.NewIDNum(1),\n\t\t\t\t\t\tVectors: qdrant.NewVectors(0.1, 0.2, 0.3, 0.4),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t\tqdrant.NewPointsUpdateSetPayload(&qdrant.PointsUpdateOperation_SetPayload{\n\t\t\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(1)),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\t\t\"test_payload_2\": 2,\n\t\t\t\t\t\"test_payload_3\": 3,\n\t\t\t\t}),\n\t\t\t}),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "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: "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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.batch_update_points(\n collection_name=\"{collection_name}\",\n update_operations=[\n models.UpsertOperation(\n upsert=models.PointsList(\n points=[\n models.PointStruct(\n id=1,\n vector=[1.0, 2.0, 3.0, 4.0],\n payload={},\n ),\n ]\n )\n ),\n models.UpdateVectorsOperation(\n update_vectors=models.UpdateVectors(\n points=[\n models.PointVectors(\n id=1,\n vector=[1.0, 2.0, 3.0, 4.0],\n )\n ]\n )\n ),\n models.SetPayloadOperation(\n set_payload=models.SetPayload(\n payload={\n \"test_payload_2\": 2,\n \"test_payload_3\": 3,\n },\n points=[1],\n )\n ),\n ],\n)\n" + language: python + - code-samples: + - code: "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 description: Batch updates points, including their respective vectors and payloads. summary: Batch update points tags: @@ -653,27 +653,27 @@ paths: /collections/{collection_name}/points/count: post: x-fern-examples: + - 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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.count(\n collection_name=\"{collection_name}\",\n count_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n exact=True,\n)\n" - language: python - - code-samples: - - code: "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: "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 - 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: "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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.count(\n collection_name=\"{collection_name}\",\n count_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n exact=True,\n)\n" + language: python + - code-samples: + - code: "import 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 description: Counts the number of points that match a specified filtering condition. summary: Count points tags: @@ -681,6 +681,9 @@ paths: /collections/{collection_name}/points/delete: post: x-fern-examples: + - 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: 'using Qdrant.Client; @@ -695,24 +698,21 @@ paths: ' language: csharp - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete(\n collection_name=\"{collection_name}\",\n points_selector=models.PointIdsList(\n points=[0, 3, 100],\n ),\n)\n\nclient.delete(\n collection_name=\"{collection_name}\",\n points_selector=models.FilterSelector(\n filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"color\",\n match=models.MatchValue(value=\"red\"),\n ),\n ],\n )\n ),\n)\n" - language: python - - code-samples: - - code: "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: "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 - 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: "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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete(\n collection_name=\"{collection_name}\",\n points_selector=models.PointIdsList(\n points=[0, 3, 100],\n ),\n)\n\nclient.delete(\n collection_name=\"{collection_name}\",\n points_selector=models.FilterSelector(\n filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"color\",\n match=models.MatchValue(value=\"red\"),\n ),\n ],\n )\n ),\n)\n" + language: python + - code-samples: + - code: "import 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 description: Deletes specified points from the collection. summary: Delete points tags: @@ -720,27 +720,27 @@ paths: /collections/{collection_name}/points/discover: post: x-fern-examples: + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/discover' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"target\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"context\": [\n {\n \"positive\": \"7f6652c4-89bd-40e0-ab1d-510f7fcddd2b\",\n \"negative\": \"2c2c9f86-0171-4bd2-9ab0-b4754682cddd\"\n }\n ],\n \"limit\": 10\n}'" + language: curl - code-samples: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.DiscoverAsync(\n collectionName: \"{collection_name}\",\n target: new TargetVector\n {\n Single = new VectorExample { Vector = new float[] { 0.2f, 0.1f, 0.9f, 0.7f }, }\n },\n context:\n [\n new()\n {\n Positive = new VectorExample { Id = 100 },\n Negative = new VectorExample { Id = 718 }\n },\n new()\n {\n Positive = new VectorExample { Id = 200 },\n Negative = new VectorExample { Id = 300 }\n }\n ],\n limit: 10\n);\n" language: csharp - - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.discover(\n \"{collection_name}\",\n target=[0.2, 0.1, 0.9, 0.7],\n context=[\n models.ContextExamplePair(positive=100, negative=718),\n models.ContextExamplePair(positive=200, negative=300),\n ],\n limit=10,\n)\n" - language: python - - code-samples: - - code: "use qdrant_client::qdrant::{\n target_vector::Target, vector_example::Example, ContextExamplePairBuilder,\n DiscoverPointsBuilder, VectorExample,\n};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .discover(\n DiscoverPointsBuilder::new(\n \"{collection_name}\",\n vec![\n ContextExamplePairBuilder::default()\n .positive(Example::Id(100.into()))\n .negative(Example::Id(718.into()))\n .build(),\n ContextExamplePairBuilder::default()\n .positive(Example::Id(200.into()))\n .negative(Example::Id(300.into()))\n .build(),\n ],\n 10,\n )\n .target(Target::Single(VectorExample {\n example: Some(Example::Vector(vec![0.2, 0.1, 0.9, 0.7].into())),\n })),\n )\n .await?;\n" - language: rust - - code-samples: - - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.ContextExamplePair;\nimport io.qdrant.client.grpc.Points.DiscoverPoints;\nimport io.qdrant.client.grpc.Points.TargetVector;\nimport io.qdrant.client.grpc.Points.VectorExample;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .discoverAsync(\n DiscoverPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setTarget(\n TargetVector.newBuilder()\n .setSingle(\n VectorExample.newBuilder()\n .setVector(vector(0.2f, 0.1f, 0.9f, 0.7f))\n .build()))\n .addAllContext(\n List.of(\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample.newBuilder().setId(id(100)))\n .setNegative(VectorExample.newBuilder().setId(id(718)))\n .build(),\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample.newBuilder().setId(id(200)))\n .setNegative(VectorExample.newBuilder().setId(id(300)))\n .build()))\n .setLimit(10)\n .build())\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc discover() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresults, err := client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQueryDiscover(&qdrant.DiscoverInput{\n\t\t\tTarget: qdrant.NewVectorInput(0.2, 0.1, 0.9, 0.7),\n\t\t\tContext: &qdrant.ContextInput{\n\t\t\t\tPairs: []*qdrant.ContextInputPair{{\n\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\t\t\t\t}, {\n\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(300)),\n\t\t\t\t}},\n\t\t\t},\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/discover' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"target\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"context\": [\n {\n \"positive\": \"7f6652c4-89bd-40e0-ab1d-510f7fcddd2b\",\n \"negative\": \"2c2c9f86-0171-4bd2-9ab0-b4754682cddd\"\n }\n ],\n \"limit\": 10\n}'" - language: curl + - code: "use qdrant_client::qdrant::{\n target_vector::Target, vector_example::Example, ContextExamplePairBuilder,\n DiscoverPointsBuilder, VectorExample,\n};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .discover(\n DiscoverPointsBuilder::new(\n \"{collection_name}\",\n vec![\n ContextExamplePairBuilder::default()\n .positive(Example::Id(100.into()))\n .negative(Example::Id(718.into()))\n .build(),\n ContextExamplePairBuilder::default()\n .positive(Example::Id(200.into()))\n .negative(Example::Id(300.into()))\n .build(),\n ],\n 10,\n )\n .target(Target::Single(VectorExample {\n example: Some(Example::Vector(vec![0.2, 0.1, 0.9, 0.7].into())),\n })),\n )\n .await?;\n" + language: rust - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.discover(\"{collection_name}\", {\n target: [0.2, 0.1, 0.9, 0.7],\n context: [\n {\n positive: 100,\n negative: 718,\n },\n {\n positive: 200,\n negative: 300,\n },\n ],\n limit: 10,\n});\n" language: typescript + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.discover(\n \"{collection_name}\",\n target=[0.2, 0.1, 0.9, 0.7],\n context=[\n models.ContextExamplePair(positive=100, negative=718),\n models.ContextExamplePair(positive=200, negative=300),\n ],\n limit=10,\n)\n" + language: python + - code-samples: + - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.ContextExamplePair;\nimport io.qdrant.client.grpc.Points.DiscoverPoints;\nimport io.qdrant.client.grpc.Points.TargetVector;\nimport io.qdrant.client.grpc.Points.VectorExample;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .discoverAsync(\n DiscoverPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setTarget(\n TargetVector.newBuilder()\n .setSingle(\n VectorExample.newBuilder()\n .setVector(vector(0.2f, 0.1f, 0.9f, 0.7f))\n .build()))\n .addAllContext(\n List.of(\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample.newBuilder().setId(id(100)))\n .setNegative(VectorExample.newBuilder().setId(id(718)))\n .build(),\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample.newBuilder().setId(id(200)))\n .setNegative(VectorExample.newBuilder().setId(id(300)))\n .build()))\n .setLimit(10)\n .build())\n .get();\n" + language: java description: > Retrieves the most similar points to a given target, constrained by the provided context. @@ -754,27 +754,27 @@ paths: /collections/{collection_name}/points/discover/batch: post: x-fern-examples: + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/discover/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"target\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"context\": [\n {\n \"positive\": \"7f6652c4-89bd-40e0-ab1d-510f7fcddd2b\",\n \"negative\": \"2c2c9f86-0171-4bd2-9ab0-b4754682cddd\"\n }\n ],\n \"limit\": 1\n },\n {\n \"target\": [\n 0.5,\n 0.3,\n 0.2,\n 0.3\n ],\n \"context\": [\n {\n \"positive\": 342,\n \"negative\": 213\n }\n ],\n \"limit\": 1\n }\n ]\n}'" + language: curl - code-samples: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar discoverPoints = new List\n{\n new DiscoverPoints\n {\n CollectionName = \"{collection_name}\",\n Target = new TargetVector\n {\n Single = new VectorExample { Vector = new float[] { 0.2f, 0.1f, 0.9f, 0.7f }, }\n },\n Context =\n {\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 100 },\n Negative = new VectorExample { Id = 718 }\n },\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 200 },\n Negative = new VectorExample { Id = 300 }\n }\n },\n Limit = 10\n },\n new DiscoverPoints\n {\n CollectionName = \"{collection_name}\",\n Target = new TargetVector\n {\n Single = new VectorExample { Vector = new float[] { 0.5f, 0.3f, 0.2f, 0.3f }, }\n },\n Context =\n {\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 342 },\n Negative = new VectorExample { Id = 213 }\n },\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 100 },\n Negative = new VectorExample { Id = 200 }\n }\n },\n Limit = 10\n }\n};\nawait client.DiscoverBatchAsync(\"{collection_name}\", discoverPoints);\n" language: csharp - - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\ndiscover_queries = [\n models.DiscoverRequest(\n target=[0.2, 0.1, 0.9, 0.7],\n context=[\n models.ContextExamplePair(\n positive=100,\n negative=718,\n ),\n models.ContextExamplePair(\n positive=200,\n negative=300,\n ),\n ],\n limit=10,\n ),\n models.DiscoverRequest(\n target=[0.5, 0.3, 0.2, 0.3],\n context=[\n models.ContextExamplePair(\n positive=342,\n negative=213,\n ),\n models.ContextExamplePair(\n positive=100,\n negative=200,\n ),\n ],\n limit=5,\n ),\n]\n\nclient.discover_batch(\"{collection_name}\", discover_queries)\n" - language: python - - code-samples: - - code: "use qdrant_client::qdrant::{\n vector_example::Example, ContextExamplePairBuilder, DiscoverBatchPointsBuilder,\n DiscoverPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet discover_points = DiscoverBatchPointsBuilder::new(\n \"{collection_name}\",\n vec![\n DiscoverPointsBuilder::new(\n \"{collection_name}\",\n vec![\n ContextExamplePairBuilder::default()\n .positive(Example::Id(100.into()))\n .negative(Example::Id(718.into()))\n .build(),\n ContextExamplePairBuilder::default()\n .positive(Example::Id(200.into()))\n .negative(Example::Id(300.into()))\n .build(),\n ],\n 10,\n )\n .build(),\n DiscoverPointsBuilder::new(\n \"{collection_name}\",\n vec![\n ContextExamplePairBuilder::default()\n .positive(Example::Id(342.into()))\n .negative(Example::Id(213.into()))\n .build(),\n ContextExamplePairBuilder::default()\n .positive(Example::Id(100.into()))\n .negative(Example::Id(200.into()))\n .build(),\n ],\n 10,\n )\n .build(),\n ],\n);\n\nclient.discover_batch(&discover_points.build()).await?;\n" - language: rust - - code-samples: - - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\nimport java.util.Arrays;\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.ContextExamplePair;\nimport io.qdrant.client.grpc.Points.DiscoverPoints;\nimport io.qdrant.client.grpc.Points.TargetVector;\nimport io.qdrant.client.grpc.Points.VectorExample;\n\nQdrantClient client = new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nList discoverPoints = Arrays.asList(\n DiscoverPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setTarget(\n TargetVector.newBuilder()\n .setSingle(\n VectorExample.newBuilder()\n .setVector(vector(\n 0.2 f,\n 0.1 f,\n 0.9 f,\n 0.7 f))\n .build()))\n .addAllContext(\n List.of(\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample\n .newBuilder()\n .setId(id(100)))\n .setNegative(VectorExample\n .newBuilder()\n .setId(id(718)))\n .build(),\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample\n .newBuilder()\n .setId(id(200)))\n .setNegative(VectorExample\n .newBuilder()\n .setId(id(300)))\n .build()))\n .setLimit(10)\n .build(),\n DiscoverPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setTarget(\n TargetVector.newBuilder()\n .setSingle(\n VectorExample.newBuilder()\n .setVector(vector(\n 0.5 f, 0.3 f, 0.2 f, 0.3 f))\n .build()))\n .addAllContext(\n List.of(\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample\n .newBuilder()\n .setId(id(342)))\n .setNegative(VectorExample\n .newBuilder()\n .setId(id(213)))\n .build(),\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample\n .newBuilder()\n .setId(id(100)))\n .setNegative(VectorExample\n .newBuilder()\n .setId(id(200)))\n .build()))\n .setLimit(10)\n .build());\nclient.discoverBatchAsync(\"{collection_name}\", discoverPoints, null);\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc discoverBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresults, err := client.QueryBatch(context.Background(), &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryDiscover(&qdrant.DiscoverInput{\n\t\t\t\t\tTarget: qdrant.NewVectorInput(0.2, 0.1, 0.9, 0.7),\n\t\t\t\t\tContext: &qdrant.ContextInput{\n\t\t\t\t\t\tPairs: []*qdrant.ContextInputPair{{\n\t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(300)),\n\t\t\t\t\t\t}},\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryDiscover(&qdrant.DiscoverInput{\n\t\t\t\t\tTarget: qdrant.NewVectorInput(0.5, 0.3, 0.2, 0.3),\n\t\t\t\t\tContext: &qdrant.ContextInput{\n\t\t\t\t\t\tPairs: []*qdrant.ContextInputPair{{\n\t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(342)),\n\t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(213)),\n\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\t\t\t\t\t\t}},\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/discover/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"target\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"context\": [\n {\n \"positive\": \"7f6652c4-89bd-40e0-ab1d-510f7fcddd2b\",\n \"negative\": \"2c2c9f86-0171-4bd2-9ab0-b4754682cddd\"\n }\n ],\n \"limit\": 1\n },\n {\n \"target\": [\n 0.5,\n 0.3,\n 0.2,\n 0.3\n ],\n \"context\": [\n {\n \"positive\": 342,\n \"negative\": 213\n }\n ],\n \"limit\": 1\n }\n ]\n}'" - language: curl + - code: "use qdrant_client::qdrant::{\n vector_example::Example, ContextExamplePairBuilder, DiscoverBatchPointsBuilder,\n DiscoverPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet discover_points = DiscoverBatchPointsBuilder::new(\n \"{collection_name}\",\n vec![\n DiscoverPointsBuilder::new(\n \"{collection_name}\",\n vec![\n ContextExamplePairBuilder::default()\n .positive(Example::Id(100.into()))\n .negative(Example::Id(718.into()))\n .build(),\n ContextExamplePairBuilder::default()\n .positive(Example::Id(200.into()))\n .negative(Example::Id(300.into()))\n .build(),\n ],\n 10,\n )\n .build(),\n DiscoverPointsBuilder::new(\n \"{collection_name}\",\n vec![\n ContextExamplePairBuilder::default()\n .positive(Example::Id(342.into()))\n .negative(Example::Id(213.into()))\n .build(),\n ContextExamplePairBuilder::default()\n .positive(Example::Id(100.into()))\n .negative(Example::Id(200.into()))\n .build(),\n ],\n 10,\n )\n .build(),\n ],\n);\n\nclient.discover_batch(&discover_points.build()).await?;\n" + language: rust - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nconst searches = [\n {\n target: [0.2, 0.1, 0.9, 0.7],\n context: [\n {\n positive: 100,\n negative: 718,\n },\n {\n positive: 200,\n negative: 300,\n },\n ],\n limit: 10,\n },\n {\n target: [0.5, 0.3, 0.2, 0.3],\n context: [\n {\n positive: 342,\n negative: 213,\n },\n {\n positive: 100,\n negative: 200,\n },\n ],\n limit: 5,\n },\n];\n\nclient.discoverBatchPoints(\"{collection_name}\", {\n searches,\n});\n" language: typescript + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\ndiscover_queries = [\n models.DiscoverRequest(\n target=[0.2, 0.1, 0.9, 0.7],\n context=[\n models.ContextExamplePair(\n positive=100,\n negative=718,\n ),\n models.ContextExamplePair(\n positive=200,\n negative=300,\n ),\n ],\n limit=10,\n ),\n models.DiscoverRequest(\n target=[0.5, 0.3, 0.2, 0.3],\n context=[\n models.ContextExamplePair(\n positive=342,\n negative=213,\n ),\n models.ContextExamplePair(\n positive=100,\n negative=200,\n ),\n ],\n limit=5,\n ),\n]\n\nclient.discover_batch(\"{collection_name}\", discover_queries)\n" + language: python + - code-samples: + - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\nimport java.util.Arrays;\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.ContextExamplePair;\nimport io.qdrant.client.grpc.Points.DiscoverPoints;\nimport io.qdrant.client.grpc.Points.TargetVector;\nimport io.qdrant.client.grpc.Points.VectorExample;\n\nQdrantClient client = new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nList discoverPoints = Arrays.asList(\n DiscoverPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setTarget(\n TargetVector.newBuilder()\n .setSingle(\n VectorExample.newBuilder()\n .setVector(vector(\n 0.2 f,\n 0.1 f,\n 0.9 f,\n 0.7 f))\n .build()))\n .addAllContext(\n List.of(\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample\n .newBuilder()\n .setId(id(100)))\n .setNegative(VectorExample\n .newBuilder()\n .setId(id(718)))\n .build(),\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample\n .newBuilder()\n .setId(id(200)))\n .setNegative(VectorExample\n .newBuilder()\n .setId(id(300)))\n .build()))\n .setLimit(10)\n .build(),\n DiscoverPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setTarget(\n TargetVector.newBuilder()\n .setSingle(\n VectorExample.newBuilder()\n .setVector(vector(\n 0.5 f, 0.3 f, 0.2 f, 0.3 f))\n .build()))\n .addAllContext(\n List.of(\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample\n .newBuilder()\n .setId(id(342)))\n .setNegative(VectorExample\n .newBuilder()\n .setId(id(213)))\n .build(),\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample\n .newBuilder()\n .setId(id(100)))\n .setNegative(VectorExample\n .newBuilder()\n .setId(id(200)))\n .build()))\n .setLimit(10)\n .build());\nclient.discoverBatchAsync(\"{collection_name}\", discoverPoints, null);\n" + language: java description: Retrieves points in batches based on the target and/or positive and negative example pairs. summary: Discover batch points tags: @@ -782,54 +782,54 @@ paths: /collections/{collection_name}/points/payload: post: x-fern-examples: + - 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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.set_payload(\n collection_name=\"{collection_name}\",\n payload={\n \"property1\": \"string\",\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n)\n" - language: python - - code-samples: - - code: "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: "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: "# 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: "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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.set_payload(\n collection_name=\"{collection_name}\",\n payload={\n \"property1\": \"string\",\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n)\n" + language: python + - code-samples: + - code: "import 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 description: Sets payload values for specified points. summary: Set payload tags: - Points put: x-fern-examples: + - 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: "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: "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: "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: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.ValueFactory.value;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .overwritePayloadAsync(\n \"{collection_name}\",\n Map.of(\"property1\", value(\"string\"), \"property2\", value(\"string\")),\n List.of(id(0), id(3), id(10)),\n true,\n null,\n null)\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc overwritePayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.OverwritePayload(context.Background(), &qdrant.SetPayloadPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\"property1\": \"string\",\n\t\t\t\"property2\": \"string\",\n\t\t}),\n\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(10)),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "# 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: "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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.overwrite_payload(\n collection_name=\"{collection_name}\",\n payload={\n \"property1\": \"string\",\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n)\n" + language: python + - code-samples: + - code: "import 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 description: Replaces the entire payload of a specified point with a new payload. summary: Overwrite payload tags: @@ -837,6 +837,9 @@ paths: /collections/{collection_name}/points/payload/clear: post: x-fern-examples: + - 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: 'using Qdrant.Client; @@ -848,24 +851,21 @@ paths: ' language: csharp - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.clear_payload(\n collection_name=\"{collection_name}\",\n points_selector=[0, 3, 100],\n)\n" - language: python - - code-samples: - - code: "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: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.clearPayloadAsync(\"{collection_name}\", List.of(id(0), id(3), id(100)), null, null, null)\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc clearPayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.ClearPayload(context.Background(), &qdrant.ClearPayloadPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewID(\"3\"), qdrant.NewIDNum(100)),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "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: "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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.clear_payload(\n collection_name=\"{collection_name}\",\n points_selector=[0, 3, 100],\n)\n" + language: python + - code-samples: + - code: "import 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 description: Removes the entire payload for specified points. summary: Clear payload tags: @@ -873,6 +873,9 @@ paths: /collections/{collection_name}/points/payload/delete: post: x-fern-examples: + - 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: 'using Qdrant.Client; @@ -884,24 +887,21 @@ paths: ' language: csharp - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete_payload(\n collection_name=\"{collection_name}\",\n keys=[\"color\", \"price\"],\n points=[0, 3, 100],\n)\n" - language: python - - code-samples: - - code: "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: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .deletePayloadAsync(\n \"{collection_name}\",\n List.of(\"color\", \"price\"),\n List.of(id(0), id(3), id(100)),\n true,\n null,\n null)\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deletePayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.DeletePayload(context.Background(), &qdrant.DeletePayloadPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(100)),\n\t\tKeys: []string{\"color\", \"price\"},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "# 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: "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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete_payload(\n collection_name=\"{collection_name}\",\n keys=[\"color\", \"price\"],\n points=[0, 3, 100],\n)\n" + language: python + - code-samples: + - code: "import 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 description: Deletes a specified key payload for points. summary: Delete payload tags: @@ -909,27 +909,27 @@ paths: /collections/{collection_name}/points/query: post: x-fern-examples: + - 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: "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: "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-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: "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 - 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: "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: "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: "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-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 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: @@ -937,27 +937,27 @@ paths: /collections/{collection_name}/points/query/batch: post: x-fern-examples: + - 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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nnearest = client.query_batch_points(\n collection_name=\"{collection_name}\",\n requests=[\n models.QueryRequest(\n query=[0.01, 0.45, 0.67, ...],\n ),\n models.QueryRequest(\n query=[0.11, 0.35, 0.6, ...],\n ),\n ]\n)" - language: python - - code-samples: - - code: "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: "import static io.qdrant.client.QueryFactory.nearest;\n\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\nimport io.qdrant.client.grpc.Points.QueryPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .queryBatchAsync(\n \"{collection_name}\",\n List.of(\n QueryPoints.newBuilder().setQuery(nearest(0.1f, 0.2f, 0.3f)).build(),\n QueryPoints.newBuilder().setQuery(nearest(0.4f, 0.5f, 0.6f)).build()))\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc queryBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresults, err := client.QueryBatch(context.Background(), &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\t\t},\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQuery(0.11, 0.35, 0.6),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go - code-samples: - - code: "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: "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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nnearest = client.query_batch_points(\n collection_name=\"{collection_name}\",\n requests=[\n models.QueryRequest(\n query=[0.01, 0.45, 0.67, ...],\n ),\n models.QueryRequest(\n query=[0.11, 0.35, 0.6, ...],\n ),\n ]\n)" + language: python + - code-samples: + - code: "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 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: @@ -966,26 +966,26 @@ paths: post: x-fern-examples: - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.QueryGroupsAsync(\n collectionName: \"{collection_name}\",\n groupBy: \"document_id\",\n groupSize: 5,\n limit: 10,\n query: new float[] {\n 0.01f, 0.45f, 0.67f\n }\n);\n" - language: csharp - - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.query_points_groups(\n collection_name=\"{collection_name}\",\n query=[0.01, 0.45, 0.67],\n group_by=\"document_id\",\n limit=10,\n group_size=5,\n)" - language: python - - code-samples: - - code: "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: "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: "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: "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: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc queryGroups() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tgroupSize := uint64(5)\n\tresults, err := client.QueryGroups(context.Background(), &qdrant.QueryPointGroups{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\tGroupBy: \"document_id\",\n\t\tGroupSize: &groupSize,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go - code-samples: - - code: "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: "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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.query_points_groups(\n collection_name=\"{collection_name}\",\n query=[0.01, 0.45, 0.67],\n group_by=\"document_id\",\n limit=10,\n group_size=5,\n)" + language: python + - code-samples: + - code: "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 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: @@ -993,27 +993,27 @@ paths: /collections/{collection_name}/points/recommend: post: x-fern-examples: + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"positive\": [\n 100,\n 231\n ],\n \"negative\": [\n \"3a6e2150-f7b7-496e-92cd-687e63e215fd\",\n [\n 0.2,\n 0.3,\n 0.4,\n 0.5\n ]\n ],\n \"filter\": {\n \"must\": [\n {\n \"key\": \"city\",\n \"match\": {\n \"value\": \"London\"\n }\n }\n ]\n },\n \"limit\": 1\n}'" + language: curl - code-samples: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendAsync(\n \"{collection_name}\",\n positive: new ulong[] { 100, 231 },\n negative: new ulong[] { 718 },\n filter: MatchKeyword(\"city\", \"London\"),\n limit: 3\n);\n" language: csharp - - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.recommend(\n collection_name=\"{collection_name}\",\n positive=[100, 231],\n negative=[718, [0.2, 0.3, 0.4, 0.5]],\n strategy=models.RecommendStrategy.AVERAGE_VECTOR,\n query_filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"city\",\n match=models.MatchValue(\n value=\"London\",\n ),\n )\n ]\n ),\n limit=3,\n)\n" - language: python - - code-samples: - - code: "use qdrant_client::qdrant::{Condition, Filter, RecommendPointsBuilder, RecommendStrategy};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .recommend(\n RecommendPointsBuilder::new(\"{collection_name}\", 3)\n .add_positive(100)\n .add_positive(200)\n .add_positive(vec![100.0, 231.0])\n .add_negative(718)\n .add_negative(vec![0.2, 0.3, 0.4, 0.5])\n .strategy(RecommendStrategy::AverageVector)\n .filter(Filter::must([Condition::matches(\n \"city\",\n \"London\".to_string(),\n )])),\n )\n .await?;\n" - language: rust - - code-samples: - - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\nimport static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Common.Filter;\nimport io.qdrant.client.grpc.Points.RecommendPoints;\nimport io.qdrant.client.grpc.Points.RecommendStrategy;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .recommendAsync(\n RecommendPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .addAllPositive(List.of(id(100), id(200)))\n .addAllPositiveVectors(List.of(vector(100.0f, 231.0f)))\n .addAllNegative(List.of(id(718)))\n .addAllPositiveVectors(List.of(vector(0.2f, 0.3f, 0.4f, 0.5f)))\n .setStrategy(RecommendStrategy.AverageVector)\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\")))\n .setLimit(3)\n .build())\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc recommend() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresults, err := client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(231)),\n\t\t\t},\n\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\t\t\t\tqdrant.NewVectorInput(0.2, 0.3, 0.4, 0.5),\n\t\t\t},\n\t\t\tStrategy: qdrant.RecommendStrategy_AverageVector.Enum(),\n\t\t}),\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"city\", \"London\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"positive\": [\n 100,\n 231\n ],\n \"negative\": [\n \"3a6e2150-f7b7-496e-92cd-687e63e215fd\",\n [\n 0.2,\n 0.3,\n 0.4,\n 0.5\n ]\n ],\n \"filter\": {\n \"must\": [\n {\n \"key\": \"city\",\n \"match\": {\n \"value\": \"London\"\n }\n }\n ]\n },\n \"limit\": 1\n}'" - language: curl + - code: "use qdrant_client::qdrant::{Condition, Filter, RecommendPointsBuilder, RecommendStrategy};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .recommend(\n RecommendPointsBuilder::new(\"{collection_name}\", 3)\n .add_positive(100)\n .add_positive(200)\n .add_positive(vec![100.0, 231.0])\n .add_negative(718)\n .add_negative(vec![0.2, 0.3, 0.4, 0.5])\n .strategy(RecommendStrategy::AverageVector)\n .filter(Filter::must([Condition::matches(\n \"city\",\n \"London\".to_string(),\n )])),\n )\n .await?;\n" + language: rust - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.recommend(\"{collection_name}\", {\n positive: [100, 231],\n negative: [718, [0.2, 0.3, 0.4, 0.5]],\n strategy: \"average_vector\",\n filter: {\n must: [\n {\n key: \"city\",\n match: {\n value: \"London\",\n },\n },\n ],\n },\n limit: 3,\n});\n" language: typescript + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.recommend(\n collection_name=\"{collection_name}\",\n positive=[100, 231],\n negative=[718, [0.2, 0.3, 0.4, 0.5]],\n strategy=models.RecommendStrategy.AVERAGE_VECTOR,\n query_filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"city\",\n match=models.MatchValue(\n value=\"London\",\n ),\n )\n ]\n ),\n limit=3,\n)\n" + language: python + - code-samples: + - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\nimport static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Common.Filter;\nimport io.qdrant.client.grpc.Points.RecommendPoints;\nimport io.qdrant.client.grpc.Points.RecommendStrategy;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .recommendAsync(\n RecommendPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .addAllPositive(List.of(id(100), id(200)))\n .addAllPositiveVectors(List.of(vector(100.0f, 231.0f)))\n .addAllNegative(List.of(id(718)))\n .addAllPositiveVectors(List.of(vector(0.2f, 0.3f, 0.4f, 0.5f)))\n .setStrategy(RecommendStrategy.AverageVector)\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\")))\n .setLimit(3)\n .build())\n .get();\n" + language: java description: Retrieves points that are closer to stored positive examples and further from negative examples. summary: Recommend points tags: @@ -1021,27 +1021,27 @@ paths: /collections/{collection_name}/points/recommend/batch: post: x-fern-examples: + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"positive\": [\n 100,\n 231\n ],\n \"negative\": [\n \"9ad0884a-7bfe-43c0-b88f-c1d9a588b7e1\"\n ],\n \"limit\": 1\n },\n {\n \"positive\": [\n 200,\n 67\n ],\n \"negative\": [\n 300\n ],\n \"limit\": 5\n }\n ]\n}'" + language: curl - code-samples: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter = MatchKeyword(\"city\", \"london\");\n\nawait client.RecommendBatchAsync(\n collectionName: \"{collection_name}\",\n recommendSearches:\n [\n new()\n {\n CollectionName = \"{collection_name}\",\n Positive = { new PointId[] { 100, 231 } },\n Negative = { new PointId[] { 718 } },\n Limit = 3,\n Filter = filter,\n },\n new()\n {\n CollectionName = \"{collection_name}\",\n Positive = { new PointId[] { 200, 67 } },\n Negative = { new PointId[] { 300 } },\n Limit = 3,\n Filter = filter,\n }\n ]\n);\n" language: csharp - - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nrecommend_queries = [\n models.RecommendRequest(\n positive=[100, 231], negative=[718], filter=filter_, limit=3\n ),\n models.RecommendRequest(positive=[200, 67], negative=[300], limit=3),\n]\n\nclient.recommend_batch(collection_name=\"{collection_name}\", requests=recommend_queries)\n" - language: python - - code-samples: - - code: "use qdrant_client::qdrant::{\n Condition, Filter, RecommendBatchPointsBuilder, RecommendPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet filter = Filter::must([Condition::matches(\"city\", \"London\".to_string())]);\nlet recommend_queries = vec![\n RecommendPointsBuilder::new(\"{collection_name}\", 3)\n .add_positive(100)\n .add_positive(231)\n .add_negative(718)\n .filter(filter.clone())\n .build(),\n RecommendPointsBuilder::new(\"{collection_name}\", 3)\n .add_positive(200)\n .add_positive(67)\n .add_negative(300)\n .filter(filter.clone())\n .build(),\n];\n\nclient\n .recommend_batch(RecommendBatchPointsBuilder::new(\n \"{collection_name}\",\n recommend_queries,\n ))\n .await?;\n" - language: rust - - code-samples: - - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\nimport static io.qdrant.client.PointIdFactory.id;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Common.Filter;\nimport io.qdrant.client.grpc.Points.RecommendPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\")).build();\n\nList recommendQueries =\n List.of(\n RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(100), id(231)))\n .addAllNegative(List.of(id(718)))\n .setFilter(filter)\n .setLimit(3)\n .build(),\n RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(200), id(67)))\n .addAllNegative(List.of(id(300)))\n .setFilter(filter)\n .setLimit(3)\n .build());\n\nclient.recommendBatchAsync(\"{collection_name}\", recommendQueries, null).get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc recommendBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresults, err := client.QueryBatch(context.Background(), &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\t\t\t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(231)),\n\t\t\t\t\t},\n\t\t\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\t\t\t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(67)),\n\t\t\t\t\t},\n\t\t\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(300)),\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"positive\": [\n 100,\n 231\n ],\n \"negative\": [\n \"9ad0884a-7bfe-43c0-b88f-c1d9a588b7e1\"\n ],\n \"limit\": 1\n },\n {\n \"positive\": [\n 200,\n 67\n ],\n \"negative\": [\n 300\n ],\n \"limit\": 5\n }\n ]\n}'" - language: curl + - code: "use qdrant_client::qdrant::{\n Condition, Filter, RecommendBatchPointsBuilder, RecommendPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet filter = Filter::must([Condition::matches(\"city\", \"London\".to_string())]);\nlet recommend_queries = vec![\n RecommendPointsBuilder::new(\"{collection_name}\", 3)\n .add_positive(100)\n .add_positive(231)\n .add_negative(718)\n .filter(filter.clone())\n .build(),\n RecommendPointsBuilder::new(\"{collection_name}\", 3)\n .add_positive(200)\n .add_positive(67)\n .add_negative(300)\n .filter(filter.clone())\n .build(),\n];\n\nclient\n .recommend_batch(RecommendBatchPointsBuilder::new(\n \"{collection_name}\",\n recommend_queries,\n ))\n .await?;\n" + language: rust - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nconst searches = [\n {\n positive: [100, 231],\n negative: [718],\n limit: 3,\n },\n {\n positive: [200, 67],\n negative: [300],\n limit: 3,\n },\n];\n\nclient.recommend_batch(\"{collection_name}\", {\n searches,\n});\n" language: typescript + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nrecommend_queries = [\n models.RecommendRequest(\n positive=[100, 231], negative=[718], filter=filter_, limit=3\n ),\n models.RecommendRequest(positive=[200, 67], negative=[300], limit=3),\n]\n\nclient.recommend_batch(collection_name=\"{collection_name}\", requests=recommend_queries)\n" + language: python + - code-samples: + - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\nimport static io.qdrant.client.PointIdFactory.id;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Common.Filter;\nimport io.qdrant.client.grpc.Points.RecommendPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\")).build();\n\nList recommendQueries =\n List.of(\n RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(100), id(231)))\n .addAllNegative(List.of(id(718)))\n .setFilter(filter)\n .setLimit(3)\n .build(),\n RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(200), id(67)))\n .addAllNegative(List.of(id(300)))\n .setFilter(filter)\n .setLimit(3)\n .build());\n\nclient.recommendBatchAsync(\"{collection_name}\", recommendQueries, null).get();\n" + language: java description: Retrieves points in batches that are closer to stored positive examples and further from negative examples. summary: Recommend batch points tags: @@ -1049,27 +1049,27 @@ paths: /collections/{collection_name}/points/recommend/groups: post: x-fern-examples: + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend/groups' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"positive\": [\n 100,\n 231\n ],\n \"negative\": [\n 718\n ],\n \"group_by\": \"document_id\",\n \"limit\": 3,\n \"group_size\": 2\n}'" + language: curl - code-samples: - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendGroupsAsync(\n \"{collection_name}\",\n \"document_id\",\n groupSize: 3,\n positive: new ulong[] { 100, 231 },\n negative: new ulong[] { 718 },\n filter: MatchKeyword(\"city\", \"London\"),\n limit: 3\n);\n" language: csharp - - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.recommend_groups(\n collection_name=\"{collection_name}\",\n positive=[100, 231],\n negative=[718],\n group_by=\"document_id\",\n limit=3,\n group_size=2,\n)\n" - language: python - - code-samples: - - code: "use qdrant_client::qdrant::{RecommendPointGroupsBuilder, RecommendStrategy};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .recommend_groups(\n RecommendPointGroupsBuilder::new(\"{collection_name}\", \"document_id\", 2, 3)\n .add_positive(100)\n .add_positive(200)\n .add_negative(718)\n .strategy(RecommendStrategy::AverageVector),\n )\n .await?;\n" - language: rust - - code-samples: - - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.RecommendPointGroups;\nimport io.qdrant.client.grpc.Points.RecommendStrategy;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.recommendGroupsAsync(RecommendPointGroups.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setGroupBy(\"document_id\")\n .setGroupSize(2)\n .addAllPositive(List.of(id(100), id(200)))\n .addAllNegative(List.of(id(718)))\n .setStrategy(RecommendStrategy.AverageVector)\n .setLimit(3)\n .build());\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc recommendGroups() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tgroupSize := uint64(5)\n\tresults, err := client.QueryGroups(context.Background(), &qdrant.QueryPointGroups{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(231)),\n\t\t\t},\n\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\t\t\t},\n\t\t}),\n\t\tGroupBy: \"document_id\",\n\t\tGroupSize: &groupSize,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend/groups' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"positive\": [\n 100,\n 231\n ],\n \"negative\": [\n 718\n ],\n \"group_by\": \"document_id\",\n \"limit\": 3,\n \"group_size\": 2\n}'" - language: curl + - code: "use qdrant_client::qdrant::{RecommendPointGroupsBuilder, RecommendStrategy};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .recommend_groups(\n RecommendPointGroupsBuilder::new(\"{collection_name}\", \"document_id\", 2, 3)\n .add_positive(100)\n .add_positive(200)\n .add_negative(718)\n .strategy(RecommendStrategy::AverageVector),\n )\n .await?;\n" + language: rust - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.recommendPointGroups(\"{collection_name}\", {\n positive: [100, 231],\n negative: [718],\n group_by: \"document_id\",\n limit: 3,\n group_size: 2,\n});\n" language: typescript + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.recommend_groups(\n collection_name=\"{collection_name}\",\n positive=[100, 231],\n negative=[718],\n group_by=\"document_id\",\n limit=3,\n group_size=2,\n)\n" + language: python + - code-samples: + - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.RecommendPointGroups;\nimport io.qdrant.client.grpc.Points.RecommendStrategy;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.recommendGroupsAsync(RecommendPointGroups.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setGroupBy(\"document_id\")\n .setGroupSize(2)\n .addAllPositive(List.of(id(100), id(200)))\n .addAllNegative(List.of(id(718)))\n .setStrategy(RecommendStrategy.AverageVector)\n .setLimit(3)\n .build());\n" + language: java description: Retrieves points that are closer to stored positive examples and further from negative examples. Results are grouped by the specified payload field. summary: Recommend point groups tags: @@ -1077,27 +1077,27 @@ paths: /collections/{collection_name}/points/scroll: post: x-fern-examples: + - 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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.scroll(\n collection_name=\"{collection_name}\",\n scroll_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n limit=1,\n with_payload=True,\n with_vectors=False,\n)\n" - language: python - - code-samples: - - code: "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: "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 - 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: "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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.scroll(\n collection_name=\"{collection_name}\",\n scroll_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n limit=1,\n with_payload=True,\n with_vectors=False,\n)\n" + language: python + - code-samples: + - code: "import 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 description: 'Returns all points in a page-by-page manner. By default, all resulting points are sorted by {id}. @@ -1113,27 +1113,27 @@ paths: /collections/{collection_name}/points/search: post: x-fern-examples: + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"limit\": 1,\n \"filter\": {\n \"must\": [\n {\n \"key\": \"city\",\n \"match\": {\n \"value\": \"London\"\n }\n }\n ]\n }\n}'" + language: curl - code-samples: - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchAsync(\n collectionName: \"{collection_name}\",\n vector: new float[] { 0.2f, 0.1f, 0.9f, 0.7f },\n filter: MatchKeyword(\"city\", \"London\"),\n limit: 3\n);\n" language: csharp - - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.search(\n collection_name=\"{collection_name}\",\n query_filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"city\",\n match=models.MatchValue(\n value=\"London\",\n ),\n )\n ]\n ),\n query_vector=[0.2, 0.1, 0.9, 0.7],\n limit=3,\n)\n" - language: python - - code-samples: - - code: "use qdrant_client::qdrant::{Condition, Filter, SearchParamsBuilder, SearchPointsBuilder};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .search_points(\n SearchPointsBuilder::new(\"{collection_name}\", vec![0.2, 0.1, 0.9, 0.7], 3)\n .filter(Filter::must([Condition::matches(\n \"city\",\n \"London\".to_string(),\n )]))\n .params(SearchParamsBuilder::default().hnsw_ef(128).exact(false)),\n )\n .await?;\n" - language: rust - - code-samples: - - code: "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;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .searchAsync(\n SearchPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\")).build())\n .addAllVector(List.of(0.2f, 0.1f, 0.9f, 0.7f))\n .setLimit(3)\n .build())\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc search() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tlimit := uint64(3)\n\tresults, err := client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQuery(0.2, 0.1, 0.9, 0.7),\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"city\", \"London\"),\n\t\t\t},\n\t\t},\n\t\tLimit: &limit,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"limit\": 1,\n \"filter\": {\n \"must\": [\n {\n \"key\": \"city\",\n \"match\": {\n \"value\": \"London\"\n }\n }\n ]\n }\n}'" - language: curl + - code: "use qdrant_client::qdrant::{Condition, Filter, SearchParamsBuilder, SearchPointsBuilder};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .search_points(\n SearchPointsBuilder::new(\"{collection_name}\", vec![0.2, 0.1, 0.9, 0.7], 3)\n .filter(Filter::must([Condition::matches(\n \"city\",\n \"London\".to_string(),\n )]))\n .params(SearchParamsBuilder::default().hnsw_ef(128).exact(false)),\n )\n .await?;\n" + language: rust - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.search(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"city\",\n match: {\n value: \"London\",\n },\n },\n ],\n },\n vector: [0.2, 0.1, 0.9, 0.7],\n limit: 3,\n});\n" language: typescript + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.search(\n collection_name=\"{collection_name}\",\n query_filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"city\",\n match=models.MatchValue(\n value=\"London\",\n ),\n )\n ]\n ),\n query_vector=[0.2, 0.1, 0.9, 0.7],\n limit=3,\n)\n" + language: python + - code-samples: + - code: "import 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;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .searchAsync(\n SearchPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\")).build())\n .addAllVector(List.of(0.2f, 0.1f, 0.9f, 0.7f))\n .setLimit(3)\n .build())\n .get();\n" + language: java description: Retrieves the closest points based on vector similarity and given filtering conditions. summary: Search points tags: @@ -1141,27 +1141,27 @@ paths: /collections/{collection_name}/points/search/batch: post: x-fern-examples: + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"limit\": 3\n },\n {\n \"vector\": [\n 0.5,\n 0.3,\n 0.2,\n 0.3\n ],\n \"filter\": {\n \"must\": [\n {\n \"key\": \"city\",\n \"match\": {\n \"value\": \"London\"\n }\n }\n ]\n },\n \"limit\": 3\n }\n ]\n}'" + language: curl - code-samples: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter = MatchKeyword(\"city\", \"London\");\n\nvar searches = new List\n{\n new()\n {\n Vector = { new float[] { 0.2f, 0.1f, 0.9f, 0.7f } },\n Filter = filter,\n Limit = 3\n },\n new()\n {\n Vector = { new float[] { 0.5f, 0.3f, 0.2f, 0.3f } },\n Filter = filter,\n Limit = 3\n }\n};\n\nawait client.SearchBatchAsync(collectionName: \"{collection_name}\", searches: searches);\n" language: csharp - - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nfilter_ = models.Filter(\n must=[\n models.FieldCondition(\n key=\"city\",\n match=models.MatchValue(\n value=\"London\",\n ),\n )\n ]\n)\n\nsearch_queries = [\n models.SearchRequest(vector=[0.2, 0.1, 0.9, 0.7], filter=filter_, limit=3),\n models.SearchRequest(vector=[0.5, 0.3, 0.2, 0.3], filter=filter_, limit=3),\n]\n\nclient.search_batch(collection_name=\"{collection_name}\", requests=search_queries)\n" - language: python - - code-samples: - - code: "use qdrant_client::qdrant::{\n Condition, Filter, SearchBatchPointsBuilder, SearchPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet filter = Filter::must([Condition::matches(\"city\", \"London\".to_string())]);\n\nlet searches = vec![\n SearchPointsBuilder::new(\"{collection_name}\", vec![0.2, 0.1, 0.9, 0.7], 3)\n .filter(filter.clone())\n .build(),\n SearchPointsBuilder::new(\"{collection_name}\", vec![0.5, 0.3, 0.2, 0.3], 3)\n .filter(filter.clone())\n .build(),\n];\n\nclient\n .search_batch_points(SearchBatchPointsBuilder::new(\"{collection_name}\", searches))\n .await?;\n" - language: rust - - code-samples: - - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Common.Filter;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\")).build();\nList searches =\n List.of(\n SearchPoints.newBuilder()\n .addAllVector(List.of(0.2f, 0.1f, 0.9f, 0.7f))\n .setFilter(filter)\n .setLimit(3)\n .build(),\n SearchPoints.newBuilder()\n .addAllVector(List.of(0.5f, 0.3f, 0.2f, 0.3f))\n .setFilter(filter)\n .setLimit(3)\n .build());\nclient.searchBatchAsync(\"{collection_name}\", searches, null).get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc searchBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfilter := qdrant.Filter{\n\t\tMust: []*qdrant.Condition{\n\t\t\tqdrant.NewMatch(\"city\", \"London\"),\n\t\t},\n\t}\n\tlimit := uint64(3)\n\tresults, err := client.QueryBatch(context.Background(), &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQuery(0.2, 0.1, 0.9, 0.7),\n\t\t\t\tLimit: &limit,\n\t\t\t\tFilter: &filter,\n\t\t\t},\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQuery(0.5, 0.3, 0.2, 0.3),\n\t\t\t\tLimit: &limit,\n\t\t\t\tFilter: &filter,\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"limit\": 3\n },\n {\n \"vector\": [\n 0.5,\n 0.3,\n 0.2,\n 0.3\n ],\n \"filter\": {\n \"must\": [\n {\n \"key\": \"city\",\n \"match\": {\n \"value\": \"London\"\n }\n }\n ]\n },\n \"limit\": 3\n }\n ]\n}'" - language: curl + - code: "use qdrant_client::qdrant::{\n Condition, Filter, SearchBatchPointsBuilder, SearchPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet filter = Filter::must([Condition::matches(\"city\", \"London\".to_string())]);\n\nlet searches = vec![\n SearchPointsBuilder::new(\"{collection_name}\", vec![0.2, 0.1, 0.9, 0.7], 3)\n .filter(filter.clone())\n .build(),\n SearchPointsBuilder::new(\"{collection_name}\", vec![0.5, 0.3, 0.2, 0.3], 3)\n .filter(filter.clone())\n .build(),\n];\n\nclient\n .search_batch_points(SearchBatchPointsBuilder::new(\"{collection_name}\", searches))\n .await?;\n" + language: rust - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nconst filter = {\n must: [\n {\n key: \"city\",\n match: {\n value: \"London\",\n },\n },\n ],\n};\n\nconst searches = [\n {\n vector: [0.2, 0.1, 0.9, 0.7],\n filter,\n limit: 3,\n },\n {\n vector: [0.5, 0.3, 0.2, 0.3],\n filter,\n limit: 3,\n },\n];\n\nclient.searchBatch(\"{collection_name}\", {\n searches,\n});\n" language: typescript + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nfilter_ = models.Filter(\n must=[\n models.FieldCondition(\n key=\"city\",\n match=models.MatchValue(\n value=\"London\",\n ),\n )\n ]\n)\n\nsearch_queries = [\n models.SearchRequest(vector=[0.2, 0.1, 0.9, 0.7], filter=filter_, limit=3),\n models.SearchRequest(vector=[0.5, 0.3, 0.2, 0.3], filter=filter_, limit=3),\n]\n\nclient.search_batch(collection_name=\"{collection_name}\", requests=search_queries)\n" + language: python + - code-samples: + - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Common.Filter;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\")).build();\nList searches =\n List.of(\n SearchPoints.newBuilder()\n .addAllVector(List.of(0.2f, 0.1f, 0.9f, 0.7f))\n .setFilter(filter)\n .setLimit(3)\n .build(),\n SearchPoints.newBuilder()\n .addAllVector(List.of(0.5f, 0.3f, 0.2f, 0.3f))\n .setFilter(filter)\n .setLimit(3)\n .build());\nclient.searchBatchAsync(\"{collection_name}\", searches, null).get();\n" + language: java description: Retrieves the closest points in batches based on vector similarity and given filtering conditions. summary: Search batch points tags: @@ -1169,27 +1169,27 @@ paths: /collections/{collection_name}/points/search/groups: post: x-fern-examples: + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search/groups' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"group_by\": \"document_id\",\n \"limit\": 4,\n \"group_size\": 2\n}'" + language: curl - code-samples: - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchGroupsAsync(\n collectionName: \"{collection_name}\",\n vector: new float[] { 1.1f },\n groupBy: \"document_id\",\n limit: 4,\n groupSize: 2\n);\n" language: csharp - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.search_groups(\n collection_name=\"{collection_name}\",\n query_vector=[1.1],\n group_by=\"document_id\",\n limit=4,\n group_size=2,\n)\n" - language: python - - code-samples: - - code: "use qdrant_client::qdrant::SearchPointGroupsBuilder;\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .search_groups(SearchPointGroupsBuilder::new(\n \"{collection_name}\",\n vec![1.1],\n 4,\n \"document_id\",\n 2,\n ))\n .await?;\n" - language: rust - - code-samples: - - code: "import java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.SearchPointGroups;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .searchGroupsAsync(\n SearchPointGroups.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .addAllVector(List.of(1.1f))\n .setGroupBy(\"document_id\")\n .setLimit(4)\n .setGroupSize(2)\n .build())\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc searchGroups() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tgroupSize := uint64(2)\n\tresults, err := client.QueryGroups(context.Background(), &qdrant.QueryPointGroups{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\tGroupBy: \"document_id\",\n\t\tGroupSize: &groupSize,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search/groups' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"group_by\": \"document_id\",\n \"limit\": 4,\n \"group_size\": 2\n}'" - language: curl + - code: "use qdrant_client::qdrant::SearchPointGroupsBuilder;\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .search_groups(SearchPointGroupsBuilder::new(\n \"{collection_name}\",\n vec![1.1],\n 4,\n \"document_id\",\n 2,\n ))\n .await?;\n" + language: rust - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.searchPointGroups(\"{collection_name}\", {\n vector: [1.1],\n group_by: \"document_id\",\n limit: 4,\n group_size: 2,\n});\n" language: typescript + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.search_groups(\n collection_name=\"{collection_name}\",\n query_vector=[1.1],\n group_by=\"document_id\",\n limit=4,\n group_size=2,\n)\n" + language: python + - code-samples: + - code: "import java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.SearchPointGroups;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .searchGroupsAsync(\n SearchPointGroups.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .addAllVector(List.of(1.1f))\n .setGroupBy(\"document_id\")\n .setLimit(4)\n .setGroupSize(2)\n .build())\n .get();\n" + language: java description: Retrieves the closest points based on vector similarity and given filtering conditions, grouped by a given payload field. summary: Search point groups tags: @@ -1201,20 +1201,20 @@ 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: "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: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc searchMatiOffsets() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsample := uint64(100)\n\tlimit := uint64(5)\n\tresults, err := client.SearchMatrixOffsets(context.Background(), &qdrant.SearchMatrixPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tSample: &sample,\n\t\tLimit: &limit,\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" + language: go - code-samples: - code: "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: "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 - 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-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 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: @@ -1226,20 +1226,20 @@ 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: "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: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc searchMatixPairs() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsample := uint64(100)\n\tlimit := uint64(5)\n\tresults, err := client.SearchMatrixPairs(context.Background(), &qdrant.SearchMatrixPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tSample: &sample,\n\t\tLimit: &limit,\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" + language: go - code-samples: - code: "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: "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 - 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-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 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: @@ -1247,27 +1247,27 @@ paths: /collections/{collection_name}/points/vectors: put: x-fern-examples: + - 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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.update_vectors(\n collection_name=\"{collection_name}\",\n points=[\n models.PointVectors(\n id=1,\n vector={\n \"image\": [0.1, 0.2, 0.3, 0.4],\n },\n ),\n models.PointVectors(\n id=2,\n vector={\n \"text\": [0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n ),\n ],\n)\n" - language: python - - code-samples: - - code: "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: "import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .updateVectorsAsync(\n \"{collection_name}\",\n List.of(\n PointVectors.newBuilder()\n .setId(id(1))\n .setVectors(namedVectors(Map.of(\"image\", vector(List.of(0.1f, 0.2f, 0.3f, 0.4f)))))\n .build(),\n PointVectors.newBuilder()\n .setId(id(2))\n .setVectors(\n namedVectors(\n Map.of(\n \"text\", vector(List.of(0.9f, 0.8f, 0.7f, 0.6f, 0.5f, 0.4f, 0.3f, 0.2f)))))\n .build()))\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc updateVectors() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.UpdateVectors(context.Background(), &qdrant.UpdatePointVectors{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: []*qdrant.PointVectors{\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(1),\n\t\t\t\tVectors: qdrant.NewVectorsMap(map[string]*qdrant.Vector{\n\t\t\t\t\t\"image\": qdrant.NewVector(0.1, 0.2, 0.3, 0.4),\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(2),\n\t\t\t\tVectors: qdrant.NewVectorsMap(map[string]*qdrant.Vector{\n\t\t\t\t\t\"text\": qdrant.NewVector(0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2),\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "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: "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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.update_vectors(\n collection_name=\"{collection_name}\",\n points=[\n models.PointVectors(\n id=1,\n vector={\n \"image\": [0.1, 0.2, 0.3, 0.4],\n },\n ),\n models.PointVectors(\n id=2,\n vector={\n \"text\": [0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n ),\n ],\n)\n" + language: python + - code-samples: + - code: "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 description: Updates specified vectors on points. All other unspecified vectors will stay intact. summary: Update vectors tags: @@ -1275,6 +1275,9 @@ paths: /collections/{collection_name}/points/vectors/delete: post: x-fern-examples: + - 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: 'using Qdrant.Client; @@ -1286,24 +1289,21 @@ paths: ' language: csharp - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete_vectors(\n collection_name=\"{collection_name}\",\n points=[0, 3, 100],\n vectors=[\"text\", \"image\"],\n)\n" - language: python - - code-samples: - - code: "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: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .deleteVectorsAsync(\n \"{collection_name}\", List.of(\"text\", \"image\"), List.of(id(0), id(3), id(10)))\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteVectors() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.DeleteVectors(context.Background(), &qdrant.DeletePointVectors{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(100)),\n\t\tVectors: &qdrant.VectorsSelector{\n\t\t\tNames: []string{\"text\", \"image\"},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "# 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: "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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete_vectors(\n collection_name=\"{collection_name}\",\n points=[0, 3, 100],\n vectors=[\"text\", \"image\"],\n)\n" + language: python + - code-samples: + - code: "import 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 description: Deletes specified vectors from points. All other unspecified vectors will stay intact. summary: Delete vectors tags: @@ -1311,9 +1311,21 @@ paths: /collections/{collection_name}/shards: put: x-fern-examples: + - 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: "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: "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: "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: "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: 'from qdrant_client import QdrantClient @@ -1325,21 +1337,9 @@ paths: ' language: python - - 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: "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: "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: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n});\n\nclient.createShardKey(\"{collection_name}\", {\n shard_key: \"{shard_key}\"\n});\n" - language: typescript description: Creates one or more shard keys for a specified collection. summary: Create a shard key tags: @@ -1347,9 +1347,21 @@ paths: /collections/{collection_name}/shards/delete: post: x-fern-examples: + - 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: "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: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteShardKey() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteShardKey(context.Background(), \"{collection_name}\", &qdrant.DeleteShardKey{\n\t\tShardKey: qdrant.NewShardKey(\"{shard_key}\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go + - code-samples: + - code: "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: "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: 'from qdrant_client import QdrantClient @@ -1361,21 +1373,9 @@ paths: ' language: python - - 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: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.DeleteShardKey;\nimport io.qdrant.client.grpc.Collections.DeleteShardKeyRequest;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteShardKeyAsync(DeleteShardKeyRequest.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setRequest(DeleteShardKey.newBuilder()\n .setShardKey(shardKey(\"{shard_key}\"))\n .build())\n .build()).get();\n" language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteShardKey() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteShardKey(context.Background(), \"{collection_name}\", &qdrant.DeleteShardKey{\n\t\tShardKey: qdrant.NewShardKey(\"{shard_key}\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go - - code-samples: - - code: "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: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n});\n\nclient.deleteShardKey(\"{collection_name}\", {\n shard_key: \"{shard_key}\"\n});\n" - language: typescript description: Deletes one or more shard keys for a specified collection. summary: Delete a shard key tags: @@ -1383,6 +1383,9 @@ paths: /collections/{collection_name}/snapshots: get: x-fern-examples: + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/snapshots' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'using Qdrant.Client; @@ -1395,16 +1398,8 @@ paths: ' language: csharp - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.list_snapshots(collection_name="{collection_name}") - -' - language: python + - 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 - code-samples: - code: 'use qdrant_client::Qdrant; @@ -1416,15 +1411,6 @@ paths: ' language: rust - - 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 - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/snapshots' \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -1436,12 +1422,29 @@ paths: ' language: typescript + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.list_snapshots(collection_name="{collection_name}") + +' + language: python + - code-samples: + - code: "import 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 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: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/snapshots' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'using Qdrant.Client; @@ -1454,16 +1457,8 @@ paths: ' language: csharp - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.create_snapshot(collection_name="{collection_name}") - -' - language: python + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc createSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsnapshot, err := client.CreateSnapshot(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Snapshot created: \", snapshot.Name)\n}\n" + language: go - code-samples: - code: 'use qdrant_client::Qdrant; @@ -1475,15 +1470,6 @@ paths: ' language: rust - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createSnapshotAsync(\"{collection_name}\").get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc createSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsnapshot, err := client.CreateSnapshot(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Snapshot created: \", snapshot.Name)\n}\n" - language: go - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/snapshots' \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -1495,6 +1481,20 @@ paths: ' language: typescript + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.create_snapshot(collection_name="{collection_name}") + +' + language: python + - code-samples: + - code: "import 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 description: Creates a new snapshot for a specified collection. summary: Create a snapshot (collection) tags: @@ -1502,15 +1502,15 @@ paths: /collections/{collection_name}/snapshots/recover: put: x-fern-examples: - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.recover_snapshot(\n \"{collection_name}\",\n \"http://example.com/path/to/snapshot.shapshot\",\n)\n" - language: python - code-samples: - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/snapshots/recover' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"location\": \"http://example.com/path/to/snapshot.shapshot\"\n}'" language: curl - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.recoverSnapshot(\"{collection_name}\", {\n location: \"http://example.com/path/to/snapshot.shapshot\",\n});\n" language: typescript + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.recover_snapshot(\n \"{collection_name}\",\n \"http://example.com/path/to/snapshot.shapshot\",\n)\n" + language: python description: Recovers local collection data from a snapshot. This will overwrite any collection data stored on the node. If the collection does not exist, it will be created. summary: Recover from a snapshot (collection) tags: @@ -1528,6 +1528,9 @@ paths: /collections/{collection_name}/snapshots/{snapshot_name}: delete: x-fern-examples: + - 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: 'using Qdrant.Client; @@ -1539,21 +1542,12 @@ paths: ' language: csharp - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete_snapshot(\n collection_name=\"{collection_name}\", snapshot_name=\"{snapshot_name}\"\n)\n" - language: python - - code-samples: - - code: "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: "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 - code-samples: - - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/snapshots/snapshot_name' \\\n --header 'api-key: '" - language: curl + - 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: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -1565,6 +1559,12 @@ paths: ' language: typescript + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete_snapshot(\n collection_name=\"{collection_name}\", snapshot_name=\"{snapshot_name}\"\n)\n" + language: python + - code-samples: + - code: "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 description: Deletes the specified snapshot for a collection. summary: Delete a snapshot (collection) tags: @@ -1577,6 +1577,9 @@ paths: /snapshots: get: x-fern-examples: + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/snapshots' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'using Qdrant.Client; @@ -1589,16 +1592,8 @@ paths: ' language: csharp - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.list_full_snapshots() - -' - language: python + - 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 - code-samples: - code: 'use qdrant_client::Qdrant; @@ -1610,15 +1605,6 @@ paths: ' language: rust - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listFullSnapshotAsync().get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc listFullSnapshots() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsnapshots, err := client.ListFullSnapshots(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Full snapshots: \", snapshots)\n}\n" - language: go - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/snapshots' \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -1630,12 +1616,29 @@ paths: ' language: typescript + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.list_full_snapshots() + +' + language: python + - 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 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: "curl -X POST \\\n 'http://localhost:6333/snapshots' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'using Qdrant.Client; @@ -1648,16 +1651,8 @@ paths: ' language: csharp - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.create_full_snapshot() - -' - language: python + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc createFullSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsnapshot, err := client.CreateFullSnapshot(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Snapshot created: \", snapshot.Name)\n}\n" + language: go - code-samples: - code: 'use qdrant_client::Qdrant; @@ -1669,15 +1664,6 @@ paths: ' language: rust - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createFullSnapshotAsync().get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc createFullSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsnapshot, err := client.CreateFullSnapshot(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Snapshot created: \", snapshot.Name)\n}\n" - language: go - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/snapshots' \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -1689,6 +1675,20 @@ paths: ' language: typescript + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.create_full_snapshot() + +' + language: python + - 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 description: Creates a new snapshot of the entire storage. summary: Create a snapshot (storage) tags: @@ -1696,6 +1696,9 @@ paths: /snapshots/{snapshot_name}: delete: x-fern-examples: + - code-samples: + - code: "curl -X DELETE \\\n 'http://localhost:6333/snapshots/snapshot_name' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'using Qdrant.Client; @@ -1708,16 +1711,8 @@ paths: ' language: csharp - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.delete_full_snapshot(snapshot_name="{snapshot_name}") - -' - language: python + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteFullSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteFullSnapshot(context.Background(), \"{snapshot_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go - code-samples: - code: 'use qdrant_client::Qdrant; @@ -1729,15 +1724,6 @@ paths: ' language: rust - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteFullSnapshotAsync(\"{snapshot_name}\").get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteFullSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteFullSnapshot(context.Background(), \"{snapshot_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go - - code-samples: - - code: "curl -X DELETE \\\n 'http://localhost:6333/snapshots/snapshot_name' \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -1749,6 +1735,20 @@ paths: ' language: typescript + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.delete_full_snapshot(snapshot_name="{snapshot_name}") + +' + language: python + - 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 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 28fa6f0..6c78056 100644 --- a/fern/apis/master/openapi.json +++ b/fern/apis/master/openapi.json @@ -7515,7 +7515,7 @@ "nullable": true }, "datatype": { - "description": "Defines which datatype should be used to represent vectors in the storage. Choosing different datatypes allows to optimize memory usage and performance vs accuracy.\n\n- For `float32` datatype - vectors are stored as single-precision floating point numbers, 4 bytes. - For `float16` datatype - vectors are stored as half-precision floating point numbers, 2 bytes. - For `uint8` datatype - vectors are stored as unsigned 8-bit integers, 1 byte. It expects vector elements to be in range `[0, 255]`.", + "description": "Defines which datatype should be used to represent vectors in the storage. Choosing different datatypes allows to optimize memory usage and performance vs accuracy.\n\n- For `float32` datatype - vectors are stored as single-precision floating point numbers, 4 bytes. - For `float16` datatype - vectors are stored as half-precision floating point numbers, 2 bytes. - For `uint8` datatype - vectors are stored as unsigned 8-bit integers, 1 byte. It expects vector elements to be in range `[0, 255]`. - For `turbo4` datatype - vectors are quantized to 4 bits per element using the TurboQuant algorithm.", "anyOf": [ { "$ref": "#/components/schemas/Datatype" @@ -7792,7 +7792,8 @@ "enum": [ "float32", "uint8", - "float16" + "float16", + "turbo4" ] }, "MultiVectorConfig": { @@ -8005,7 +8006,7 @@ "nullable": true }, "prevent_unoptimized": { - "description": "If this option is set, service will try to prevent creation of large unoptimized segments. When enabled, updates may be blocked at request level if there are unoptimized segments larger than indexing threshold. Updates will be resumed when optimization is completed and segments are optimized below the threshold. Using this option may lead to increased delay between submitting an update and its application. Default is disabled.", + "description": "If enabled, the service will try to prevent the creation of large unoptimized segments. When enabled, new points written to segments larger than the indexing threshold are stored as \"deferred points\": they are persisted in the WAL and segments, but excluded from read/search results until the corresponding segments are optimized (e.g. indexed, quantized, or moved to mmap storage). Update requests with `wait=true` will only return after the deferred points become visible, which may significantly increase the perceived latency between submitting an update and its completion. Update requests with `wait=false` are not affected. Default is disabled.", "default": null, "type": "boolean", "nullable": true @@ -8188,6 +8189,13 @@ "format": "uint8", "minimum": 0, "nullable": true + }, + "max_disk_usage_percent": { + "description": "Reject disk-consuming update operations when the storage filesystem exceeds this percentage of total capacity (1-100)", + "type": "integer", + "format": "uint8", + "minimum": 0, + "nullable": true } } }, @@ -10673,7 +10681,7 @@ ] }, "prevent_unoptimized": { - "description": "If this option is set, service will try to prevent creation of large unoptimized segments. When enabled, updates may be blocked at request level if there are unoptimized segments larger than indexing threshold. Updates will be resumed when optimization is completed and segments are optimized below the threshold. Using this option may lead to increased delay between submitting an update and its application. Default is disabled.", + "description": "If enabled, the service will try to prevent the creation of large unoptimized segments. When enabled, new points written to segments larger than the indexing threshold are stored as \"deferred points\": they are persisted in the WAL and segments, but excluded from read/search results until the corresponding segments are optimized (e.g. indexed, quantized, or moved to mmap storage). Update requests with `wait=true` will only return after the deferred points become visible, which may significantly increase the perceived latency between submitting an update and its completion. Update requests with `wait=false` are not affected. Default is disabled.", "default": null, "type": "boolean", "nullable": true @@ -10847,6 +10855,14 @@ "maximum": 100, "minimum": 1, "nullable": true + }, + "max_disk_usage_percent": { + "description": "Reject disk-consuming update operations (e.g. upsert, set payload) when the filesystem hosting Qdrant storage is filled above this percentage of its total capacity. Value in [1, 100]. Applied uniformly to external and internal (replication) traffic \u2014 rejection is deterministic so it does not cause replica divergence. Delete operations are not affected, so callers can still free disk space. Free space is sampled with a small TTL cache; the gate may take a few seconds to react.", + "type": "integer", + "format": "uint8", + "maximum": 100, + "minimum": 1, + "nullable": true } } }, @@ -13469,7 +13485,8 @@ "enum": [ "float32", "float16", - "uint8" + "uint8", + "turbo4" ] }, "SparseVectorDataConfig": { @@ -17781,7 +17798,7 @@ ] }, "datatype": { - "description": "Element storage type (Float32, Float16, Uint8)", + "description": "Element storage type (Float32, Float16, Uint8, Turbo4)", "anyOf": [ { "$ref": "#/components/schemas/VectorStorageDatatype" diff --git a/fern/apis/v1.18.x/openapi-overrides.yml b/fern/apis/v1.18.x/openapi-overrides.yml index c2cf8fb..868d535 100644 --- a/fern/apis/v1.18.x/openapi-overrides.yml +++ b/fern/apis/v1.18.x/openapi-overrides.yml @@ -17,6 +17,10 @@ paths: tags: - Aliases x-fern-examples: + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/aliases' \\\n --header\ + \ 'api-key: '" + language: curl - code-samples: - code: 'using Qdrant.Client; @@ -29,16 +33,13 @@ paths: ' language: csharp - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.get_aliases() - - ' - language: python + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc listAliases() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\taliases, err := client.ListAliases(context.Background())\n\ + \tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Aliases: \", aliases)\n\ + }\n" + language: go - code-samples: - code: 'use qdrant_client::Qdrant; @@ -50,23 +51,6 @@ paths: ' language: rust - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.listAliasesAsync().get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc listAliases() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\taliases, err := client.ListAliases(context.Background())\n\ - \tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Aliases: \", aliases)\n\ - }\n" - language: go - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/aliases' \\\n --header\ - \ 'api-key: '" - language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -78,6 +62,22 @@ paths: ' language: typescript + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.get_aliases() + + ' + language: python + - 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 /cluster: get: description: Returns information about the cluster's current state and composition. @@ -105,6 +105,10 @@ paths: tags: - Collections x-fern-examples: + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/collections' \\\n --header\ + \ 'api-key: '" + language: curl - code-samples: - code: 'using Qdrant.Client; @@ -117,16 +121,13 @@ paths: ' language: csharp - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.get_collections() - - ' - language: python + - 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: 'use qdrant_client::Qdrant; @@ -138,23 +139,6 @@ paths: ' language: rust - - 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: "curl -X GET \\\n 'http://localhost:6333/collections' \\\n --header\ - \ 'api-key: '" - language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -166,6 +150,22 @@ paths: ' language: typescript + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.get_collections() + + ' + language: python + - 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 /collections/aliases: post: description: Updates aliases for the specified collections. @@ -173,6 +173,23 @@ paths: tags: - Aliases x-fern-examples: + - 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: 'using Qdrant.Client; @@ -188,33 +205,6 @@ paths: ' language: csharp - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.update_collection_aliases(\n change_aliases_operations=[\n\ - \ models.CreateAliasOperation(\n create_alias=models.CreateAlias(\n\ - \ collection_name=\"example_collection\", alias_name=\"\ - production_collection\"\n )\n )\n ]\n)\n\nclient.update_collection_aliases(\n\ - \ change_aliases_operations=[\n models.DeleteAliasOperation(\n\ - \ delete_alias=models.DeleteAlias(alias_name=\"production_collection\"\ - )\n ),\n ]\n)\n" - language: python - - code-samples: - - code: "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: "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\ @@ -227,22 +217,13 @@ paths: , \"legacy_collection\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - 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: "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: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ @@ -252,6 +233,25 @@ paths: \ actions: [\n {\n delete_alias: {\n alias_name: \"production_collection\"\ ,\n },\n },\n ],\n});\n" language: typescript + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.update_collection_aliases(\n change_aliases_operations=[\n\ + \ models.CreateAliasOperation(\n create_alias=models.CreateAlias(\n\ + \ collection_name=\"example_collection\", alias_name=\"\ + production_collection\"\n )\n )\n ]\n)\n\nclient.update_collection_aliases(\n\ + \ change_aliases_operations=[\n models.DeleteAliasOperation(\n\ + \ delete_alias=models.DeleteAlias(alias_name=\"production_collection\"\ + )\n ),\n ]\n)\n" + language: python + - code-samples: + - code: "import 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 /collections/{collection_name}: delete: description: Drops the specified collection and all associated data in it. @@ -259,6 +259,10 @@ paths: tags: - Collections x-fern-examples: + - code-samples: + - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name'\ + \ \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'using Qdrant.Client; @@ -271,16 +275,12 @@ paths: ' language: csharp - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.delete_collection(collection_name="{collection_name}") - - ' - language: python + - 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 - code-samples: - code: 'use qdrant_client::Qdrant; @@ -292,23 +292,6 @@ paths: ' language: rust - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.deleteCollectionAsync(\"\ - {collection_name}\").get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc deleteCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\terr = client.DeleteCollection(context.Background(),\ - \ \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go - - code-samples: - - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name'\ - \ \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'import { QdrantClient } from ''@qdrant/qdrant-js''; @@ -320,12 +303,33 @@ paths: ' language: typescript + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.delete_collection(collection_name="{collection_name}") + + ' + language: python + - code-samples: + - code: "import 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 get: description: Retrieves parameters from the specified collection. summary: Get collection details tags: - Collections x-fern-examples: + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name'\ + \ \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'using Qdrant.Client; @@ -338,16 +342,13 @@ paths: ' language: csharp - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.get_collection("{collection_name}") - - ' - language: python + - 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: 'use qdrant_client::Qdrant; @@ -359,24 +360,6 @@ paths: ' language: rust - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.getCollectionInfoAsync(\"\ - {collection_name}\").get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc getCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\tinfo, err := client.GetCollectionInfo(context.Background(),\ - \ \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"\ - Collection info: \", info)\n}\n" - language: go - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name'\ - \ \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -388,12 +371,35 @@ paths: ' language: typescript + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.get_collection("{collection_name}") + + ' + language: python + - code-samples: + - code: "import 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 patch: description: Updates the parameters of the specified collection. summary: Update collection parameters tags: - Collections x-fern-examples: + - 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: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ \ QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateCollectionAsync(\n\ @@ -401,11 +407,15 @@ paths: \ { IndexingThreshold = 10000 }\n);\n" language: csharp - 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: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc updateCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tthreshold := uint64(10000)\n\terr = client.UpdateCollection(context.Background(),\ + \ &qdrant.UpdateCollection{\n\t\tCollectionName: \"{collection_name}\"\ + ,\n\t\tOptimizersConfig: &qdrant.OptimizersConfigDiff{\n\t\t\tIndexingThreshold:\ + \ &threshold,\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\ + }\n" + language: go - code-samples: - code: "use qdrant_client::qdrant::{OptimizersConfigDiffBuilder, UpdateCollectionBuilder};\n\ use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ @@ -413,6 +423,18 @@ paths: {collection_name}\").optimizers_config(\n OptimizersConfigDiffBuilder::default().indexing_threshold(10_000),\n\ \ ),\n )\n .await?;\n" language: rust + - 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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.update_collection(\n collection_name=\"\ + {collection_name}\",\n optimizer_config=models.OptimizersConfigDiff(indexing_threshold=10000),\n\ + )\n" + language: python - code-samples: - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport\ \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -424,34 +446,25 @@ paths: )\n .setOptimizersConfig(\n OptimizersConfigDiff.newBuilder().setIndexingThreshold(10000).build())\n\ \ .build());\n" language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc updateCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\tthreshold := uint64(10000)\n\terr = client.UpdateCollection(context.Background(),\ - \ &qdrant.UpdateCollection{\n\t\tCollectionName: \"{collection_name}\"\ - ,\n\t\tOptimizersConfig: &qdrant.OptimizersConfigDiff{\n\t\t\tIndexingThreshold:\ - \ &threshold,\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\ - }\n" - language: go - - code-samples: - - code: "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: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.updateCollection(\"{collection_name}\", {\n optimizers_config:\ - \ {\n indexing_threshold: 10000,\n },\n});\n" - language: typescript put: description: Creates a new collection with the given parameters. summary: Create a collection tags: - Collections x-fern-examples: + - code-samples: + - code: "# 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: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ \ QdrantClient(\"localhost\", 6334);\n\nawait client.CreateCollectionAsync(\n\ @@ -463,11 +476,15 @@ paths: \ OnDisk = false,\n }\n })\n);" language: csharp - 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: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc createCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\terr = client.CreateCollection(context.Background(),\ + \ &qdrant.CreateCollection{\n\t\tCollectionName: \"{collection_name}\"\ + ,\n\t\tVectorsConfig: qdrant.NewVectorsConfig(&qdrant.VectorParams{\n\t\ + \t\tSize: 100,\n\t\t\tDistance: qdrant.Distance_Cosine,\n\t\t}),\n\ + \t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go - code-samples: - code: "use qdrant_client::qdrant::{CreateCollectionBuilder, Distance, VectorParamsBuilder};\n\ use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ @@ -475,6 +492,21 @@ paths: {collection_name}\")\n .vectors_config(VectorParamsBuilder::new(100,\ \ Distance::Cosine)),\n )\n .await?;\n" language: rust + - 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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.create_collection(\n collection_name=\"\ + {collection_name}\",\n vectors_config=models.VectorParams(size=100,\ + \ distance=models.Distance.COSINE),\n)\n" + language: python - code-samples: - code: "import 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\ @@ -490,38 +522,6 @@ paths: \ .setOnDisk(false)\n .build()\n \ \ ).build()\n ).build()\n ).build()\n).get();" language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc createCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\terr = client.CreateCollection(context.Background(),\ - \ &qdrant.CreateCollection{\n\t\tCollectionName: \"{collection_name}\"\ - ,\n\t\tVectorsConfig: qdrant.NewVectorsConfig(&qdrant.VectorParams{\n\t\ - \t\tSize: 100,\n\t\t\tDistance: qdrant.Distance_Cosine,\n\t\t}),\n\ - \t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go - - code-samples: - - code: "# 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: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.createCollection(\"{collection_name}\", {\n vectors: { size: 100,\ - \ distance: \"Cosine\" },\n});\n\n// or with sparse vectors\n\nclient.createCollection(\"\ - {collection_name}\", {\n vectors: { size: 100, distance: \"Cosine\" },\n\ - \ sparse_vectors: {\n \"splade-model-name\": {\n index: {\n \ - \ on_disk: false\n }\n }\n }\n});" - language: typescript /collections/{collection_name}/aliases: get: description: Retrieves a list of all aliases for the specified collection. @@ -529,6 +529,10 @@ paths: tags: - Aliases x-fern-examples: + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/aliases'\ + \ \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'using Qdrant.Client; @@ -541,16 +545,13 @@ paths: ' language: csharp - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.get_collection_aliases("{collection_name}") - - ' - language: python + - 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: 'use qdrant_client::Qdrant; @@ -562,24 +563,6 @@ paths: ' language: rust - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.listCollectionAliasesAsync(\"\ - {collection_name}\").get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc listCollectionAliases() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\taliases, err := client.ListCollectionAliases(context.Background(),\ - \ \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"\ - Collection aliases: \", aliases)\n}\n" - language: go - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/aliases'\ - \ \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -591,6 +574,23 @@ paths: ' language: typescript + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.get_collection_aliases("{collection_name}") + + ' + language: python + - 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 /collections/{collection_name}/cluster: get: description: Retrieves cluster details for a specified collection. @@ -609,6 +609,10 @@ paths: tags: - Collections x-fern-examples: + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/exists'\ + \ \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'using Qdrant.Client; @@ -621,14 +625,13 @@ paths: ' language: csharp - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.collection_exists(collection_name="{collection_name}")' - language: python + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc collectionExists() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\texists, err := client.CollectionExists(context.Background(),\ + \ \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"\ + Collection exists: \", exists)\n}\n" + language: go - code-samples: - code: 'use qdrant_client::Qdrant; @@ -641,45 +644,42 @@ paths: ' language: rust - code-samples: - - code: 'import static io.qdrant.client.ConditionFactory.matchKeyword; + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - import io.qdrant.client.QdrantClient; + const client = new QdrantClient({ host: "localhost", port: 6333 }); - import io.qdrant.client.QdrantGrpcClient; + client.collectionExists("{collection_name}"); - QdrantClient client = new QdrantClient(QdrantGrpcClient.newBuilder("localhost", - 6334, false).build()); + ' + language: typescript + - code-samples: + - code: 'from qdrant_client import QdrantClient - client.collectionExistsAsync("{collection_name}").get(); + client = QdrantClient(url="http://localhost:6333") - ' - 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 - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/exists'\ - \ \\\n --header 'api-key: '" - language: curl + + client.collection_exists(collection_name="{collection_name}")' + language: python - 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; + import io.qdrant.client.QdrantGrpcClient; - client.collectionExists("{collection_name}"); + + QdrantClient client = new QdrantClient(QdrantGrpcClient.newBuilder("localhost", + 6334, false).build()); + + + client.collectionExistsAsync("{collection_name}").get(); ' - language: typescript + language: java /collections/{collection_name}/facet: post: description: Retrieves facets for the specified payload field. @@ -694,11 +694,17 @@ paths: key: \"my-payload-key\",\n\tlimit: 10\n);" language: csharp - 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: "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\t\ + qdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err\ + \ != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n\ + }\n" + language: go - code-samples: - code: "use qdrant_client::qdrant::{Condition, FacetCountsBuilder, Filter};\n\ use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ @@ -708,6 +714,21 @@ paths: \ \"color\",\n \"red\".to_string(),\n \ \ )])),\n )\n .await?;" language: rust + - 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-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nimport static io.qdrant.client.ConditionFactory.matchKeyword;\nimport\ @@ -720,27 +741,6 @@ paths: 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\t\ - qdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err\ - \ != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n\ - }\n" - language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.facet(\"{collection_name}\", {\n filter: {\n must: [\n\ - \ {\n key: \"color\",\n match:\ - \ {\n value: \"red\",\n },\n \ - \ },\n ],\n },\n key: \"my-payload-key\",\n limit:\ - \ 10,\n});\n" - language: typescript /collections/{collection_name}/index: put: description: Creates a payload index for a field in the specified collection. @@ -748,33 +748,17 @@ paths: tags: - Indexes x-fern-examples: + - 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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.create_payload_index(\n collection_name=\"\ - {collection_name}\",\n field_name=\"name_of_the_field_to_index\",\n\ - \ field_schema=\"keyword\",\n)\n" - language: python - - code-samples: - - code: "use qdrant_client::qdrant::{CreateFieldIndexCollectionBuilder, FieldType};\n\ - use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ - ).build()?;\n\nclient\n .create_field_index(\n CreateFieldIndexCollectionBuilder::new(\n\ - \ \"{collection_name}\",\n \"{field_name}\",\n \ - \ FieldType::Keyword,\n ),\n )\n .await?;\n" - language: rust - - code-samples: - - code: "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\ @@ -786,17 +770,33 @@ paths: \ {\n\t\tpanic(err)\n\t}\n}\n" language: go - 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: "use qdrant_client::qdrant::{CreateFieldIndexCollectionBuilder, FieldType};\n\ + use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .create_field_index(\n CreateFieldIndexCollectionBuilder::new(\n\ + \ \"{collection_name}\",\n \"{field_name}\",\n \ + \ FieldType::Keyword,\n ),\n )\n .await?;\n" + language: rust - code-samples: - code: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.create_payload_index(\n collection_name=\"\ + {collection_name}\",\n field_name=\"name_of_the_field_to_index\",\n\ + \ field_schema=\"keyword\",\n)\n" + language: python + - code-samples: + - code: "import 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 /collections/{collection_name}/index/{field_name}: delete: description: Deletes a payload index for a field in the specified collection. @@ -804,35 +804,15 @@ paths: tags: - Indexes x-fern-examples: + - 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: "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: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.delete_payload_index("{collection_name}", "{field_name}"); - - ' - language: python - - 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: "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\ @@ -843,9 +823,12 @@ paths: panic(err)\n\t}\n}\n" language: go - code-samples: - - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/index/field_name'\ - \ \\\n --header 'api-key: '" - language: curl + - 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: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -857,6 +840,23 @@ paths: ' language: typescript + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.delete_payload_index("{collection_name}", "{field_name}"); + + ' + language: python + - code-samples: + - code: "import 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 /collections/{collection_name}/points: post: description: Retrieves all details from multiple points. @@ -864,30 +864,18 @@ paths: tags: - Points x-fern-examples: + - 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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.retrieve(\n collection_name=\"{collection_name}\"\ - ,\n ids=[0, 3, 100],\n)\n" - language: python - - code-samples: - - code: "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: "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\ @@ -899,16 +887,28 @@ paths: \t}\n\tfmt.Println(\"Points: \", points)\n}\n" language: go - 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: "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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.retrieve(\n collection_name=\"{collection_name}\"\ + ,\n ids=[0, 3, 100],\n)\n" + language: python + - code-samples: + - code: "import 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 put: description: Performs the insert + update action on specified points. Any point with an existing {id} will be overwritten. @@ -917,28 +917,47 @@ paths: - Points x-fern-examples: - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.UpsertAsync(\n collectionName:\ - \ \"{collection_name}\",\n points: new List\n {\n new()\n\ - \ {\n Id = 1,\n Vectors = new[] { 0.9f, 0.1f, 0.1f },\n \ - \ Payload = { [\"city\"] = \"red\" }\n },\n new()\n {\n \ - \ Id = 2,\n Vectors = new[] { 0.1f, 0.9f, 0.1f },\n Payload\ - \ = { [\"city\"] = \"green\" }\n },\n new()\n {\n Id = 3,\n\ - \ Vectors = new[] { 0.1f, 0.1f, 0.9f },\n Payload = { [\"city\"\ - ] = \"blue\" }\n }\n }\n);\n" - language: csharp + - code: "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: "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: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc upsert() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tresponse, err := client.Upsert(context.Background(),\ + \ &qdrant.UpsertPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ + \tPoints: []*qdrant.PointStruct{\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(1),\n\ + \t\t\t\tVectors: qdrant.NewVectors(0.9, 0.1, 0.1),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\ + \t\t\t\t\t\"color\": \"red\",\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\t\ + Id: qdrant.NewIDNum(2),\n\t\t\t\tVectors: qdrant.NewVectors(0.1,\ + \ 0.9, 0.1),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\ + \t\t\t\"color\": \"green\",\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\t\ + Id: qdrant.NewIDNum(3),\n\t\t\t\tVectors: qdrant.NewVectors(0.1,\ + \ 0.1, 0.9),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\ + \t\t\t\"color\": \"blue\",\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif\ + \ err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Upsert status: \"\ + , response.GetStatus())\n}\n" + language: go - code-samples: - code: "use qdrant_client::qdrant::{PointStruct, UpsertPointsBuilder};\n\ use qdrant_client::{Qdrant, Payload};\nuse serde_json::json;\n\nlet client\ @@ -959,6 +978,28 @@ paths: \ ),\n ],\n )\n .wait(true),\n )\n \ \ .await?;\n" language: rust + - 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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.upsert(\n collection_name=\"{collection_name}\"\ + ,\n points=[\n models.PointStruct(\n id=1,\n \ + \ payload={\n \"color\": \"red\",\n },\n\ + \ vector=[0.9, 0.1, 0.1],\n ),\n models.PointStruct(\n\ + \ id=2,\n payload={\n \"color\":\ + \ \"green\",\n },\n vector=[0.1, 0.9, 0.1],\n \ + \ ),\n models.PointStruct(\n id=3,\n \ + \ payload={\n \"color\": \"blue\",\n },\n \ + \ vector=[0.1, 0.1, 0.9],\n ),\n ],\n)\n" + language: python - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ \ io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\ @@ -980,47 +1021,6 @@ paths: \ List.of(0.5f, 0.2f, 0.7f, 0.4f, 0.7f, 0.2f, 0.3f,\ \ 0.9f))))\n .build()))\n .get();\n" language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc upsert() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\tresponse, err := client.Upsert(context.Background(),\ - \ &qdrant.UpsertPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ - \tPoints: []*qdrant.PointStruct{\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(1),\n\ - \t\t\t\tVectors: qdrant.NewVectors(0.9, 0.1, 0.1),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\ - \t\t\t\t\t\"color\": \"red\",\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\t\ - Id: qdrant.NewIDNum(2),\n\t\t\t\tVectors: qdrant.NewVectors(0.1,\ - \ 0.9, 0.1),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\ - \t\t\t\"color\": \"green\",\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\t\ - Id: qdrant.NewIDNum(3),\n\t\t\t\tVectors: qdrant.NewVectors(0.1,\ - \ 0.1, 0.9),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\ - \t\t\t\"color\": \"blue\",\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif\ - \ err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Upsert status: \"\ - , response.GetStatus())\n}\n" - language: go - - 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: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.upsert(\"{collection_name}\", {\n points: [\n {\n id:\ - \ 1,\n payload: { color: \"red\" },\n vector: [0.9, 0.1, 0.1],\n\ - \ },\n {\n id: 2,\n payload: { color: \"green\" },\n \ - \ vector: [0.1, 0.9, 0.1],\n },\n {\n id: 3,\n payload:\ - \ { color: \"blue\" },\n vector: [0.1, 0.1, 0.9],\n },\n ],\n\ - });\n" - language: typescript /collections/{collection_name}/points/batch: post: description: Batch updates points, including their respective vectors and payloads. @@ -1028,6 +1028,22 @@ paths: tags: - Points x-fern-examples: + - 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: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ \ QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateBatchAsync(\n\ @@ -1045,23 +1061,23 @@ paths: ] = 2, [\"test_payload_3\"] = 3 }\n }\n }\n ]\n);\n" language: csharp - 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: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc batchUpdate() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\t_, err = client.UpdateBatch(context.Background(),\ + \ &qdrant.UpdateBatchPoints{\n\t\tCollectionName: \"{collection_name}\"\ + ,\n\t\tOperations: []*qdrant.PointsUpdateOperation{\n\t\t\tqdrant.NewPointsUpdateUpsert(&qdrant.PointsUpdateOperation_PointStructList{\n\ + \t\t\t\tPoints: []*qdrant.PointStruct{{\n\t\t\t\t\tId: qdrant.NewIDNum(1),\n\ + \t\t\t\t\tVectors: qdrant.NewVectors(1.0, 2.0, 3.0, 4.0),\n\t\t\t\t}},\n\ + \t\t\t}),\n\t\t\tqdrant.NewPointsUpdateUpdateVectors(&qdrant.PointsUpdateOperation_UpdateVectors{\n\ + \t\t\t\tPoints: []*qdrant.PointVectors{\n\t\t\t\t\t{\n\t\t\t\t\t\tId:\ + \ qdrant.NewIDNum(1),\n\t\t\t\t\t\tVectors: qdrant.NewVectors(0.1,\ + \ 0.2, 0.3, 0.4),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t\tqdrant.NewPointsUpdateSetPayload(&qdrant.PointsUpdateOperation_SetPayload{\n\ + \t\t\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(1)),\n\ + \t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\t\t\"test_payload_2\"\ + : 2,\n\t\t\t\t\t\"test_payload_3\": 3,\n\t\t\t\t}),\n\t\t\t}),\n\t\t},\n\ + \t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go - code-samples: - code: "use qdrant_client::qdrant::{\n points_selector::PointsSelectorOneOf,\n\ \ points_update_operation::{\n Operation, OverwritePayload,\ @@ -1094,6 +1110,40 @@ paths: \ })),\n },\n ],\n )\n \ \ .wait(true),\n )\n .await?;\n" language: rust + - 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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.batch_update_points(\n collection_name=\"\ + {collection_name}\",\n update_operations=[\n models.UpsertOperation(\n\ + \ upsert=models.PointsList(\n points=[\n \ + \ models.PointStruct(\n id=1,\n\ + \ vector=[1.0, 2.0, 3.0, 4.0],\n \ + \ payload={},\n ),\n ]\n \ + \ )\n ),\n models.UpdateVectorsOperation(\n \ + \ update_vectors=models.UpdateVectors(\n points=[\n\ + \ models.PointVectors(\n id=1,\n\ + \ vector=[1.0, 2.0, 3.0, 4.0],\n \ + \ )\n ]\n )\n ),\n models.SetPayloadOperation(\n\ + \ set_payload=models.SetPayload(\n payload={\n\ + \ \"test_payload_2\": 2,\n \"test_payload_3\"\ + : 3,\n },\n points=[1],\n )\n\ + \ ),\n ],\n)\n" + language: python - code-samples: - code: "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\ @@ -1129,56 +1179,6 @@ paths: ,\n value(3)))\n .build())\n \ \ .build()))\n .get();\n" language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc batchUpdate() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\t_, err = client.UpdateBatch(context.Background(),\ - \ &qdrant.UpdateBatchPoints{\n\t\tCollectionName: \"{collection_name}\"\ - ,\n\t\tOperations: []*qdrant.PointsUpdateOperation{\n\t\t\tqdrant.NewPointsUpdateUpsert(&qdrant.PointsUpdateOperation_PointStructList{\n\ - \t\t\t\tPoints: []*qdrant.PointStruct{{\n\t\t\t\t\tId: qdrant.NewIDNum(1),\n\ - \t\t\t\t\tVectors: qdrant.NewVectors(1.0, 2.0, 3.0, 4.0),\n\t\t\t\t}},\n\ - \t\t\t}),\n\t\t\tqdrant.NewPointsUpdateUpdateVectors(&qdrant.PointsUpdateOperation_UpdateVectors{\n\ - \t\t\t\tPoints: []*qdrant.PointVectors{\n\t\t\t\t\t{\n\t\t\t\t\t\tId:\ - \ qdrant.NewIDNum(1),\n\t\t\t\t\t\tVectors: qdrant.NewVectors(0.1,\ - \ 0.2, 0.3, 0.4),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t\tqdrant.NewPointsUpdateSetPayload(&qdrant.PointsUpdateOperation_SetPayload{\n\ - \t\t\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(1)),\n\ - \t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\t\t\"test_payload_2\"\ - : 2,\n\t\t\t\t\t\"test_payload_3\": 3,\n\t\t\t\t}),\n\t\t\t}),\n\t\t},\n\ - \t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go - - code-samples: - - code: "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: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.batchUpdate(\"{collection_name}\", {\n operations: [\n \ - \ {\n upsert: {\n points: [\n \ - \ {\n id: 1,\n vector:\ - \ [1.0, 2.0, 3.0, 4.0],\n payload: {},\n \ - \ },\n ],\n },\n },\n \ - \ {\n update_vectors: {\n points: [\n \ - \ {\n id: 1,\n \ - \ vector: [1.0, 2.0, 3.0, 4.0],\n },\n \ - \ ],\n },\n },\n {\n set_payload:\ - \ {\n payload: {\n test_payload_2: 2,\n\ - \ test_payload_3: 3,\n },\n \ - \ points: [1],\n },\n },\n ],\n});\n" - language: typescript /collections/{collection_name}/points/count: post: description: Counts the number of points that match a specified filtering condition. @@ -1187,34 +1187,23 @@ paths: - Points x-fern-examples: - code-samples: - - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\ - \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.CountAsync(\n\ - \ collectionName: \"{collection_name}\",\n filter: MatchKeyword(\"color\"\ - , \"red\"),\n exact: true\n);\n" - language: csharp - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.count(\n collection_name=\"{collection_name}\"\ - ,\n count_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"\ - color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n\ - \ exact=True,\n)\n" - language: python - - code-samples: - - code: "use qdrant_client::qdrant::{Condition, CountPointsBuilder, Filter};\n\ - use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ - ).build()?;\n\nclient\n .count(\n CountPointsBuilder::new(\"\ - {collection_name}\")\n .filter(Filter::must([Condition::matches(\n\ - \ \"color\",\n \"red\".to_string(),\n \ - \ )]))\n .exact(true),\n )\n .await?;\n" - language: rust + - code: "# 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: "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: "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: "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\ @@ -1226,17 +1215,13 @@ paths: \ != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Count:\", count)\n}\n" language: go - 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: "use qdrant_client::qdrant::{Condition, CountPointsBuilder, Filter};\n\ + use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .count(\n CountPointsBuilder::new(\"\ + {collection_name}\")\n .filter(Filter::must([Condition::matches(\n\ + \ \"color\",\n \"red\".to_string(),\n \ + \ )]))\n .exact(true),\n )\n .await?;\n" + language: rust - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ @@ -1245,6 +1230,21 @@ paths: \ {\n value: \"red\",\n },\n \ \ },\n ],\n },\n exact: true,\n});\n" language: typescript + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.count(\n collection_name=\"{collection_name}\"\ + ,\n count_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"\ + color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n\ + \ exact=True,\n)\n" + language: python + - code-samples: + - code: "import 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 /collections/{collection_name}/points/delete: post: description: Deletes specified points from the collection. @@ -1252,6 +1252,17 @@ paths: tags: - Points x-fern-examples: + - 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: 'using Qdrant.Client; @@ -1269,15 +1280,18 @@ paths: ' language: csharp - 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: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc delete() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\t_, err = client.Delete(context.Background(), &qdrant.DeletePoints{\n\ + \t\tCollectionName: \"{collection_name}\",\n\t\tPoints: qdrant.NewPointsSelectorIDs([]*qdrant.PointId{\n\ + \t\t\tqdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(100),\n\t\ + \t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.Delete(context.Background(),\ + \ &qdrant.DeletePoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ + \tPoints: qdrant.NewPointsSelectorFilter(&qdrant.Filter{\n\t\t\tMust:\ + \ []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\ + \t\t\t},\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go - code-samples: - code: "use qdrant_client::qdrant::{Condition, DeletePointsBuilder, Filter,\ \ PointsIdsList};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"\ @@ -1290,6 +1304,25 @@ paths: \ \"color\",\n \"red\".to_string(),\n )]))\n\ \ .wait(true),\n )\n .await?;\n" language: rust + - 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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.delete(\n collection_name=\"{collection_name}\"\ + ,\n points_selector=models.PointIdsList(\n points=[0, 3, 100],\n\ + \ ),\n)\n\nclient.delete(\n collection_name=\"{collection_name}\"\ + ,\n points_selector=models.FilterSelector(\n filter=models.Filter(\n\ + \ must=[\n models.FieldCondition(\n \ + \ key=\"color\",\n match=models.MatchValue(value=\"\ + red\"),\n ),\n ],\n )\n ),\n)\n" + language: python - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ \ io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport java.util.List;\n\ @@ -1301,39 +1334,6 @@ paths: \ \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"\ color\", \"red\")).build())\n .get();\n" language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc delete() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\t_, err = client.Delete(context.Background(), &qdrant.DeletePoints{\n\ - \t\tCollectionName: \"{collection_name}\",\n\t\tPoints: qdrant.NewPointsSelectorIDs([]*qdrant.PointId{\n\ - \t\t\tqdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(100),\n\t\ - \t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.Delete(context.Background(),\ - \ &qdrant.DeletePoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ - \tPoints: qdrant.NewPointsSelectorFilter(&qdrant.Filter{\n\t\t\tMust:\ - \ []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\ - \t\t\t},\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go - - code-samples: - - code: "# 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: "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 /collections/{collection_name}/points/discover: post: description: 'Retrieves the most similar points to a given target, constrained @@ -1356,6 +1356,14 @@ paths: tags: - Search x-fern-examples: + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/discover'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"target\": [\n 0.2,\n \ + \ 0.1,\n 0.9,\n 0.7\n ],\n \"context\": [\n {\n \"positive\"\ + : \"7f6652c4-89bd-40e0-ab1d-510f7fcddd2b\",\n \"negative\": \"2c2c9f86-0171-4bd2-9ab0-b4754682cddd\"\ + \n }\n ],\n \"limit\": 10\n}'" + language: curl - code-samples: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ \ QdrantClient(\"localhost\", 6334);\n\nawait client.DiscoverAsync(\n\ @@ -1368,12 +1376,20 @@ paths: \ }\n ],\n limit: 10\n);\n" language: csharp - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.discover(\n \"{collection_name}\"\ - ,\n target=[0.2, 0.1, 0.9, 0.7],\n context=[\n models.ContextExamplePair(positive=100,\ - \ negative=718),\n models.ContextExamplePair(positive=200, negative=300),\n\ - \ ],\n limit=10,\n)\n" - language: python + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc discover() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tresults, err := client.Query(context.Background(),\ + \ &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ + \tQuery: qdrant.NewQueryDiscover(&qdrant.DiscoverInput{\n\t\t\tTarget:\ + \ qdrant.NewVectorInput(0.2, 0.1, 0.9, 0.7),\n\t\t\tContext: &qdrant.ContextInput{\n\ + \t\t\t\tPairs: []*qdrant.ContextInputPair{{\n\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\ + \t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\t\ + \t\t\t}, {\n\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\ + \t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(300)),\n\t\ + \t\t\t}},\n\t\t\t},\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\ + \t}\n\tfmt.Println(\"Results: \", results)\n}\n" + language: go - code-samples: - code: "use qdrant_client::qdrant::{\n target_vector::Target, vector_example::Example,\ \ ContextExamplePairBuilder,\n DiscoverPointsBuilder, VectorExample,\n\ @@ -1389,6 +1405,21 @@ paths: \ {\n example: Some(Example::Vector(vec![0.2, 0.1, 0.9, 0.7].into())),\n\ \ })),\n )\n .await?;\n" language: rust + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.discover(\"{collection_name}\", {\n target: [0.2, 0.1, 0.9,\ + \ 0.7],\n context: [\n {\n positive: 100,\n \ + \ negative: 718,\n },\n {\n positive: 200,\n\ + \ negative: 300,\n },\n ],\n limit: 10,\n});\n" + language: typescript + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.discover(\n \"{collection_name}\"\ + ,\n target=[0.2, 0.1, 0.9, 0.7],\n context=[\n models.ContextExamplePair(positive=100,\ + \ negative=718),\n models.ContextExamplePair(positive=200, negative=300),\n\ + \ ],\n limit=10,\n)\n" + language: python - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ import static io.qdrant.client.VectorFactory.vector;\n\nimport io.qdrant.client.QdrantClient;\n\ @@ -1411,37 +1442,6 @@ paths: \ .build()))\n .setLimit(10)\n \ \ .build())\n .get();\n" language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc discover() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\tresults, err := client.Query(context.Background(),\ - \ &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ - \tQuery: qdrant.NewQueryDiscover(&qdrant.DiscoverInput{\n\t\t\tTarget:\ - \ qdrant.NewVectorInput(0.2, 0.1, 0.9, 0.7),\n\t\t\tContext: &qdrant.ContextInput{\n\ - \t\t\t\tPairs: []*qdrant.ContextInputPair{{\n\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\ - \t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\t\ - \t\t\t}, {\n\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\ - \t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(300)),\n\t\ - \t\t\t}},\n\t\t\t},\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\ - \t}\n\tfmt.Println(\"Results: \", results)\n}\n" - language: go - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/discover'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"target\": [\n 0.2,\n \ - \ 0.1,\n 0.9,\n 0.7\n ],\n \"context\": [\n {\n \"positive\"\ - : \"7f6652c4-89bd-40e0-ab1d-510f7fcddd2b\",\n \"negative\": \"2c2c9f86-0171-4bd2-9ab0-b4754682cddd\"\ - \n }\n ],\n \"limit\": 10\n}'" - language: curl - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.discover(\"{collection_name}\", {\n target: [0.2, 0.1, 0.9,\ - \ 0.7],\n context: [\n {\n positive: 100,\n \ - \ negative: 718,\n },\n {\n positive: 200,\n\ - \ negative: 300,\n },\n ],\n limit: 10,\n});\n" - language: typescript /collections/{collection_name}/points/discover/batch: post: description: Retrieves points in batches based on the target and/or positive @@ -1450,6 +1450,19 @@ paths: tags: - Search x-fern-examples: + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/discover/batch'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \ + \ \"target\": [\n 0.2,\n 0.1,\n 0.9,\n \ + \ 0.7\n ],\n \"context\": [\n {\n \"positive\"\ + : \"7f6652c4-89bd-40e0-ab1d-510f7fcddd2b\",\n \"negative\": \"\ + 2c2c9f86-0171-4bd2-9ab0-b4754682cddd\"\n }\n ],\n \"\ + limit\": 1\n },\n {\n \"target\": [\n 0.5,\n \ + \ 0.3,\n 0.2,\n 0.3\n ],\n \"context\": [\n \ + \ {\n \"positive\": 342,\n \"negative\": 213\n\ + \ }\n ],\n \"limit\": 1\n }\n ]\n}'" + language: curl - code-samples: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ \ QdrantClient(\"localhost\", 6334);\n\nvar discoverPoints = new List\n\ @@ -1475,23 +1488,34 @@ paths: {collection_name}\", discoverPoints);\n" language: csharp - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\ndiscover_queries = [\n models.DiscoverRequest(\n\ - \ target=[0.2, 0.1, 0.9, 0.7],\n context=[\n \ - \ models.ContextExamplePair(\n positive=100,\n \ - \ negative=718,\n ),\n models.ContextExamplePair(\n\ - \ positive=200,\n negative=300,\n \ - \ ),\n ],\n limit=10,\n ),\n models.DiscoverRequest(\n\ - \ target=[0.5, 0.3, 0.2, 0.3],\n context=[\n \ - \ models.ContextExamplePair(\n positive=342,\n \ - \ negative=213,\n ),\n models.ContextExamplePair(\n\ - \ positive=100,\n negative=200,\n \ - \ ),\n ],\n limit=5,\n ),\n]\n\nclient.discover_batch(\"\ - {collection_name}\", discover_queries)\n" - language: python - - code-samples: - - code: "use qdrant_client::qdrant::{\n vector_example::Example, ContextExamplePairBuilder,\ - \ DiscoverBatchPointsBuilder,\n DiscoverPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\ + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc discoverBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tresults, err := client.QueryBatch(context.Background(),\ + \ &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\"\ + ,\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName:\ + \ \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryDiscover(&qdrant.DiscoverInput{\n\ + \t\t\t\t\tTarget: qdrant.NewVectorInput(0.2, 0.1, 0.9, 0.7),\n\t\t\t\t\ + \tContext: &qdrant.ContextInput{\n\t\t\t\t\t\tPairs: []*qdrant.ContextInputPair{{\n\ + \t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\ + \t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\ + \t\t\t\t\t\t}, {\n\t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\ + \t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(300)),\n\ + \t\t\t\t\t\t}},\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\t\ + CollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryDiscover(&qdrant.DiscoverInput{\n\ + \t\t\t\t\tTarget: qdrant.NewVectorInput(0.5, 0.3, 0.2, 0.3),\n\t\t\t\t\ + \tContext: &qdrant.ContextInput{\n\t\t\t\t\t\tPairs: []*qdrant.ContextInputPair{{\n\ + \t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(342)),\n\ + \t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(213)),\n\ + \t\t\t\t\t\t}, {\n\t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\ + \t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\ + \t\t\t\t\t\t}},\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\t\ + if err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n\ + }\n" + language: go + - code-samples: + - code: "use qdrant_client::qdrant::{\n vector_example::Example, ContextExamplePairBuilder,\ + \ DiscoverBatchPointsBuilder,\n DiscoverPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\ \nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\ \nlet discover_points = DiscoverBatchPointsBuilder::new(\n \"{collection_name}\"\ ,\n vec![\n DiscoverPointsBuilder::new(\n \"{collection_name}\"\ @@ -1510,6 +1534,35 @@ paths: \ .build(),\n ],\n 10,\n \ \ )\n .build(),\n ],\n);\n\nclient.discover_batch(&discover_points.build()).await?;\n" language: rust + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + const searches = [\n {\n target: [0.2, 0.1, 0.9, 0.7],\n \ + \ context: [\n {\n positive: 100,\n \ + \ negative: 718,\n },\n {\n \ + \ positive: 200,\n negative: 300,\n },\n\ + \ ],\n limit: 10,\n },\n {\n target: [0.5,\ + \ 0.3, 0.2, 0.3],\n context: [\n {\n \ + \ positive: 342,\n negative: 213,\n },\n \ + \ {\n positive: 100,\n negative:\ + \ 200,\n },\n ],\n limit: 5,\n },\n];\n\n\ + client.discoverBatchPoints(\"{collection_name}\", {\n searches,\n});\n" + language: typescript + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\ndiscover_queries = [\n models.DiscoverRequest(\n\ + \ target=[0.2, 0.1, 0.9, 0.7],\n context=[\n \ + \ models.ContextExamplePair(\n positive=100,\n \ + \ negative=718,\n ),\n models.ContextExamplePair(\n\ + \ positive=200,\n negative=300,\n \ + \ ),\n ],\n limit=10,\n ),\n models.DiscoverRequest(\n\ + \ target=[0.5, 0.3, 0.2, 0.3],\n context=[\n \ + \ models.ContextExamplePair(\n positive=342,\n \ + \ negative=213,\n ),\n models.ContextExamplePair(\n\ + \ positive=100,\n negative=200,\n \ + \ ),\n ],\n limit=5,\n ),\n]\n\nclient.discover_batch(\"\ + {collection_name}\", discover_queries)\n" + language: python - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ \ io.qdrant.client.VectorFactory.vector;\n\nimport java.util.Arrays;\n\ @@ -1548,59 +1601,6 @@ paths: \ .build());\nclient.discoverBatchAsync(\"{collection_name}\", discoverPoints,\ \ null);\n" language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc discoverBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\tresults, err := client.QueryBatch(context.Background(),\ - \ &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\"\ - ,\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName:\ - \ \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryDiscover(&qdrant.DiscoverInput{\n\ - \t\t\t\t\tTarget: qdrant.NewVectorInput(0.2, 0.1, 0.9, 0.7),\n\t\t\t\t\ - \tContext: &qdrant.ContextInput{\n\t\t\t\t\t\tPairs: []*qdrant.ContextInputPair{{\n\ - \t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\ - \t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\ - \t\t\t\t\t\t}, {\n\t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\ - \t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(300)),\n\ - \t\t\t\t\t\t}},\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\t\ - CollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryDiscover(&qdrant.DiscoverInput{\n\ - \t\t\t\t\tTarget: qdrant.NewVectorInput(0.5, 0.3, 0.2, 0.3),\n\t\t\t\t\ - \tContext: &qdrant.ContextInput{\n\t\t\t\t\t\tPairs: []*qdrant.ContextInputPair{{\n\ - \t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(342)),\n\ - \t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(213)),\n\ - \t\t\t\t\t\t}, {\n\t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\ - \t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\ - \t\t\t\t\t\t}},\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\t\ - if err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n\ - }\n" - language: go - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/discover/batch'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \ - \ \"target\": [\n 0.2,\n 0.1,\n 0.9,\n \ - \ 0.7\n ],\n \"context\": [\n {\n \"positive\"\ - : \"7f6652c4-89bd-40e0-ab1d-510f7fcddd2b\",\n \"negative\": \"\ - 2c2c9f86-0171-4bd2-9ab0-b4754682cddd\"\n }\n ],\n \"\ - limit\": 1\n },\n {\n \"target\": [\n 0.5,\n \ - \ 0.3,\n 0.2,\n 0.3\n ],\n \"context\": [\n \ - \ {\n \"positive\": 342,\n \"negative\": 213\n\ - \ }\n ],\n \"limit\": 1\n }\n ]\n}'" - language: curl - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - const searches = [\n {\n target: [0.2, 0.1, 0.9, 0.7],\n \ - \ context: [\n {\n positive: 100,\n \ - \ negative: 718,\n },\n {\n \ - \ positive: 200,\n negative: 300,\n },\n\ - \ ],\n limit: 10,\n },\n {\n target: [0.5,\ - \ 0.3, 0.2, 0.3],\n context: [\n {\n \ - \ positive: 342,\n negative: 213,\n },\n \ - \ {\n positive: 100,\n negative:\ - \ 200,\n },\n ],\n limit: 5,\n },\n];\n\n\ - client.discoverBatchPoints(\"{collection_name}\", {\n searches,\n});\n" - language: typescript /collections/{collection_name}/points/payload: post: description: Sets payload values for specified points. @@ -1608,6 +1608,20 @@ paths: tags: - Points x-fern-examples: + - 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: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ \ QdrantClient(\"localhost\", 6334);\n\nawait client.SetPayloadAsync(\n\ @@ -1616,12 +1630,17 @@ paths: \ } },\n ids: new ulong[] { 0, 3, 10 }\n);\n" language: csharp - 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: "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: "use qdrant_client::qdrant::{PointsIdsList, SetPayloadPointsBuilder};\n\ use qdrant_client::{Qdrant, Payload};\nuse serde_json::json;\n\nlet client\ @@ -1633,6 +1652,20 @@ paths: \ 3.into(), 10.into()],\n })\n .wait(true),\n \ \ )\n .await?;\n" language: rust + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.setPayload(\"{collection_name}\", {\n payload: {\n property1:\ + \ \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n\ + });\n" + language: typescript + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.set_payload(\n collection_name=\"\ + {collection_name}\",\n payload={\n \"property1\": \"string\"\ + ,\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n\ + )\n" + language: python - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ \ io.qdrant.client.ValueFactory.value;\n\nimport java.util.List;\nimport\ @@ -1643,45 +1676,25 @@ paths: 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: "# 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: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.setPayload(\"{collection_name}\", {\n payload: {\n property1:\ - \ \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n\ - });\n" - language: typescript put: description: Replaces the entire payload of a specified point with a new payload. summary: Overwrite payload tags: - Points x-fern-examples: + - code-samples: + - code: "# 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: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ \ QdrantClient(\"localhost\", 6334);\n\nawait client.OverwritePayloadAsync(\n\ @@ -1690,12 +1703,16 @@ paths: \ } },\n ids: new ulong[] { 0, 3, 10 }\n);\n" language: csharp - 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: "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: "use qdrant_client::qdrant::{\n points_selector::PointsSelectorOneOf,\ \ PointsIdsList, SetPayloadPointsBuilder,\n};\nuse qdrant_client::{Qdrant,\ @@ -1707,6 +1724,20 @@ paths: \ {\n ids: vec![0.into(), 3.into(), 10.into()],\n \ \ }))\n .wait(true),\n )\n .await?;\n" language: rust + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.overwritePayload(\"{collection_name}\", {\n payload: {\n property1:\ + \ \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n\ + });\n" + language: typescript + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.overwrite_payload(\n collection_name=\"\ + {collection_name}\",\n payload={\n \"property1\": \"string\"\ + ,\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n\ + )\n" + language: python - code-samples: - code: "import 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\ @@ -1717,44 +1748,19 @@ paths: ), \"property2\", value(\"string\")),\n List.of(id(0), id(3), id(10)),\n\ \ true,\n null,\n null)\n .get();\n" language: java + /collections/{collection_name}/points/payload/clear: + post: + description: Removes the entire payload for specified points. + summary: Clear payload + tags: + - Points + x-fern-examples: - code-samples: - - code: "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: "# 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: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.overwritePayload(\"{collection_name}\", {\n payload: {\n property1:\ - \ \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n\ - });\n" - language: typescript - /collections/{collection_name}/points/payload/clear: - post: - description: Removes the entire payload for specified points. - summary: Clear payload - tags: - - Points - x-fern-examples: + - 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: 'using Qdrant.Client; @@ -1766,25 +1772,6 @@ paths: ' language: csharp - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.clear_payload(\n collection_name=\"\ - {collection_name}\",\n points_selector=[0, 3, 100],\n)\n" - language: python - - code-samples: - - code: "use qdrant_client::qdrant::{ClearPayloadPointsBuilder, PointsIdsList};\n\ - use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ - ).build()?;\n\nclient\n .clear_payload(ClearPayloadPointsBuilder::new(\"\ - {collection_name}\").points(\n PointsIdsList {\n ids:\ - \ vec![0.into(), 3.into(), 100.into()],\n },\n ))\n .await?;\n" - language: rust - - code-samples: - - code: "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\ @@ -1796,17 +1783,30 @@ paths: \t}\n}\n" language: go - 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: "use qdrant_client::qdrant::{ClearPayloadPointsBuilder, PointsIdsList};\n\ + use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .clear_payload(ClearPayloadPointsBuilder::new(\"\ + {collection_name}\").points(\n PointsIdsList {\n ids:\ + \ vec![0.into(), 3.into(), 100.into()],\n },\n ))\n .await?;\n" + language: rust - code-samples: - code: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.clear_payload(\n collection_name=\"\ + {collection_name}\",\n points_selector=[0, 3, 100],\n)\n" + language: python + - code-samples: + - code: "import 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 /collections/{collection_name}/points/payload/delete: post: description: Deletes a specified key payload for points. @@ -1814,6 +1814,18 @@ paths: tags: - Points x-fern-examples: + - 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: 'using Qdrant.Client; @@ -1827,11 +1839,15 @@ paths: ' language: csharp - 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: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc deletePayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\t_, err = client.DeletePayload(context.Background(),\ + \ &qdrant.DeletePayloadPoints{\n\t\tCollectionName: \"{collection_name}\"\ + ,\n\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3),\ + \ qdrant.NewIDNum(100)),\n\t\tKeys: []string{\"color\", \"price\"\ + },\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go - code-samples: - code: "use qdrant_client::qdrant::{DeletePayloadPointsBuilder, PointsIdsList};\n\ use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ @@ -1841,6 +1857,18 @@ paths: \ {\n ids: vec![0.into(), 3.into(), 100.into()],\n })\n\ \ .wait(true),\n )\n .await?;\n" language: rust + - 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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.delete_payload(\n collection_name=\"\ + {collection_name}\",\n keys=[\"color\", \"price\"],\n points=[0,\ + \ 3, 100],\n)\n" + language: python - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -1850,34 +1878,6 @@ paths: ),\n List.of(id(0), id(3), id(100)),\n true,\n null,\n\ \ null)\n .get();\n" language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc deletePayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\t_, err = client.DeletePayload(context.Background(),\ - \ &qdrant.DeletePayloadPoints{\n\t\tCollectionName: \"{collection_name}\"\ - ,\n\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3),\ - \ qdrant.NewIDNum(100)),\n\t\tKeys: []string{\"color\", \"price\"\ - },\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go - - code-samples: - - code: "# 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: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.deletePayload(\"{collection_name}\", {\n keys: [\"color\", \"\ - price\"],\n points: [0, 3, 100],\n});\n" - language: typescript /collections/{collection_name}/points/query: post: description: Universally query points. This endpoint covers all capabilities @@ -1887,6 +1887,63 @@ paths: tags: - Search x-fern-examples: + - 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: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ \ QdrantClient(\"localhost\", 6334);\n\n// Query nearest by ID\nawait\ @@ -1931,73 +1988,89 @@ paths: \t\t\t\t[\"lon\"] = 11.576124,\n\t\t\t},\n\t\t},\n\t}\n);\n" language: csharp - 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-samples: - - code: "use qdrant_client::qdrant::{\n Condition, DecayParamsExpressionBuilder,\ - \ Expression, FormulaBuilder, Fusion, GeoPoint,\n PointId, PrefetchQueryBuilder,\ - \ Query, QueryPointsBuilder, RecommendInputBuilder,\n Sample,\n};\n\ - use 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\ + - 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\t\ + if 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\t\ + points, 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 + - code-samples: + - code: "use qdrant_client::qdrant::{\n Condition, DecayParamsExpressionBuilder,\ + \ Expression, FormulaBuilder, Fusion, GeoPoint,\n PointId, PrefetchQueryBuilder,\ + \ Query, QueryPointsBuilder, RecommendInputBuilder,\n Sample,\n};\n\ + use 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\ @@ -2030,6 +2103,92 @@ paths: \ lon: 11.576124 }),\n )\n .limit(10),\n )\n\ \ .await?;\n" language: rust + - 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: "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-samples: - code: "import static io.qdrant.client.QueryFactory.fusion;\nimport static\ \ io.qdrant.client.QueryFactory.nearest;\nimport static io.qdrant.client.QueryFactory.recommend;\n\ @@ -2128,165 +2287,6 @@ paths: \ \"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\t\ - if 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\t\ - points, 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 - - 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: "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 /collections/{collection_name}/points/query/batch: post: description: Universally query points in batch. This endpoint covers all capabilities @@ -2296,6 +2296,15 @@ paths: tags: - Search x-fern-examples: + - 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: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ \ QdrantClient(\"localhost\", 6334);\n\nawait client.QueryBatchAsync(\n\ @@ -2303,32 +2312,6 @@ paths: \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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nnearest = client.query_batch_points(\n \ - \ collection_name=\"{collection_name}\",\n requests=[\n models.QueryRequest(\n\ - \ query=[0.01, 0.45, 0.67, ...],\n ),\n models.QueryRequest(\n\ - \ query=[0.11, 0.35, 0.6, ...],\n ),\n ]\n)" - language: python - - code-samples: - - code: "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: "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\ @@ -2343,14 +2326,14 @@ paths: Query results: \", results)\n}\n" language: go - 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: "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: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ @@ -2358,6 +2341,23 @@ paths: \ [0.01, 0.45, 0.67]\n },\n {\n query: [0.11, 0.35, 0.6]\n\ \ }]\n});\n" language: typescript + - 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-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 /collections/{collection_name}/points/query/groups: post: description: Universally query points and group results by a specified payload @@ -2368,34 +2368,18 @@ paths: - Search x-fern-examples: - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\"\ - , 6334);\n\nawait client.QueryGroupsAsync(\n collectionName: \"{collection_name}\"\ - ,\n groupBy: \"document_id\",\n groupSize: 5,\n limit: 10,\n query:\ - \ new float[] {\n 0.01f, 0.45f, 0.67f\n }\n);\n" - language: csharp - - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.query_points_groups(\n collection_name=\"\ - {collection_name}\",\n query=[0.01, 0.45, 0.67],\n group_by=\"document_id\"\ - ,\n limit=10,\n group_size=5,\n)" - language: python - - code-samples: - - code: "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: "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: "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: "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: "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\ @@ -2408,12 +2392,12 @@ paths: , results)\n}\n" language: go - 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: "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: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ @@ -2421,6 +2405,22 @@ paths: \ group_by: \"document_id\",\n limit: 10,\n group_size: 5,\n\ });\n" language: typescript + - 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-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 /collections/{collection_name}/points/recommend: post: description: Retrieves points that are closer to stored positive examples and @@ -2429,6 +2429,16 @@ paths: tags: - Search x-fern-examples: + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"positive\": [\n 100,\n\ + \ 231\n ],\n \"negative\": [\n \"3a6e2150-f7b7-496e-92cd-687e63e215fd\"\ + ,\n [\n 0.2,\n 0.3,\n 0.4,\n 0.5\n ]\n ],\n\ + \ \"filter\": {\n \"must\": [\n {\n \"key\": \"city\"\ + ,\n \"match\": {\n \"value\": \"London\"\n }\n\ + \ }\n ]\n },\n \"limit\": 1\n}'" + language: curl - code-samples: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\ \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendAsync(\n\ @@ -2437,15 +2447,21 @@ paths: , \"London\"),\n limit: 3\n);\n" language: csharp - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.recommend(\n collection_name=\"\ - {collection_name}\",\n positive=[100, 231],\n negative=[718, [0.2,\ - \ 0.3, 0.4, 0.5]],\n strategy=models.RecommendStrategy.AVERAGE_VECTOR,\n\ - \ query_filter=models.Filter(\n must=[\n models.FieldCondition(\n\ - \ key=\"city\",\n match=models.MatchValue(\n\ - \ value=\"London\",\n ),\n \ - \ )\n ]\n ),\n limit=3,\n)\n" - language: python + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc recommend() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tresults, err := client.Query(context.Background(),\ + \ &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ + \tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\t\t\tPositive:\ + \ []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\ + \t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(231)),\n\t\t\t},\n\t\t\ + \tNegative: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\ + \t\t\t\tqdrant.NewVectorInput(0.2, 0.3, 0.4, 0.5),\n\t\t\t},\n\t\t\tStrategy:\ + \ qdrant.RecommendStrategy_AverageVector.Enum(),\n\t\t}),\n\t\tFilter:\ + \ &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"\ + city\", \"London\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\t\ + panic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" + language: go - code-samples: - code: "use qdrant_client::qdrant::{Condition, Filter, RecommendPointsBuilder,\ \ RecommendStrategy};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"\ @@ -2458,6 +2474,26 @@ paths: \ \"city\",\n \"London\".to_string(),\n )])),\n\ \ )\n .await?;\n" language: rust + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.recommend(\"{collection_name}\", {\n positive: [100, 231],\n\ + \ negative: [718, [0.2, 0.3, 0.4, 0.5]],\n strategy: \"average_vector\"\ + ,\n filter: {\n must: [\n {\n key:\ + \ \"city\",\n match: {\n value: \"London\"\ + ,\n },\n },\n ],\n },\n limit:\ + \ 3,\n});\n" + language: typescript + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.recommend(\n collection_name=\"\ + {collection_name}\",\n positive=[100, 231],\n negative=[718, [0.2,\ + \ 0.3, 0.4, 0.5]],\n strategy=models.RecommendStrategy.AVERAGE_VECTOR,\n\ + \ query_filter=models.Filter(\n must=[\n models.FieldCondition(\n\ + \ key=\"city\",\n match=models.MatchValue(\n\ + \ value=\"London\",\n ),\n \ + \ )\n ]\n ),\n limit=3,\n)\n" + language: python - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\ @@ -2474,42 +2510,6 @@ paths: \ .setFilter(Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\"\ )))\n .setLimit(3)\n .build())\n .get();\n" language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc recommend() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\tresults, err := client.Query(context.Background(),\ - \ &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ - \tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\t\t\tPositive:\ - \ []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\ - \t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(231)),\n\t\t\t},\n\t\t\ - \tNegative: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\ - \t\t\t\tqdrant.NewVectorInput(0.2, 0.3, 0.4, 0.5),\n\t\t\t},\n\t\t\tStrategy:\ - \ qdrant.RecommendStrategy_AverageVector.Enum(),\n\t\t}),\n\t\tFilter:\ - \ &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"\ - city\", \"London\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\t\ - panic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" - language: go - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"positive\": [\n 100,\n\ - \ 231\n ],\n \"negative\": [\n \"3a6e2150-f7b7-496e-92cd-687e63e215fd\"\ - ,\n [\n 0.2,\n 0.3,\n 0.4,\n 0.5\n ]\n ],\n\ - \ \"filter\": {\n \"must\": [\n {\n \"key\": \"city\"\ - ,\n \"match\": {\n \"value\": \"London\"\n }\n\ - \ }\n ]\n },\n \"limit\": 1\n}'" - language: curl - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.recommend(\"{collection_name}\", {\n positive: [100, 231],\n\ - \ negative: [718, [0.2, 0.3, 0.4, 0.5]],\n strategy: \"average_vector\"\ - ,\n filter: {\n must: [\n {\n key:\ - \ \"city\",\n match: {\n value: \"London\"\ - ,\n },\n },\n ],\n },\n limit:\ - \ 3,\n});\n" - language: typescript /collections/{collection_name}/points/recommend/batch: post: description: Retrieves points in batches that are closer to stored positive @@ -2518,6 +2518,16 @@ paths: tags: - Search x-fern-examples: + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend/batch'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \ + \ \"positive\": [\n 100,\n 231\n ],\n \"negative\"\ + : [\n \"9ad0884a-7bfe-43c0-b88f-c1d9a588b7e1\"\n ],\n \ + \ \"limit\": 1\n },\n {\n \"positive\": [\n 200,\n\ + \ 67\n ],\n \"negative\": [\n 300\n ],\n\ + \ \"limit\": 5\n }\n ]\n}'" + language: curl - code-samples: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\ \nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter =\ @@ -2532,13 +2542,24 @@ paths: \ }\n ]\n);\n" language: csharp - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nrecommend_queries = [\n models.RecommendRequest(\n\ - \ positive=[100, 231], negative=[718], filter=filter_, limit=3\n\ - \ ),\n models.RecommendRequest(positive=[200, 67], negative=[300],\ - \ limit=3),\n]\n\nclient.recommend_batch(collection_name=\"{collection_name}\"\ - , requests=recommend_queries)\n" - language: python + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc recommendBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tresults, err := client.QueryBatch(context.Background(),\ + \ &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\"\ + ,\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName:\ + \ \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\ + \t\t\t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\ + \t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(231)),\n\t\t\t\t\t\ + },\n\t\t\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\ + \t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\tCollectionName:\ + \ \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\ + \t\t\t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\ + \t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(67)),\n\t\t\t\t\t\ + },\n\t\t\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(300)),\n\ + \t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\ + \t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" + language: go - code-samples: - code: "use qdrant_client::qdrant::{\n Condition, Filter, RecommendBatchPointsBuilder,\ \ RecommendPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\nlet client\ @@ -2553,6 +2574,22 @@ paths: \ \"{collection_name}\",\n recommend_queries,\n ))\n\ \ .await?;\n" language: rust + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + const searches = [\n {\n positive: [100, 231],\n negative:\ + \ [718],\n limit: 3,\n },\n {\n positive: [200, 67],\n\ + \ negative: [300],\n limit: 3,\n },\n];\n\nclient.recommend_batch(\"\ + {collection_name}\", {\n searches,\n});\n" + language: typescript + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nrecommend_queries = [\n models.RecommendRequest(\n\ + \ positive=[100, 231], negative=[718], filter=filter_, limit=3\n\ + \ ),\n models.RecommendRequest(positive=[200, 67], negative=[300],\ + \ limit=3),\n]\n\nclient.recommend_batch(collection_name=\"{collection_name}\"\ + , requests=recommend_queries)\n" + language: python - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ import static io.qdrant.client.PointIdFactory.id;\n\nimport io.qdrant.client.QdrantClient;\n\ @@ -2570,43 +2607,6 @@ paths: \nclient.recommendBatchAsync(\"{collection_name}\", recommendQueries,\ \ null).get();\n" language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc recommendBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\tresults, err := client.QueryBatch(context.Background(),\ - \ &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\"\ - ,\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName:\ - \ \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\ - \t\t\t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\ - \t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(231)),\n\t\t\t\t\t\ - },\n\t\t\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\ - \t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\tCollectionName:\ - \ \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\ - \t\t\t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\ - \t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(67)),\n\t\t\t\t\t\ - },\n\t\t\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(300)),\n\ - \t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\ - \t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" - language: go - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend/batch'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \ - \ \"positive\": [\n 100,\n 231\n ],\n \"negative\"\ - : [\n \"9ad0884a-7bfe-43c0-b88f-c1d9a588b7e1\"\n ],\n \ - \ \"limit\": 1\n },\n {\n \"positive\": [\n 200,\n\ - \ 67\n ],\n \"negative\": [\n 300\n ],\n\ - \ \"limit\": 5\n }\n ]\n}'" - language: curl - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - const searches = [\n {\n positive: [100, 231],\n negative:\ - \ [718],\n limit: 3,\n },\n {\n positive: [200, 67],\n\ - \ negative: [300],\n limit: 3,\n },\n];\n\nclient.recommend_batch(\"\ - {collection_name}\", {\n searches,\n});\n" - language: typescript /collections/{collection_name}/points/recommend/groups: post: description: Retrieves points that are closer to stored positive examples and @@ -2616,6 +2616,13 @@ paths: tags: - Search x-fern-examples: + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend/groups'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"positive\": [\n 100,\n\ + \ 231\n ],\n \"negative\": [\n 718\n ],\n \"group_by\": \"document_id\"\ + ,\n \"limit\": 3,\n \"group_size\": 2\n}'" + language: curl - code-samples: - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\ \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendGroupsAsync(\n\ @@ -2624,32 +2631,6 @@ paths: \ 718 },\n filter: MatchKeyword(\"city\", \"London\"),\n limit:\ \ 3\n);\n" language: csharp - - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.recommend_groups(\n collection_name=\"\ - {collection_name}\",\n positive=[100, 231],\n negative=[718],\n\ - \ group_by=\"document_id\",\n limit=3,\n group_size=2,\n)\n" - language: python - - code-samples: - - code: "use qdrant_client::qdrant::{RecommendPointGroupsBuilder, RecommendStrategy};\n\ - use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ - ).build()?;\n\nclient\n .recommend_groups(\n RecommendPointGroupsBuilder::new(\"\ - {collection_name}\", \"document_id\", 2, 3)\n .add_positive(100)\n\ - \ .add_positive(200)\n .add_negative(718)\n \ - \ .strategy(RecommendStrategy::AverageVector),\n )\n .await?;\n" - language: rust - - code-samples: - - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Points.RecommendPointGroups;\nimport io.qdrant.client.grpc.Points.RecommendStrategy;\n\ - \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.recommendGroupsAsync(RecommendPointGroups.newBuilder()\n\ - \ .setCollectionName(\"{collection_name}\")\n \ - \ .setGroupBy(\"document_id\")\n .setGroupSize(2)\n\ - \ .addAllPositive(List.of(id(100), id(200)))\n \ - \ .addAllNegative(List.of(id(718)))\n .setStrategy(RecommendStrategy.AverageVector)\n\ - \ .setLimit(3)\n .build());\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc recommendGroups() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2665,12 +2646,13 @@ paths: \ \", results)\n}\n" language: go - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend/groups'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"positive\": [\n 100,\n\ - \ 231\n ],\n \"negative\": [\n 718\n ],\n \"group_by\": \"document_id\"\ - ,\n \"limit\": 3,\n \"group_size\": 2\n}'" - language: curl + - code: "use qdrant_client::qdrant::{RecommendPointGroupsBuilder, RecommendStrategy};\n\ + use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .recommend_groups(\n RecommendPointGroupsBuilder::new(\"\ + {collection_name}\", \"document_id\", 2, 3)\n .add_positive(100)\n\ + \ .add_positive(200)\n .add_negative(718)\n \ + \ .strategy(RecommendStrategy::AverageVector),\n )\n .await?;\n" + language: rust - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ @@ -2678,6 +2660,24 @@ paths: \ 231],\n negative: [718],\n group_by: \"document_id\",\n limit:\ \ 3,\n group_size: 2,\n});\n" language: typescript + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.recommend_groups(\n collection_name=\"\ + {collection_name}\",\n positive=[100, 231],\n negative=[718],\n\ + \ group_by=\"document_id\",\n limit=3,\n group_size=2,\n)\n" + language: python + - code-samples: + - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.RecommendPointGroups;\nimport io.qdrant.client.grpc.Points.RecommendStrategy;\n\ + \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.recommendGroupsAsync(RecommendPointGroups.newBuilder()\n\ + \ .setCollectionName(\"{collection_name}\")\n \ + \ .setGroupBy(\"document_id\")\n .setGroupSize(2)\n\ + \ .addAllPositive(List.of(id(100), id(200)))\n \ + \ .addAllNegative(List.of(id(718)))\n .setStrategy(RecommendStrategy.AverageVector)\n\ + \ .setLimit(3)\n .build());\n" + language: java /collections/{collection_name}/points/scroll: post: description: 'Returns all points in a page-by-page manner. @@ -2693,40 +2693,21 @@ paths: tags: - Points x-fern-examples: + - 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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.scroll(\n collection_name=\"{collection_name}\"\ - ,\n scroll_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"\ - color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n\ - \ limit=1,\n with_payload=True,\n with_vectors=False,\n)\n" - language: python - - code-samples: - - code: "use qdrant_client::qdrant::{Condition, Filter, ScrollPointsBuilder};\n\ - use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ - ).build()?;\n\nclient\n .scroll(\n ScrollPointsBuilder::new(\"\ - {collection_name}\")\n .filter(Filter::must([Condition::matches(\n\ - \ \"color\",\n \"red\".to_string(),\n \ - \ )]))\n .limit(1)\n .with_payload(true)\n\ - \ .with_vectors(false),\n )\n .await?;\n" - language: rust - - code-samples: - - code: "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\ @@ -2740,14 +2721,14 @@ paths: \ {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - 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: "use qdrant_client::qdrant::{Condition, Filter, ScrollPointsBuilder};\n\ + use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .scroll(\n ScrollPointsBuilder::new(\"\ + {collection_name}\")\n .filter(Filter::must([Condition::matches(\n\ + \ \"color\",\n \"red\".to_string(),\n \ + \ )]))\n .limit(1)\n .with_payload(true)\n\ + \ .with_vectors(false),\n )\n .await?;\n" + language: rust - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ @@ -2757,6 +2738,25 @@ paths: \ },\n ],\n },\n limit: 1,\n with_payload: true,\n\ \ with_vector: false,\n});\n" language: typescript + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.scroll(\n collection_name=\"{collection_name}\"\ + ,\n scroll_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"\ + color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n\ + \ limit=1,\n with_payload=True,\n with_vectors=False,\n)\n" + language: python + - code-samples: + - code: "import 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 /collections/{collection_name}/points/search: post: description: Retrieves the closest points based on vector similarity and given @@ -2765,6 +2765,15 @@ paths: tags: - Search x-fern-examples: + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"vector\": [\n 0.2,\n \ + \ 0.1,\n 0.9,\n 0.7\n ],\n \"limit\": 1,\n \"filter\": {\n\ + \ \"must\": [\n {\n \"key\": \"city\",\n \"match\"\ + : {\n \"value\": \"London\"\n }\n }\n ]\n }\n\ + }'" + language: curl - code-samples: - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\ \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchAsync(\n\ @@ -2773,14 +2782,16 @@ paths: \ limit: 3\n);\n" language: csharp - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.search(\n collection_name=\"{collection_name}\"\ - ,\n query_filter=models.Filter(\n must=[\n models.FieldCondition(\n\ - \ key=\"city\",\n match=models.MatchValue(\n\ - \ value=\"London\",\n ),\n \ - \ )\n ]\n ),\n query_vector=[0.2, 0.1, 0.9, 0.7],\n \ - \ limit=3,\n)\n" - language: python + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc search() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tlimit := uint64(3)\n\tresults, err := client.Query(context.Background(),\ + \ &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ + \tQuery: qdrant.NewQuery(0.2, 0.1, 0.9, 0.7),\n\t\tFilter: &qdrant.Filter{\n\ + \t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"city\", \"\ + London\"),\n\t\t\t},\n\t\t},\n\t\tLimit: &limit,\n\t})\n\tif err != nil\ + \ {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" + language: go - code-samples: - code: "use qdrant_client::qdrant::{Condition, Filter, SearchParamsBuilder,\ \ SearchPointsBuilder};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"\ @@ -2791,6 +2802,24 @@ paths: \ )]))\n .params(SearchParamsBuilder::default().hnsw_ef(128).exact(false)),\n\ \ )\n .await?;\n" language: rust + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.search(\"{collection_name}\", {\n filter: {\n must: [\n\ + \ {\n key: \"city\",\n match:\ + \ {\n value: \"London\",\n },\n \ + \ },\n ],\n },\n vector: [0.2, 0.1, 0.9, 0.7],\n \ + \ limit: 3,\n});\n" + language: typescript + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.search(\n collection_name=\"{collection_name}\"\ + ,\n query_filter=models.Filter(\n must=[\n models.FieldCondition(\n\ + \ key=\"city\",\n match=models.MatchValue(\n\ + \ value=\"London\",\n ),\n \ + \ )\n ]\n ),\n query_vector=[0.2, 0.1, 0.9, 0.7],\n \ + \ limit=3,\n)\n" + language: python - code-samples: - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -2803,35 +2832,6 @@ paths: \ 0.1f, 0.9f, 0.7f))\n .setLimit(3)\n .build())\n\ \ .get();\n" language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc search() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\tlimit := uint64(3)\n\tresults, err := client.Query(context.Background(),\ - \ &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ - \tQuery: qdrant.NewQuery(0.2, 0.1, 0.9, 0.7),\n\t\tFilter: &qdrant.Filter{\n\ - \t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"city\", \"\ - London\"),\n\t\t\t},\n\t\t},\n\t\tLimit: &limit,\n\t})\n\tif err != nil\ - \ {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" - language: go - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"vector\": [\n 0.2,\n \ - \ 0.1,\n 0.9,\n 0.7\n ],\n \"limit\": 1,\n \"filter\": {\n\ - \ \"must\": [\n {\n \"key\": \"city\",\n \"match\"\ - : {\n \"value\": \"London\"\n }\n }\n ]\n }\n\ - }'" - language: curl - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.search(\"{collection_name}\", {\n filter: {\n must: [\n\ - \ {\n key: \"city\",\n match:\ - \ {\n value: \"London\",\n },\n \ - \ },\n ],\n },\n vector: [0.2, 0.1, 0.9, 0.7],\n \ - \ limit: 3,\n});\n" - language: typescript /collections/{collection_name}/points/search/batch: post: description: Retrieves the closest points in batches based on vector similarity @@ -2840,6 +2840,18 @@ paths: tags: - Search x-fern-examples: + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search/batch'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \ + \ \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n \ + \ 0.7\n ],\n \"limit\": 3\n },\n {\n \"vector\":\ + \ [\n 0.5,\n 0.3,\n 0.2,\n 0.3\n ],\n\ + \ \"filter\": {\n \"must\": [\n {\n \"\ + key\": \"city\",\n \"match\": {\n \"value\": \"\ + London\"\n }\n }\n ]\n },\n \"limit\"\ + : 3\n }\n ]\n}'" + language: curl - code-samples: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\ \nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter =\ @@ -2850,42 +2862,6 @@ paths: \ Limit = 3\n }\n};\n\nawait client.SearchBatchAsync(collectionName:\ \ \"{collection_name}\", searches: searches);\n" language: csharp - - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nfilter_ = models.Filter(\n must=[\n \ - \ models.FieldCondition(\n key=\"city\",\n match=models.MatchValue(\n\ - \ value=\"London\",\n ),\n )\n ]\n\ - )\n\nsearch_queries = [\n models.SearchRequest(vector=[0.2, 0.1, 0.9,\ - \ 0.7], filter=filter_, limit=3),\n models.SearchRequest(vector=[0.5,\ - \ 0.3, 0.2, 0.3], filter=filter_, limit=3),\n]\n\nclient.search_batch(collection_name=\"\ - {collection_name}\", requests=search_queries)\n" - language: python - - code-samples: - - code: "use qdrant_client::qdrant::{\n Condition, Filter, SearchBatchPointsBuilder,\ - \ SearchPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\nlet client =\ - \ Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet filter\ - \ = Filter::must([Condition::matches(\"city\", \"London\".to_string())]);\n\ - \nlet searches = vec![\n SearchPointsBuilder::new(\"{collection_name}\"\ - , vec![0.2, 0.1, 0.9, 0.7], 3)\n .filter(filter.clone())\n \ - \ .build(),\n SearchPointsBuilder::new(\"{collection_name}\", vec![0.5,\ - \ 0.3, 0.2, 0.3], 3)\n .filter(filter.clone())\n .build(),\n\ - ];\n\nclient\n .search_batch_points(SearchBatchPointsBuilder::new(\"\ - {collection_name}\", searches))\n .await?;\n" - language: rust - - code-samples: - - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Common.Filter;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\ - \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"\ - city\", \"London\")).build();\nList searches =\n List.of(\n\ - \ SearchPoints.newBuilder()\n .addAllVector(List.of(0.2f,\ - \ 0.1f, 0.9f, 0.7f))\n .setFilter(filter)\n .setLimit(3)\n\ - \ .build(),\n SearchPoints.newBuilder()\n \ - \ .addAllVector(List.of(0.5f, 0.3f, 0.2f, 0.3f))\n .setFilter(filter)\n\ - \ .setLimit(3)\n .build());\nclient.searchBatchAsync(\"\ - {collection_name}\", searches, null).get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc searchBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2904,17 +2880,17 @@ paths: Query results: \", results)\n}\n" language: go - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search/batch'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \ - \ \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n \ - \ 0.7\n ],\n \"limit\": 3\n },\n {\n \"vector\":\ - \ [\n 0.5,\n 0.3,\n 0.2,\n 0.3\n ],\n\ - \ \"filter\": {\n \"must\": [\n {\n \"\ - key\": \"city\",\n \"match\": {\n \"value\": \"\ - London\"\n }\n }\n ]\n },\n \"limit\"\ - : 3\n }\n ]\n}'" - language: curl + - code: "use qdrant_client::qdrant::{\n Condition, Filter, SearchBatchPointsBuilder,\ + \ SearchPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\nlet client =\ + \ Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet filter\ + \ = Filter::must([Condition::matches(\"city\", \"London\".to_string())]);\n\ + \nlet searches = vec![\n SearchPointsBuilder::new(\"{collection_name}\"\ + , vec![0.2, 0.1, 0.9, 0.7], 3)\n .filter(filter.clone())\n \ + \ .build(),\n SearchPointsBuilder::new(\"{collection_name}\", vec![0.5,\ + \ 0.3, 0.2, 0.3], 3)\n .filter(filter.clone())\n .build(),\n\ + ];\n\nclient\n .search_batch_points(SearchBatchPointsBuilder::new(\"\ + {collection_name}\", searches))\n .await?;\n" + language: rust - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ @@ -2926,6 +2902,30 @@ paths: \ limit: 3,\n },\n];\n\nclient.searchBatch(\"{collection_name}\"\ , {\n searches,\n});\n" language: typescript + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nfilter_ = models.Filter(\n must=[\n \ + \ models.FieldCondition(\n key=\"city\",\n match=models.MatchValue(\n\ + \ value=\"London\",\n ),\n )\n ]\n\ + )\n\nsearch_queries = [\n models.SearchRequest(vector=[0.2, 0.1, 0.9,\ + \ 0.7], filter=filter_, limit=3),\n models.SearchRequest(vector=[0.5,\ + \ 0.3, 0.2, 0.3], filter=filter_, limit=3),\n]\n\nclient.search_batch(collection_name=\"\ + {collection_name}\", requests=search_queries)\n" + language: python + - code-samples: + - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Common.Filter;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\ + \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"\ + city\", \"London\")).build();\nList searches =\n List.of(\n\ + \ SearchPoints.newBuilder()\n .addAllVector(List.of(0.2f,\ + \ 0.1f, 0.9f, 0.7f))\n .setFilter(filter)\n .setLimit(3)\n\ + \ .build(),\n SearchPoints.newBuilder()\n \ + \ .addAllVector(List.of(0.5f, 0.3f, 0.2f, 0.3f))\n .setFilter(filter)\n\ + \ .setLimit(3)\n .build());\nclient.searchBatchAsync(\"\ + {collection_name}\", searches, null).get();\n" + language: java /collections/{collection_name}/points/search/groups: post: description: Retrieves the closest points based on vector similarity and given @@ -2934,35 +2934,19 @@ paths: tags: - Search x-fern-examples: + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search/groups'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"vector\": [\n 0.2,\n \ + \ 0.1,\n 0.9,\n 0.7\n ],\n \"group_by\": \"document_id\",\n\ + \ \"limit\": 4,\n \"group_size\": 2\n}'" + language: curl - code-samples: - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\"\ , 6334);\n\nawait client.SearchGroupsAsync(\n collectionName: \"{collection_name}\"\ ,\n vector: new float[] { 1.1f },\n groupBy: \"document_id\",\n limit:\ \ 4,\n groupSize: 2\n);\n" language: csharp - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.search_groups(\n collection_name=\"\ - {collection_name}\",\n query_vector=[1.1],\n group_by=\"document_id\"\ - ,\n limit=4,\n group_size=2,\n)\n" - language: python - - code-samples: - - code: "use qdrant_client::qdrant::SearchPointGroupsBuilder;\nuse qdrant_client::Qdrant;\n\ - \nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\ - \nclient\n .search_groups(SearchPointGroupsBuilder::new(\n \"\ - {collection_name}\",\n vec![1.1],\n 4,\n \"document_id\"\ - ,\n 2,\n ))\n .await?;\n" - language: rust - - code-samples: - - code: "import java.util.List;\n\nimport io.qdrant.client.QdrantClient;\n\ - import io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.SearchPointGroups;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .searchGroupsAsync(\n\ - \ SearchPointGroups.newBuilder()\n .setCollectionName(\"\ - {collection_name}\")\n .addAllVector(List.of(1.1f))\n \ - \ .setGroupBy(\"document_id\")\n .setLimit(4)\n \ - \ .setGroupSize(2)\n .build())\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc searchGroups() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2975,18 +2959,34 @@ paths: , results)\n}\n" language: go - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search/groups'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"vector\": [\n 0.2,\n \ - \ 0.1,\n 0.9,\n 0.7\n ],\n \"group_by\": \"document_id\",\n\ - \ \"limit\": 4,\n \"group_size\": 2\n}'" - language: curl + - code: "use qdrant_client::qdrant::SearchPointGroupsBuilder;\nuse qdrant_client::Qdrant;\n\ + \nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\ + \nclient\n .search_groups(SearchPointGroupsBuilder::new(\n \"\ + {collection_name}\",\n vec![1.1],\n 4,\n \"document_id\"\ + ,\n 2,\n ))\n .await?;\n" + language: rust - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ client.searchPointGroups(\"{collection_name}\", {\n vector: [1.1],\n\ \ group_by: \"document_id\",\n limit: 4,\n group_size: 2,\n});\n" language: typescript + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.search_groups(\n collection_name=\"\ + {collection_name}\",\n query_vector=[1.1],\n group_by=\"document_id\"\ + ,\n limit=4,\n group_size=2,\n)\n" + language: python + - code-samples: + - code: "import java.util.List;\n\nimport io.qdrant.client.QdrantClient;\n\ + import io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.SearchPointGroups;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .searchGroupsAsync(\n\ + \ SearchPointGroups.newBuilder()\n .setCollectionName(\"\ + {collection_name}\")\n .addAllVector(List.of(1.1f))\n \ + \ .setGroupBy(\"document_id\")\n .setLimit(4)\n \ + \ .setGroupSize(2)\n .build())\n .get();\n" + language: java /collections/{collection_name}/points/search/matrix/offsets: post: description: Retrieves sparse matrix of pairwise distances between points sampled @@ -3002,35 +3002,6 @@ paths: \ \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"\ ),\n sample: 100,\n limit: 5\n);" language: csharp - - 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-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: "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\ @@ -3043,6 +3014,15 @@ paths: \t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"\ Query results: \", results)\n}\n" language: go + - code-samples: + - code: "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: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ @@ -3052,49 +3032,40 @@ paths: \ },\n },\n ],\n },\n sample: 100,\n \ \ limit: 5,\n});\n" language: typescript - /collections/{collection_name}/points/search/matrix/pairs: - post: - description: Retrieves sparse matrix of pairwise distances between points sampled - from the collection. Output is a list of pairs of points and their distances. - summary: Distance matrix pairs - tags: - - Search - x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.SearchMatrixPairsAsync(\n\ - \ \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"\ - ),\n sample: 100,\n limit: 5\n);" - language: csharp - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.search_matrix_pairs(\n collection_name=\"\ + http://localhost:6333\")\n\nclient.search_matrix_offsets(\n collection_name=\"\ {collection_name}\",\n sample=100,\n limit=5,\n query_filter=models.Filter(\n\ \ must=[\n models.FieldCondition(\n key=\"\ color\", match=models.MatchValue(value=\"red\")\n ),\n \ \ ]\n ),\n)" language: python - - code-samples: - - code: "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: "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\ + 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 + /collections/{collection_name}/points/search/matrix/pairs: + post: + 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: + - Search + x-fern-examples: + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nawait client.SearchMatrixPairsAsync(\n\ + \ \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"\ + ),\n sample: 100,\n limit: 5\n);" + language: csharp - code-samples: - code: "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\ @@ -3107,6 +3078,15 @@ paths: \t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"\ Query results: \", results)\n}\n" language: go + - code-samples: + - code: "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: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ @@ -3116,6 +3096,26 @@ paths: \ },\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-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 /collections/{collection_name}/points/vectors: put: description: Updates specified vectors on points. All other unspecified vectors @@ -3124,6 +3124,15 @@ paths: tags: - Points x-fern-examples: + - 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: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ \ QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateVectorsAsync(\n\ @@ -3134,15 +3143,19 @@ paths: \ }\n }\n);\n" language: csharp - 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: "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\t\ + panic(err)\n\t}\n}\n" + language: go - code-samples: - code: "use qdrant_client::qdrant::{PointVectors, UpdatePointVectorsBuilder};\n\ use qdrant_client::Qdrant;\nuse std::collections::HashMap;\n\nlet client\ @@ -3161,6 +3174,26 @@ paths: \ },\n ],\n )\n .wait(true),\n )\n \ \ .await?;\n" language: rust + - 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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.update_vectors(\n collection_name=\"\ + {collection_name}\",\n points=[\n models.PointVectors(\n \ + \ id=1,\n vector={\n \"image\": [0.1,\ + \ 0.2, 0.3, 0.4],\n },\n ),\n models.PointVectors(\n\ + \ id=2,\n vector={\n \"text\": [0.9,\ + \ 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n ),\n \ + \ ],\n)\n" + language: python - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ \ io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\ @@ -3177,39 +3210,6 @@ paths: \ 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\t\ - panic(err)\n\t}\n}\n" - language: go - - 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: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.updateVectors(\"{collection_name}\", {\n points: [\n \ - \ {\n id: 1,\n vector: {\n image:\ - \ [0.1, 0.2, 0.3, 0.4],\n },\n },\n {\n \ - \ id: 2,\n vector: {\n text: [0.9, 0.8,\ - \ 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n },\n ],\n\ - });\n" - language: typescript /collections/{collection_name}/points/vectors/delete: post: description: Deletes specified vectors from points. All other unspecified vectors @@ -3218,6 +3218,18 @@ paths: tags: - Points x-fern-examples: + - 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: 'using Qdrant.Client; @@ -3231,11 +3243,16 @@ paths: ' language: csharp - 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: "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\t\ + Names: []string{\"text\", \"image\"},\n\t\t},\n\t})\n\tif err != nil {\n\ + \t\tpanic(err)\n\t}\n}\n" + language: go - code-samples: - code: "use qdrant_client::qdrant::{DeletePointVectorsBuilder, PointsIdsList,\ \ VectorsSelector};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"\ @@ -3246,6 +3263,18 @@ paths: \ {\n names: vec![\"text\".into(), \"image\".into()],\n\ \ })\n .wait(true),\n )\n .await?;\n" language: rust + - 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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.delete_vectors(\n collection_name=\"\ + {collection_name}\",\n points=[0, 3, 100],\n vectors=[\"text\",\ + \ \"image\"],\n)\n" + language: python - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\ \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -3254,35 +3283,6 @@ paths: \ \"{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\t\ - Names: []string{\"text\", \"image\"},\n\t\t},\n\t})\n\tif err != nil {\n\ - \t\tpanic(err)\n\t}\n}\n" - language: go - - code-samples: - - code: "# 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: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.deleteVectors(\"{collection_name}\", {\n points: [0, 3, 10],\n\ - \ vectors: [\"text\", \"image\"],\n});\n" - language: typescript /collections/{collection_name}/points/{id}: get: description: Retrieves all details from a single point. @@ -3296,12 +3296,41 @@ paths: tags: - Distributed x-fern-examples: + - 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: "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: "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: "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: "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: 'from qdrant_client import QdrantClient @@ -3313,15 +3342,6 @@ paths: ' language: python - - 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: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport\ \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -3333,26 +3353,6 @@ paths: \ .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: "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: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n\ - });\n\nclient.createShardKey(\"{collection_name}\", {\n shard_key:\ - \ \"{shard_key}\"\n});\n" - language: typescript /collections/{collection_name}/shards/delete: post: description: Deletes one or more shard keys for a specified collection. @@ -3360,12 +3360,39 @@ paths: tags: - Distributed x-fern-examples: + - 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: "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: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc deleteShardKey() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\terr = client.DeleteShardKey(context.Background(),\ + \ \"{collection_name}\", &qdrant.DeleteShardKey{\n\t\tShardKey: qdrant.NewShardKey(\"\ + {shard_key}\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go + - code-samples: + - code: "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\"\ + ).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: "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: 'from qdrant_client import QdrantClient @@ -3377,13 +3404,6 @@ paths: ' language: python - - 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\"\ - ).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: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport\ \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -3395,26 +3415,6 @@ paths: \ .setShardKey(shardKey(\"{shard_key}\"))\n \ \ .build())\n .build()).get();\n" language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc deleteShardKey() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\terr = client.DeleteShardKey(context.Background(),\ - \ \"{collection_name}\", &qdrant.DeleteShardKey{\n\t\tShardKey: qdrant.NewShardKey(\"\ - {shard_key}\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go - - code-samples: - - code: "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: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n\ - });\n\nclient.deleteShardKey(\"{collection_name}\", {\n shard_key:\ - \ \"{shard_key}\"\n});\n" - language: typescript /collections/{collection_name}/shards/{shard_id}/snapshots: get: description: Returns a list of all snapshots for a shard from a collection. @@ -3459,6 +3459,10 @@ paths: tags: - Snapshots x-fern-examples: + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/snapshots'\ + \ \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'using Qdrant.Client; @@ -3471,16 +3475,13 @@ paths: ' language: csharp - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.list_snapshots(collection_name="{collection_name}") - - ' - language: python + - 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 - code-samples: - code: 'use qdrant_client::Qdrant; @@ -3492,24 +3493,6 @@ paths: ' language: rust - - 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 - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/snapshots'\ - \ \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -3521,23 +3504,6 @@ paths: ' language: typescript - post: - description: Creates a new snapshot for a specified collection. - summary: Create a snapshot (collection) - tags: - - Snapshots - x-fern-examples: - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.CreateSnapshotAsync("{collection_name}"); - - ' - language: csharp - code-samples: - code: 'from qdrant_client import QdrantClient @@ -3545,27 +3511,37 @@ paths: client = QdrantClient(url="http://localhost:6333") - client.create_snapshot(collection_name="{collection_name}") + client.list_snapshots(collection_name="{collection_name}") ' language: python - code-samples: - - code: 'use qdrant_client::Qdrant; + - 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 + post: + description: Creates a new snapshot for a specified collection. + summary: Create a snapshot (collection) + tags: + - Snapshots + x-fern-examples: + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/snapshots'\ + \ \\\n --header 'api-key: '" + language: curl + - code-samples: + - code: 'using Qdrant.Client; - let client = Qdrant::from_url("http://localhost:6334").build()?; + var client = new QdrantClient("localhost", 6334); - client.create_snapshot("{collection_name}").await?; + await client.CreateSnapshotAsync("{collection_name}"); ' - language: rust - - 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 + language: csharp - 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\ @@ -3575,9 +3551,16 @@ paths: Snapshot created: \", snapshot.Name)\n}\n" language: go - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/snapshots'\ - \ \\\n --header 'api-key: '" - language: curl + - code: 'use qdrant_client::Qdrant; + + + let client = Qdrant::from_url("http://localhost:6334").build()?; + + + client.create_snapshot("{collection_name}").await?; + + ' + language: rust - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -3589,6 +3572,23 @@ paths: ' language: typescript + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.create_snapshot(collection_name="{collection_name}") + + ' + language: python + - code-samples: + - code: "import 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 /collections/{collection_name}/snapshots/recover: put: description: Recovers local collection data from a snapshot. This will overwrite @@ -3598,11 +3598,6 @@ paths: tags: - Snapshots x-fern-examples: - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.recover_snapshot(\n \"{collection_name}\"\ - ,\n \"http://example.com/path/to/snapshot.shapshot\",\n)\n" - language: python - code-samples: - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/snapshots/recover'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -3615,6 +3610,11 @@ paths: client.recoverSnapshot(\"{collection_name}\", {\n location: \"http://example.com/path/to/snapshot.shapshot\"\ ,\n});\n" language: typescript + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.recover_snapshot(\n \"{collection_name}\"\ + ,\n \"http://example.com/path/to/snapshot.shapshot\",\n)\n" + language: python /collections/{collection_name}/snapshots/upload: post: description: Recovers local collection data from an uploaded snapshot. This @@ -3635,6 +3635,10 @@ paths: tags: - Snapshots x-fern-examples: + - 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: 'using Qdrant.Client; @@ -3646,24 +3650,6 @@ paths: ' language: csharp - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.delete_snapshot(\n collection_name=\"\ - {collection_name}\", snapshot_name=\"{snapshot_name}\"\n)\n" - language: python - - code-samples: - - code: "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: "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\ @@ -3673,9 +3659,12 @@ paths: panic(err)\n\t}\n}\n" language: go - code-samples: - - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/snapshots/snapshot_name'\ - \ \\\n --header 'api-key: '" - language: curl + - 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: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -3687,6 +3676,17 @@ paths: ' language: typescript + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.delete_snapshot(\n collection_name=\"\ + {collection_name}\", snapshot_name=\"{snapshot_name}\"\n)\n" + language: python + - code-samples: + - code: "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 get: description: Downloads the specified snapshot file from a collection. summary: Download a snapshot (collection) @@ -3736,6 +3736,10 @@ paths: tags: - Snapshots x-fern-examples: + - code-samples: + - code: "curl -X GET \\\n 'http://localhost:6333/snapshots' \\\n --header\ + \ 'api-key: '" + language: curl - code-samples: - code: 'using Qdrant.Client; @@ -3748,16 +3752,13 @@ paths: ' language: csharp - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.list_full_snapshots() - - ' - language: python + - 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 - code-samples: - code: 'use qdrant_client::Qdrant; @@ -3769,23 +3770,6 @@ paths: ' language: rust - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.listFullSnapshotAsync().get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc listFullSnapshots() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\tsnapshots, err := client.ListFullSnapshots(context.Background())\n\ - \tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Full snapshots:\ - \ \", snapshots)\n}\n" - language: go - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/snapshots' \\\n --header\ - \ 'api-key: '" - language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -3797,12 +3781,32 @@ paths: ' language: typescript + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.list_full_snapshots() + + ' + language: python + - 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 post: description: Creates a new snapshot of the entire storage. summary: Create a snapshot (storage) tags: - Snapshots x-fern-examples: + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/snapshots' \\\n --header\ + \ 'api-key: '" + language: curl - code-samples: - code: 'using Qdrant.Client; @@ -3815,16 +3819,13 @@ paths: ' language: csharp - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.create_full_snapshot() - - ' - language: python + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc createFullSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tsnapshot, err := client.CreateFullSnapshot(context.Background())\n\ + \tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Snapshot created:\ + \ \", snapshot.Name)\n}\n" + language: go - code-samples: - code: 'use qdrant_client::Qdrant; @@ -3836,23 +3837,6 @@ paths: ' language: rust - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.createFullSnapshotAsync().get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc createFullSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\tsnapshot, err := client.CreateFullSnapshot(context.Background())\n\ - \tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Snapshot created:\ - \ \", snapshot.Name)\n}\n" - language: go - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/snapshots' \\\n --header\ - \ 'api-key: '" - language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -3864,6 +3848,22 @@ paths: ' language: typescript + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.create_full_snapshot() + + ' + language: python + - 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 /snapshots/{snapshot_name}: delete: description: Deletes the specified snapshot of the entire storage. @@ -3871,6 +3871,10 @@ paths: tags: - Snapshots x-fern-examples: + - code-samples: + - code: "curl -X DELETE \\\n 'http://localhost:6333/snapshots/snapshot_name'\ + \ \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'using Qdrant.Client; @@ -3883,16 +3887,12 @@ paths: ' language: csharp - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.delete_full_snapshot(snapshot_name="{snapshot_name}") - - ' - language: python + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc deleteFullSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\terr = client.DeleteFullSnapshot(context.Background(),\ + \ \"{snapshot_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go - code-samples: - code: 'use qdrant_client::Qdrant; @@ -3904,23 +3904,6 @@ paths: ' language: rust - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.deleteFullSnapshotAsync(\"\ - {snapshot_name}\").get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc deleteFullSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\terr = client.DeleteFullSnapshot(context.Background(),\ - \ \"{snapshot_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go - - code-samples: - - code: "curl -X DELETE \\\n 'http://localhost:6333/snapshots/snapshot_name'\ - \ \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -3932,6 +3915,23 @@ paths: ' language: typescript + - code-samples: + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.delete_full_snapshot(snapshot_name="{snapshot_name}") + + ' + language: python + - 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 get: description: Downloads the specified snapshot of the entire storage as a file. summary: Download a snapshot (storage) From dbb54add3fd8acbd2826deedbff24c430a540f44 Mon Sep 17 00:00:00 2001 From: andres-qd Date: Tue, 23 Jun 2026 05:16:08 -0500 Subject: [PATCH 3/4] chore: add dependabot cooldown configuration --- .github/dependabot.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 52e565f..5150476 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -17,3 +17,5 @@ updates: - "patch" patterns: - "*" + cooldown: + default-days: 7 From a8b5be1410b5801507c68ab1742e8446e94a0b11 Mon Sep 17 00:00:00 2001 From: andres-qd <177576014+andres-qd@users.noreply.github.com> Date: Tue, 23 Jun 2026 10:16:32 +0000 Subject: [PATCH 4/4] Sync OpenAPI --- fern/apis/master/openapi-overrides.yml | 726 +++++----- fern/apis/v1.18.x/openapi-overrides.yml | 1606 +++++++++++------------ 2 files changed, 1166 insertions(+), 1166 deletions(-) diff --git a/fern/apis/master/openapi-overrides.yml b/fern/apis/master/openapi-overrides.yml index b2c06ed..8d10954 100644 --- a/fern/apis/master/openapi-overrides.yml +++ b/fern/apis/master/openapi-overrides.yml @@ -13,17 +13,6 @@ paths: - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/aliases' \\\n --header 'api-key: '" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ListAliasesAsync(); - -' - language: csharp - 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 @@ -39,16 +28,16 @@ paths: ' language: rust - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.getAliases(); + await client.ListAliasesAsync(); ' - language: typescript + language: csharp - code-samples: - code: 'from qdrant_client import QdrantClient @@ -60,6 +49,17 @@ paths: ' language: python + - 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: "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 @@ -73,17 +73,6 @@ paths: - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/collections' \\\n --header 'api-key: '" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ListCollectionsAsync(); - -' - language: csharp - 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 @@ -99,16 +88,16 @@ paths: ' language: rust - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.getCollections(); + await client.ListCollectionsAsync(); ' - language: typescript + language: csharp - code-samples: - code: 'from qdrant_client import QdrantClient @@ -120,6 +109,17 @@ paths: ' language: python + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.getCollections(); + +' + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listCollectionsAsync().get();\n" language: java @@ -133,6 +133,12 @@ paths: - code-samples: - code: "# Create an alias\ncurl -X POST \\\n 'http://localhost:6333/collections/aliases' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"actions\": [\n {\n \"create_alias\": {\n \"collection_name\": \"{collection_name}\",\n \"alias_name\": \"{alias_name}\"\n }\n }\n ]\n}'\n\n# Delete an alias\ncurl -X POST \\\n 'http://localhost:6333/collections/aliases' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"actions\": [\n {\n \"delete_alias\": {\n \"alias_name\": \"{alias_name}\"\n }\n }\n ]\n}'\n\n# Rename an alias\ncurl -X POST \\\n 'http://localhost:6333/collections/aliases' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"actions\": [\n {\n \"rename_alias\": {\n \"old_alias_name\": \"{old_alias_name}\",\n \"new_alias_name\": \"{new_alias_name}\"\n }\n }\n ]\n}'\n" language: curl + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc updateAlias() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.CreateAlias(context.Background(), \"production_collection\", \"example_collection\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteAlias(context.Background(), \"production_collection\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.RenameAlias(context.Background(), \"production_collection\", \"legacy_collection\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go + - code-samples: + - code: "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: 'using Qdrant.Client; @@ -148,17 +154,11 @@ paths: ' language: csharp - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc updateAlias() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.CreateAlias(context.Background(), \"production_collection\", \"example_collection\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteAlias(context.Background(), \"production_collection\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.RenameAlias(context.Background(), \"production_collection\", \"legacy_collection\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go - - code-samples: - - code: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.update_collection_aliases(\n change_aliases_operations=[\n models.CreateAliasOperation(\n create_alias=models.CreateAlias(\n collection_name=\"example_collection\", alias_name=\"production_collection\"\n )\n )\n ]\n)\n\nclient.update_collection_aliases(\n change_aliases_operations=[\n models.DeleteAliasOperation(\n delete_alias=models.DeleteAlias(alias_name=\"production_collection\")\n ),\n ]\n)\n" + language: python - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.updateCollectionAliases({\n actions: [\n {\n create_alias: {\n collection_name: \"example_collection\",\n alias_name: \"production_collection\",\n },\n },\n ],\n});\n\nclient.updateCollectionAliases({\n actions: [\n {\n delete_alias: {\n alias_name: \"production_collection\",\n },\n },\n ],\n});\n" language: typescript - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.update_collection_aliases(\n change_aliases_operations=[\n models.CreateAliasOperation(\n create_alias=models.CreateAlias(\n collection_name=\"example_collection\", alias_name=\"production_collection\"\n )\n )\n ]\n)\n\nclient.update_collection_aliases(\n change_aliases_operations=[\n models.DeleteAliasOperation(\n delete_alias=models.DeleteAlias(alias_name=\"production_collection\")\n ),\n ]\n)\n" - language: python - code-samples: - code: "import 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 @@ -172,17 +172,6 @@ paths: - code-samples: - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: '" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.DeleteCollectionAsync("{collection_name}"); - -' - language: csharp - 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 @@ -198,16 +187,16 @@ paths: ' language: rust - code-samples: - - code: 'import { QdrantClient } from ''@qdrant/qdrant-js''; + - code: 'using Qdrant.Client; - const client = new QdrantClient({url: ''http://127.0.0.1:6333''}); + var client = new QdrantClient("localhost", 6334); - client.deleteCollection("{collection_name}"); + await client.DeleteCollectionAsync("{collection_name}"); ' - language: typescript + language: csharp - code-samples: - code: 'from qdrant_client import QdrantClient @@ -219,6 +208,17 @@ paths: ' language: python + - code-samples: + - code: 'import { QdrantClient } from ''@qdrant/qdrant-js''; + + + const client = new QdrantClient({url: ''http://127.0.0.1:6333''}); + + + client.deleteCollection("{collection_name}"); + +' + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteCollectionAsync(\"{collection_name}\").get();\n" language: java @@ -231,17 +231,6 @@ paths: - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: '" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.GetCollectionInfoAsync("{collection_name}"); - -' - language: csharp - 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 @@ -257,16 +246,16 @@ paths: ' language: rust - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.getCollection("{collection_name}"); + await client.GetCollectionInfoAsync("{collection_name}"); ' - language: typescript + language: csharp - code-samples: - code: 'from qdrant_client import QdrantClient @@ -278,6 +267,17 @@ paths: ' language: python + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.getCollection("{collection_name}"); + +' + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.getCollectionInfoAsync(\"{collection_name}\").get();\n" language: java @@ -290,9 +290,6 @@ paths: - 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: "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: "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 @@ -300,11 +297,14 @@ paths: - 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: "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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.update_collection(\n collection_name=\"{collection_name}\",\n optimizer_config=models.OptimizersConfigDiff(indexing_threshold=10000),\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.updateCollection(\"{collection_name}\", {\n optimizers_config: {\n indexing_threshold: 10000,\n },\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.OptimizersConfigDiff;\nimport io.qdrant.client.grpc.Collections.UpdateCollection;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.updateCollectionAsync(\n UpdateCollection.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setOptimizersConfig(\n OptimizersConfigDiff.newBuilder().setIndexingThreshold(10000).build())\n .build());\n" language: java @@ -317,9 +317,6 @@ paths: - 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: "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: "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 @@ -327,11 +324,14 @@ paths: - 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: "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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.create_collection(\n collection_name=\"{collection_name}\",\n vectors_config=models.VectorParams(size=100, distance=models.Distance.COSINE),\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.createCollection(\"{collection_name}\", {\n vectors: { size: 100, distance: \"Cosine\" },\n});\n\n// or with sparse vectors\n\nclient.createCollection(\"{collection_name}\", {\n vectors: { size: 100, distance: \"Cosine\" },\n sparse_vectors: {\n \"splade-model-name\": {\n index: {\n on_disk: false\n }\n }\n }\n});" + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.Distance;\nimport io.qdrant.client.grpc.Collections.VectorParams;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createCollectionAsync(\"{collection_name}\",\n VectorParams.newBuilder().setDistance(Distance.Cosine).setSize(100).build()).get();\n\n// Or with sparse vectors\n\nclient.createCollectionAsync(\n CreateCollection.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setSparseVectorsConfig(\n Collections.SparseVectorConfig.newBuilder().putMap(\n \"splade-model-name\",\n Collections.SparseVectorParams.newBuilder()\n .setIndex(\n Collections.SparseIndexConfig\n .newBuilder()\n .setOnDisk(false)\n .build()\n ).build()\n ).build()\n ).build()\n).get();" language: java @@ -345,17 +345,6 @@ paths: - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/aliases' \\\n --header 'api-key: '" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ListCollectionAliasesAsync("{collection_name}"); - -' - language: csharp - 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 @@ -371,16 +360,16 @@ paths: ' language: rust - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.getCollectionAliases("{collection_name}"); + await client.ListCollectionAliasesAsync("{collection_name}"); ' - language: typescript + language: csharp - code-samples: - code: 'from qdrant_client import QdrantClient @@ -392,6 +381,17 @@ paths: ' language: python + - 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: "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 @@ -405,17 +405,6 @@ paths: - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/exists' \\\n --header 'api-key: '" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.CollectionExistsAsync("{collection_name}"); - -' - language: csharp - 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 @@ -431,16 +420,16 @@ paths: ' language: rust - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.collectionExists("{collection_name}"); + await client.CollectionExistsAsync("{collection_name}"); ' - language: typescript + language: csharp - code-samples: - code: 'from qdrant_client import QdrantClient @@ -450,6 +439,17 @@ paths: client.collection_exists(collection_name="{collection_name}")' language: python + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.collectionExists("{collection_name}"); + +' + language: typescript - code-samples: - code: 'import static io.qdrant.client.ConditionFactory.matchKeyword; @@ -473,9 +473,6 @@ paths: /collections/{collection_name}/facet: post: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.FacetAsync(\n\t\"{collection_name}\",\n\tfilter: MatchKeyword(\"color\", \"red\"),\n\tkey: \"my-payload-key\",\n\tlimit: 10\n);" - language: csharp - code-samples: - code: "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 @@ -483,11 +480,14 @@ paths: - 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: "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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.facet(\n collection_name=\"{collection_name}\",\n key=\"my-payload-key\",\n facet_filter=models.Filter(must=[models.Match(\"color\", \"red\")]),\n limit=10,\n)\n\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.facet(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n key: \"my-payload-key\",\n limit: 10,\n});\n" + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\nimport io.qdrant.client.grpc.Points;\nimport io.qdrant.client.grpc.Filter;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .facetAsync(\n Points.FacetCounts.newBuilder()\n .setCollectionName(collection_name)\n .setKey(\"my-payload-key\")\n .setFilter(\n Filter.newBuilder()\n .addMust(matchKeyword(\"color\", \"red\"))\n .build())\n .build())\n .get();" language: java @@ -501,9 +501,6 @@ paths: - 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: "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: "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 @@ -511,11 +508,14 @@ paths: - 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: "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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.create_payload_index(\n collection_name=\"{collection_name}\",\n field_name=\"name_of_the_field_to_index\",\n field_schema=\"keyword\",\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.createPayloadIndex(\"{collection_name}\", {\n field_name: \"{field_name}\",\n field_schema: \"keyword\",\n});\n" + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.PayloadSchemaType;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createPayloadIndexAsync(\n \"{collection_name}\",\n \"{field_name}\",\n PayloadSchemaType.Keyword,\n null,\n true,\n null,\n null);\n" language: java @@ -529,9 +529,6 @@ 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: "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: "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 @@ -539,27 +536,30 @@ paths: - 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: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - 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: 'from qdrant_client import QdrantClient - const client = new QdrantClient({ host: "localhost", port: 6333 }); + client = QdrantClient(url="http://localhost:6333") - client.deletePayloadIndex("{collection_name}", "{field_name}"); + client.delete_payload_index("{collection_name}", "{field_name}"); ' - language: typescript + language: python - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.delete_payload_index("{collection_name}", "{field_name}"); + client.deletePayloadIndex("{collection_name}", "{field_name}"); ' - language: python + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deletePayloadIndexAsync(\"{collection_name}\", \"{field_name}\", true, null, null).get();\n" language: java @@ -573,9 +573,6 @@ paths: - 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: "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: "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 @@ -583,11 +580,14 @@ paths: - 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: "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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.retrieve(\n collection_name=\"{collection_name}\",\n ids=[0, 3, 100],\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.retrieve(\"{collection_name}\", {\n ids: [0, 3, 100],\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .retrieveAsync(\"{collection_name}\", List.of(id(0), id(30), id(100)), false, false, null)\n .get();\n" language: java @@ -600,9 +600,6 @@ paths: - 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: "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: "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 @@ -610,11 +607,14 @@ paths: - 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: "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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.upsert(\n collection_name=\"{collection_name}\",\n points=[\n models.PointStruct(\n id=1,\n payload={\n \"color\": \"red\",\n },\n vector=[0.9, 0.1, 0.1],\n ),\n models.PointStruct(\n id=2,\n payload={\n \"color\": \"green\",\n },\n vector=[0.1, 0.9, 0.1],\n ),\n models.PointStruct(\n id=3,\n payload={\n \"color\": \"blue\",\n },\n vector=[0.1, 0.1, 0.9],\n ),\n ],\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.upsert(\"{collection_name}\", {\n points: [\n {\n id: 1,\n payload: { color: \"red\" },\n vector: [0.9, 0.1, 0.1],\n },\n {\n id: 2,\n payload: { color: \"green\" },\n vector: [0.1, 0.9, 0.1],\n },\n {\n id: 3,\n payload: { color: \"blue\" },\n vector: [0.1, 0.1, 0.9],\n },\n ],\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.PointStruct;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .upsertAsync(\n \"{collection_name}\",\n List.of(\n PointStruct.newBuilder()\n .setId(id(1))\n .setVectors(\n namedVectors(\n Map.of(\n \"image\",\n vector(List.of(0.9f, 0.1f, 0.1f, 0.2f)),\n \"text\",\n vector(List.of(0.4f, 0.7f, 0.1f, 0.8f, 0.1f, 0.1f, 0.9f, 0.2f)))))\n .build(),\n PointStruct.newBuilder()\n .setId(id(2))\n .setVectors(\n namedVectors(\n Map.of(\n \"image\",\n List.of(0.2f, 0.1f, 0.3f, 0.9f),\n \"text\",\n List.of(0.5f, 0.2f, 0.7f, 0.4f, 0.7f, 0.2f, 0.3f, 0.9f))))\n .build()))\n .get();\n" language: java @@ -628,9 +628,6 @@ paths: - 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: "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: "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 @@ -638,11 +635,14 @@ paths: - 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: "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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.batch_update_points(\n collection_name=\"{collection_name}\",\n update_operations=[\n models.UpsertOperation(\n upsert=models.PointsList(\n points=[\n models.PointStruct(\n id=1,\n vector=[1.0, 2.0, 3.0, 4.0],\n payload={},\n ),\n ]\n )\n ),\n models.UpdateVectorsOperation(\n update_vectors=models.UpdateVectors(\n points=[\n models.PointVectors(\n id=1,\n vector=[1.0, 2.0, 3.0, 4.0],\n )\n ]\n )\n ),\n models.SetPayloadOperation(\n set_payload=models.SetPayload(\n payload={\n \"test_payload_2\": 2,\n \"test_payload_3\": 3,\n },\n points=[1],\n )\n ),\n ],\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.batchUpdate(\"{collection_name}\", {\n operations: [\n {\n upsert: {\n points: [\n {\n id: 1,\n vector: [1.0, 2.0, 3.0, 4.0],\n payload: {},\n },\n ],\n },\n },\n {\n update_vectors: {\n points: [\n {\n id: 1,\n vector: [1.0, 2.0, 3.0, 4.0],\n },\n ],\n },\n },\n {\n set_payload: {\n payload: {\n test_payload_2: 2,\n test_payload_3: 3,\n },\n points: [1],\n },\n },\n ],\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\nimport java.util.Map;\n\nimport static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.ValueFactory.value;\nimport static io.qdrant.client.VectorsFactory.vectors;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.PointStruct;\nimport io.qdrant.client.grpc.Points.PointVectors;\nimport io.qdrant.client.grpc.Points.PointsIdsList;\nimport io.qdrant.client.grpc.Points.PointsSelector;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation.PointStructList;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation.SetPayload;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation.UpdateVectors;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .batchUpdateAsync(\n \"{collection_name}\",\n List.of(\n PointsUpdateOperation.newBuilder()\n .setUpsert(\n PointStructList.newBuilder()\n .addPoints(\n PointStruct.newBuilder()\n .setId(id(1))\n .setVectors(vectors(\n 1.0 f,\n 2.0 f,\n 3.0 f,\n 4.0 f))\n .build())\n .build())\n .build(),\n PointsUpdateOperation.newBuilder()\n .setUpdateVectors(\n UpdateVectors.newBuilder()\n .addPoints(\n PointVectors.newBuilder()\n .setId(id(1))\n .setVectors(vectors(\n 1.0 f,\n 2.0 f,\n 3.0 f,\n 4.0 f))\n .build())\n .build())\n .build(),\n PointsUpdateOperation.newBuilder()\n .setSetPayload(\n SetPayload.newBuilder()\n .setPointsSelector(\n PointsSelector.newBuilder()\n .setPoints(PointsIdsList\n .newBuilder()\n .addIds(id(1))\n .build())\n .build())\n .putAllPayload(\n Map.of(\"test_payload_2\",\n value(2),\n \"test_payload_3\",\n value(3)))\n .build())\n .build()))\n .get();\n" language: java @@ -656,9 +656,6 @@ paths: - 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: "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: "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 @@ -666,11 +663,14 @@ paths: - 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: "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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.count(\n collection_name=\"{collection_name}\",\n count_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n exact=True,\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.count(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n exact: true,\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.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 @@ -684,6 +684,12 @@ paths: - code-samples: - code: "# Delete points by IDs\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"points\": [\n 0,\n 3,\n 100\n ]\n}'\n\n# Delete points by filter \ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n }\n}'\n" language: curl + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc delete() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.Delete(context.Background(), &qdrant.DeletePoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: qdrant.NewPointsSelectorIDs([]*qdrant.PointId{\n\t\t\tqdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(100),\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.Delete(context.Background(), &qdrant.DeletePoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: qdrant.NewPointsSelectorFilter(&qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go + - code-samples: + - code: "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: 'using Qdrant.Client; @@ -699,17 +705,11 @@ paths: ' language: csharp - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc delete() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.Delete(context.Background(), &qdrant.DeletePoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: qdrant.NewPointsSelectorIDs([]*qdrant.PointId{\n\t\t\tqdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(100),\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.Delete(context.Background(), &qdrant.DeletePoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: qdrant.NewPointsSelectorFilter(&qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go - - code-samples: - - code: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete(\n collection_name=\"{collection_name}\",\n points_selector=models.PointIdsList(\n points=[0, 3, 100],\n ),\n)\n\nclient.delete(\n collection_name=\"{collection_name}\",\n points_selector=models.FilterSelector(\n filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"color\",\n match=models.MatchValue(value=\"red\"),\n ),\n ],\n )\n ),\n)\n" + language: python - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.delete(\"{collection_name}\", {\n points: [0, 3, 100],\n});\n\nclient.delete(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n});\n" language: typescript - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete(\n collection_name=\"{collection_name}\",\n points_selector=models.PointIdsList(\n points=[0, 3, 100],\n ),\n)\n\nclient.delete(\n collection_name=\"{collection_name}\",\n points_selector=models.FilterSelector(\n filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"color\",\n match=models.MatchValue(value=\"red\"),\n ),\n ],\n )\n ),\n)\n" - language: python - code-samples: - code: "import 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 @@ -723,9 +723,6 @@ paths: - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/discover' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"target\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"context\": [\n {\n \"positive\": \"7f6652c4-89bd-40e0-ab1d-510f7fcddd2b\",\n \"negative\": \"2c2c9f86-0171-4bd2-9ab0-b4754682cddd\"\n }\n ],\n \"limit\": 10\n}'" language: curl - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.DiscoverAsync(\n collectionName: \"{collection_name}\",\n target: new TargetVector\n {\n Single = new VectorExample { Vector = new float[] { 0.2f, 0.1f, 0.9f, 0.7f }, }\n },\n context:\n [\n new()\n {\n Positive = new VectorExample { Id = 100 },\n Negative = new VectorExample { Id = 718 }\n },\n new()\n {\n Positive = new VectorExample { Id = 200 },\n Negative = new VectorExample { Id = 300 }\n }\n ],\n limit: 10\n);\n" - language: csharp - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc discover() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresults, err := client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQueryDiscover(&qdrant.DiscoverInput{\n\t\t\tTarget: qdrant.NewVectorInput(0.2, 0.1, 0.9, 0.7),\n\t\t\tContext: &qdrant.ContextInput{\n\t\t\t\tPairs: []*qdrant.ContextInputPair{{\n\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\t\t\t\t}, {\n\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(300)),\n\t\t\t\t}},\n\t\t\t},\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go @@ -733,11 +730,14 @@ paths: - code: "use qdrant_client::qdrant::{\n target_vector::Target, vector_example::Example, ContextExamplePairBuilder,\n DiscoverPointsBuilder, VectorExample,\n};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .discover(\n DiscoverPointsBuilder::new(\n \"{collection_name}\",\n vec![\n ContextExamplePairBuilder::default()\n .positive(Example::Id(100.into()))\n .negative(Example::Id(718.into()))\n .build(),\n ContextExamplePairBuilder::default()\n .positive(Example::Id(200.into()))\n .negative(Example::Id(300.into()))\n .build(),\n ],\n 10,\n )\n .target(Target::Single(VectorExample {\n example: Some(Example::Vector(vec![0.2, 0.1, 0.9, 0.7].into())),\n })),\n )\n .await?;\n" language: rust - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.discover(\"{collection_name}\", {\n target: [0.2, 0.1, 0.9, 0.7],\n context: [\n {\n positive: 100,\n negative: 718,\n },\n {\n positive: 200,\n negative: 300,\n },\n ],\n limit: 10,\n});\n" - language: typescript + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.DiscoverAsync(\n collectionName: \"{collection_name}\",\n target: new TargetVector\n {\n Single = new VectorExample { Vector = new float[] { 0.2f, 0.1f, 0.9f, 0.7f }, }\n },\n context:\n [\n new()\n {\n Positive = new VectorExample { Id = 100 },\n Negative = new VectorExample { Id = 718 }\n },\n new()\n {\n Positive = new VectorExample { Id = 200 },\n Negative = new VectorExample { Id = 300 }\n }\n ],\n limit: 10\n);\n" + language: csharp - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.discover(\n \"{collection_name}\",\n target=[0.2, 0.1, 0.9, 0.7],\n context=[\n models.ContextExamplePair(positive=100, negative=718),\n models.ContextExamplePair(positive=200, negative=300),\n ],\n limit=10,\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.discover(\"{collection_name}\", {\n target: [0.2, 0.1, 0.9, 0.7],\n context: [\n {\n positive: 100,\n negative: 718,\n },\n {\n positive: 200,\n negative: 300,\n },\n ],\n limit: 10,\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.ContextExamplePair;\nimport io.qdrant.client.grpc.Points.DiscoverPoints;\nimport io.qdrant.client.grpc.Points.TargetVector;\nimport io.qdrant.client.grpc.Points.VectorExample;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .discoverAsync(\n DiscoverPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setTarget(\n TargetVector.newBuilder()\n .setSingle(\n VectorExample.newBuilder()\n .setVector(vector(0.2f, 0.1f, 0.9f, 0.7f))\n .build()))\n .addAllContext(\n List.of(\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample.newBuilder().setId(id(100)))\n .setNegative(VectorExample.newBuilder().setId(id(718)))\n .build(),\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample.newBuilder().setId(id(200)))\n .setNegative(VectorExample.newBuilder().setId(id(300)))\n .build()))\n .setLimit(10)\n .build())\n .get();\n" language: java @@ -757,9 +757,6 @@ paths: - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/discover/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"target\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"context\": [\n {\n \"positive\": \"7f6652c4-89bd-40e0-ab1d-510f7fcddd2b\",\n \"negative\": \"2c2c9f86-0171-4bd2-9ab0-b4754682cddd\"\n }\n ],\n \"limit\": 1\n },\n {\n \"target\": [\n 0.5,\n 0.3,\n 0.2,\n 0.3\n ],\n \"context\": [\n {\n \"positive\": 342,\n \"negative\": 213\n }\n ],\n \"limit\": 1\n }\n ]\n}'" language: curl - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar discoverPoints = new List\n{\n new DiscoverPoints\n {\n CollectionName = \"{collection_name}\",\n Target = new TargetVector\n {\n Single = new VectorExample { Vector = new float[] { 0.2f, 0.1f, 0.9f, 0.7f }, }\n },\n Context =\n {\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 100 },\n Negative = new VectorExample { Id = 718 }\n },\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 200 },\n Negative = new VectorExample { Id = 300 }\n }\n },\n Limit = 10\n },\n new DiscoverPoints\n {\n CollectionName = \"{collection_name}\",\n Target = new TargetVector\n {\n Single = new VectorExample { Vector = new float[] { 0.5f, 0.3f, 0.2f, 0.3f }, }\n },\n Context =\n {\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 342 },\n Negative = new VectorExample { Id = 213 }\n },\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 100 },\n Negative = new VectorExample { Id = 200 }\n }\n },\n Limit = 10\n }\n};\nawait client.DiscoverBatchAsync(\"{collection_name}\", discoverPoints);\n" - language: csharp - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc discoverBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresults, err := client.QueryBatch(context.Background(), &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryDiscover(&qdrant.DiscoverInput{\n\t\t\t\t\tTarget: qdrant.NewVectorInput(0.2, 0.1, 0.9, 0.7),\n\t\t\t\t\tContext: &qdrant.ContextInput{\n\t\t\t\t\t\tPairs: []*qdrant.ContextInputPair{{\n\t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(300)),\n\t\t\t\t\t\t}},\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryDiscover(&qdrant.DiscoverInput{\n\t\t\t\t\tTarget: qdrant.NewVectorInput(0.5, 0.3, 0.2, 0.3),\n\t\t\t\t\tContext: &qdrant.ContextInput{\n\t\t\t\t\t\tPairs: []*qdrant.ContextInputPair{{\n\t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(342)),\n\t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(213)),\n\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\t\t\t\t\t\t}},\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go @@ -767,11 +764,14 @@ paths: - code: "use qdrant_client::qdrant::{\n vector_example::Example, ContextExamplePairBuilder, DiscoverBatchPointsBuilder,\n DiscoverPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet discover_points = DiscoverBatchPointsBuilder::new(\n \"{collection_name}\",\n vec![\n DiscoverPointsBuilder::new(\n \"{collection_name}\",\n vec![\n ContextExamplePairBuilder::default()\n .positive(Example::Id(100.into()))\n .negative(Example::Id(718.into()))\n .build(),\n ContextExamplePairBuilder::default()\n .positive(Example::Id(200.into()))\n .negative(Example::Id(300.into()))\n .build(),\n ],\n 10,\n )\n .build(),\n DiscoverPointsBuilder::new(\n \"{collection_name}\",\n vec![\n ContextExamplePairBuilder::default()\n .positive(Example::Id(342.into()))\n .negative(Example::Id(213.into()))\n .build(),\n ContextExamplePairBuilder::default()\n .positive(Example::Id(100.into()))\n .negative(Example::Id(200.into()))\n .build(),\n ],\n 10,\n )\n .build(),\n ],\n);\n\nclient.discover_batch(&discover_points.build()).await?;\n" language: rust - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nconst searches = [\n {\n target: [0.2, 0.1, 0.9, 0.7],\n context: [\n {\n positive: 100,\n negative: 718,\n },\n {\n positive: 200,\n negative: 300,\n },\n ],\n limit: 10,\n },\n {\n target: [0.5, 0.3, 0.2, 0.3],\n context: [\n {\n positive: 342,\n negative: 213,\n },\n {\n positive: 100,\n negative: 200,\n },\n ],\n limit: 5,\n },\n];\n\nclient.discoverBatchPoints(\"{collection_name}\", {\n searches,\n});\n" - language: typescript + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar discoverPoints = new List\n{\n new DiscoverPoints\n {\n CollectionName = \"{collection_name}\",\n Target = new TargetVector\n {\n Single = new VectorExample { Vector = new float[] { 0.2f, 0.1f, 0.9f, 0.7f }, }\n },\n Context =\n {\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 100 },\n Negative = new VectorExample { Id = 718 }\n },\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 200 },\n Negative = new VectorExample { Id = 300 }\n }\n },\n Limit = 10\n },\n new DiscoverPoints\n {\n CollectionName = \"{collection_name}\",\n Target = new TargetVector\n {\n Single = new VectorExample { Vector = new float[] { 0.5f, 0.3f, 0.2f, 0.3f }, }\n },\n Context =\n {\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 342 },\n Negative = new VectorExample { Id = 213 }\n },\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 100 },\n Negative = new VectorExample { Id = 200 }\n }\n },\n Limit = 10\n }\n};\nawait client.DiscoverBatchAsync(\"{collection_name}\", discoverPoints);\n" + language: csharp - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\ndiscover_queries = [\n models.DiscoverRequest(\n target=[0.2, 0.1, 0.9, 0.7],\n context=[\n models.ContextExamplePair(\n positive=100,\n negative=718,\n ),\n models.ContextExamplePair(\n positive=200,\n negative=300,\n ),\n ],\n limit=10,\n ),\n models.DiscoverRequest(\n target=[0.5, 0.3, 0.2, 0.3],\n context=[\n models.ContextExamplePair(\n positive=342,\n negative=213,\n ),\n models.ContextExamplePair(\n positive=100,\n negative=200,\n ),\n ],\n limit=5,\n ),\n]\n\nclient.discover_batch(\"{collection_name}\", discover_queries)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nconst searches = [\n {\n target: [0.2, 0.1, 0.9, 0.7],\n context: [\n {\n positive: 100,\n negative: 718,\n },\n {\n positive: 200,\n negative: 300,\n },\n ],\n limit: 10,\n },\n {\n target: [0.5, 0.3, 0.2, 0.3],\n context: [\n {\n positive: 342,\n negative: 213,\n },\n {\n positive: 100,\n negative: 200,\n },\n ],\n limit: 5,\n },\n];\n\nclient.discoverBatchPoints(\"{collection_name}\", {\n searches,\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\nimport java.util.Arrays;\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.ContextExamplePair;\nimport io.qdrant.client.grpc.Points.DiscoverPoints;\nimport io.qdrant.client.grpc.Points.TargetVector;\nimport io.qdrant.client.grpc.Points.VectorExample;\n\nQdrantClient client = new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nList discoverPoints = Arrays.asList(\n DiscoverPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setTarget(\n TargetVector.newBuilder()\n .setSingle(\n VectorExample.newBuilder()\n .setVector(vector(\n 0.2 f,\n 0.1 f,\n 0.9 f,\n 0.7 f))\n .build()))\n .addAllContext(\n List.of(\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample\n .newBuilder()\n .setId(id(100)))\n .setNegative(VectorExample\n .newBuilder()\n .setId(id(718)))\n .build(),\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample\n .newBuilder()\n .setId(id(200)))\n .setNegative(VectorExample\n .newBuilder()\n .setId(id(300)))\n .build()))\n .setLimit(10)\n .build(),\n DiscoverPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setTarget(\n TargetVector.newBuilder()\n .setSingle(\n VectorExample.newBuilder()\n .setVector(vector(\n 0.5 f, 0.3 f, 0.2 f, 0.3 f))\n .build()))\n .addAllContext(\n List.of(\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample\n .newBuilder()\n .setId(id(342)))\n .setNegative(VectorExample\n .newBuilder()\n .setId(id(213)))\n .build(),\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample\n .newBuilder()\n .setId(id(100)))\n .setNegative(VectorExample\n .newBuilder()\n .setId(id(200)))\n .build()))\n .setLimit(10)\n .build());\nclient.discoverBatchAsync(\"{collection_name}\", discoverPoints, null);\n" language: java @@ -785,9 +785,6 @@ paths: - 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: "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: "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 @@ -795,11 +792,14 @@ paths: - 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: "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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.set_payload(\n collection_name=\"{collection_name}\",\n payload={\n \"property1\": \"string\",\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.setPayload(\"{collection_name}\", {\n payload: {\n property1: \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.ValueFactory.value;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .setPayloadAsync(\n \"{collection_name}\",\n Map.of(\"property1\", value(\"string\"), \"property2\", value(\"string\")),\n List.of(id(0), id(3), id(10)),\n true,\n null,\n null)\n .get();\n" language: java @@ -812,9 +812,6 @@ paths: - 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: "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: "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 @@ -822,11 +819,14 @@ paths: - 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: "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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.overwrite_payload(\n collection_name=\"{collection_name}\",\n payload={\n \"property1\": \"string\",\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.overwritePayload(\"{collection_name}\", {\n payload: {\n property1: \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.ValueFactory.value;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .overwritePayloadAsync(\n \"{collection_name}\",\n Map.of(\"property1\", value(\"string\"), \"property2\", value(\"string\")),\n List.of(id(0), id(3), id(10)),\n true,\n null,\n null)\n .get();\n" language: java @@ -840,6 +840,12 @@ paths: - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload/clear' \\\n --header 'Content-Type: application/json' \\\n --header 'api-key: ' \\\n --data-raw '{\n \"points\": [\n 0,\n 3,\n 100\n ]\n}'" language: curl + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc clearPayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.ClearPayload(context.Background(), &qdrant.ClearPayloadPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewID(\"3\"), qdrant.NewIDNum(100)),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go + - code-samples: + - code: "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: 'using Qdrant.Client; @@ -852,17 +858,11 @@ paths: ' language: csharp - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc clearPayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.ClearPayload(context.Background(), &qdrant.ClearPayloadPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewID(\"3\"), qdrant.NewIDNum(100)),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go - - code-samples: - - code: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.clear_payload(\n collection_name=\"{collection_name}\",\n points_selector=[0, 3, 100],\n)\n" + language: python - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.clearPayload(\"{collection_name}\", {\n points: [0, 3, 100],\n});\n" language: typescript - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.clear_payload(\n collection_name=\"{collection_name}\",\n points_selector=[0, 3, 100],\n)\n" - language: python - code-samples: - code: "import 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 @@ -876,6 +876,12 @@ paths: - code-samples: - code: "# Delete payload by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"keys\": [\n \"color\",\n \"price\"\n ],\n \"points\": [\n 0,\n 3,\n 100\n ]\n}'\n\n# Delete payload by filter\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"keys\": [\n \"color\",\n \"price\"\n ],\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n }\n}'" language: curl + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deletePayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.DeletePayload(context.Background(), &qdrant.DeletePayloadPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(100)),\n\t\tKeys: []string{\"color\", \"price\"},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go + - code-samples: + - code: "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: 'using Qdrant.Client; @@ -888,17 +894,11 @@ paths: ' language: csharp - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deletePayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.DeletePayload(context.Background(), &qdrant.DeletePayloadPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(100)),\n\t\tKeys: []string{\"color\", \"price\"},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go - - code-samples: - - code: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete_payload(\n collection_name=\"{collection_name}\",\n keys=[\"color\", \"price\"],\n points=[0, 3, 100],\n)\n" + language: python - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.deletePayload(\"{collection_name}\", {\n keys: [\"color\", \"price\"],\n points: [0, 3, 100],\n});\n" language: typescript - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete_payload(\n collection_name=\"{collection_name}\",\n keys=[\"color\", \"price\"],\n points=[0, 3, 100],\n)\n" - language: python - code-samples: - code: "import 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 @@ -912,9 +912,6 @@ paths: - 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: "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: "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 @@ -922,11 +919,14 @@ paths: - 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: "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: "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: "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-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: "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 @@ -940,9 +940,6 @@ paths: - 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: "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: "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 @@ -950,11 +947,14 @@ paths: - 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: "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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nnearest = client.query_batch_points(\n collection_name=\"{collection_name}\",\n requests=[\n models.QueryRequest(\n query=[0.01, 0.45, 0.67, ...],\n ),\n models.QueryRequest(\n query=[0.11, 0.35, 0.6, ...],\n ),\n ]\n)" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.queryBatch(\"{collection_name\", {\n searches: [{\n query: [0.01, 0.45, 0.67]\n },\n {\n query: [0.11, 0.35, 0.6]\n }]\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.QueryFactory.nearest;\n\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\nimport io.qdrant.client.grpc.Points.QueryPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .queryBatchAsync(\n \"{collection_name}\",\n List.of(\n QueryPoints.newBuilder().setQuery(nearest(0.1f, 0.2f, 0.3f)).build(),\n QueryPoints.newBuilder().setQuery(nearest(0.4f, 0.5f, 0.6f)).build()))\n .get();\n" language: java @@ -968,9 +968,6 @@ paths: - 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: "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: "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 @@ -978,11 +975,14 @@ paths: - 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: "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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.query_points_groups(\n collection_name=\"{collection_name}\",\n query=[0.01, 0.45, 0.67],\n group_by=\"document_id\",\n limit=10,\n group_size=5,\n)" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.queryGroups(\"{collection_name}\", {\n query: [0.01, 0.45, 0.67],\n group_by: \"document_id\",\n limit: 10,\n group_size: 5,\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.QueryFactory.nearest;\n\nimport io.qdrant.client.grpc.Points.QueryPointGroups;\nimport io.qdrant.client.grpc.Points.QueryPoints;\n\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .queryGroupsAsync(\n QueryPointGroups.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setGroupBy(\"document_id\")\n .setGroupSize(5)\n .setLimit(10)\n .setQuery(nearest(List.of(0.01f, 0.45f, 0.67f)))\n .build())\n .get();\n" language: java @@ -996,9 +996,6 @@ paths: - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"positive\": [\n 100,\n 231\n ],\n \"negative\": [\n \"3a6e2150-f7b7-496e-92cd-687e63e215fd\",\n [\n 0.2,\n 0.3,\n 0.4,\n 0.5\n ]\n ],\n \"filter\": {\n \"must\": [\n {\n \"key\": \"city\",\n \"match\": {\n \"value\": \"London\"\n }\n }\n ]\n },\n \"limit\": 1\n}'" language: curl - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendAsync(\n \"{collection_name}\",\n positive: new ulong[] { 100, 231 },\n negative: new ulong[] { 718 },\n filter: MatchKeyword(\"city\", \"London\"),\n limit: 3\n);\n" - language: csharp - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc recommend() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresults, err := client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(231)),\n\t\t\t},\n\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\t\t\t\tqdrant.NewVectorInput(0.2, 0.3, 0.4, 0.5),\n\t\t\t},\n\t\t\tStrategy: qdrant.RecommendStrategy_AverageVector.Enum(),\n\t\t}),\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"city\", \"London\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go @@ -1006,11 +1003,14 @@ paths: - code: "use qdrant_client::qdrant::{Condition, Filter, RecommendPointsBuilder, RecommendStrategy};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .recommend(\n RecommendPointsBuilder::new(\"{collection_name}\", 3)\n .add_positive(100)\n .add_positive(200)\n .add_positive(vec![100.0, 231.0])\n .add_negative(718)\n .add_negative(vec![0.2, 0.3, 0.4, 0.5])\n .strategy(RecommendStrategy::AverageVector)\n .filter(Filter::must([Condition::matches(\n \"city\",\n \"London\".to_string(),\n )])),\n )\n .await?;\n" language: rust - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.recommend(\"{collection_name}\", {\n positive: [100, 231],\n negative: [718, [0.2, 0.3, 0.4, 0.5]],\n strategy: \"average_vector\",\n filter: {\n must: [\n {\n key: \"city\",\n match: {\n value: \"London\",\n },\n },\n ],\n },\n limit: 3,\n});\n" - language: typescript + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendAsync(\n \"{collection_name}\",\n positive: new ulong[] { 100, 231 },\n negative: new ulong[] { 718 },\n filter: MatchKeyword(\"city\", \"London\"),\n limit: 3\n);\n" + language: csharp - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.recommend(\n collection_name=\"{collection_name}\",\n positive=[100, 231],\n negative=[718, [0.2, 0.3, 0.4, 0.5]],\n strategy=models.RecommendStrategy.AVERAGE_VECTOR,\n query_filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"city\",\n match=models.MatchValue(\n value=\"London\",\n ),\n )\n ]\n ),\n limit=3,\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.recommend(\"{collection_name}\", {\n positive: [100, 231],\n negative: [718, [0.2, 0.3, 0.4, 0.5]],\n strategy: \"average_vector\",\n filter: {\n must: [\n {\n key: \"city\",\n match: {\n value: \"London\",\n },\n },\n ],\n },\n limit: 3,\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\nimport static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Common.Filter;\nimport io.qdrant.client.grpc.Points.RecommendPoints;\nimport io.qdrant.client.grpc.Points.RecommendStrategy;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .recommendAsync(\n RecommendPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .addAllPositive(List.of(id(100), id(200)))\n .addAllPositiveVectors(List.of(vector(100.0f, 231.0f)))\n .addAllNegative(List.of(id(718)))\n .addAllPositiveVectors(List.of(vector(0.2f, 0.3f, 0.4f, 0.5f)))\n .setStrategy(RecommendStrategy.AverageVector)\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\")))\n .setLimit(3)\n .build())\n .get();\n" language: java @@ -1024,9 +1024,6 @@ paths: - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"positive\": [\n 100,\n 231\n ],\n \"negative\": [\n \"9ad0884a-7bfe-43c0-b88f-c1d9a588b7e1\"\n ],\n \"limit\": 1\n },\n {\n \"positive\": [\n 200,\n 67\n ],\n \"negative\": [\n 300\n ],\n \"limit\": 5\n }\n ]\n}'" language: curl - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter = MatchKeyword(\"city\", \"london\");\n\nawait client.RecommendBatchAsync(\n collectionName: \"{collection_name}\",\n recommendSearches:\n [\n new()\n {\n CollectionName = \"{collection_name}\",\n Positive = { new PointId[] { 100, 231 } },\n Negative = { new PointId[] { 718 } },\n Limit = 3,\n Filter = filter,\n },\n new()\n {\n CollectionName = \"{collection_name}\",\n Positive = { new PointId[] { 200, 67 } },\n Negative = { new PointId[] { 300 } },\n Limit = 3,\n Filter = filter,\n }\n ]\n);\n" - language: csharp - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc recommendBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresults, err := client.QueryBatch(context.Background(), &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\t\t\t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(231)),\n\t\t\t\t\t},\n\t\t\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\t\t\t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(67)),\n\t\t\t\t\t},\n\t\t\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(300)),\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go @@ -1034,11 +1031,14 @@ paths: - code: "use qdrant_client::qdrant::{\n Condition, Filter, RecommendBatchPointsBuilder, RecommendPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet filter = Filter::must([Condition::matches(\"city\", \"London\".to_string())]);\nlet recommend_queries = vec![\n RecommendPointsBuilder::new(\"{collection_name}\", 3)\n .add_positive(100)\n .add_positive(231)\n .add_negative(718)\n .filter(filter.clone())\n .build(),\n RecommendPointsBuilder::new(\"{collection_name}\", 3)\n .add_positive(200)\n .add_positive(67)\n .add_negative(300)\n .filter(filter.clone())\n .build(),\n];\n\nclient\n .recommend_batch(RecommendBatchPointsBuilder::new(\n \"{collection_name}\",\n recommend_queries,\n ))\n .await?;\n" language: rust - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nconst searches = [\n {\n positive: [100, 231],\n negative: [718],\n limit: 3,\n },\n {\n positive: [200, 67],\n negative: [300],\n limit: 3,\n },\n];\n\nclient.recommend_batch(\"{collection_name}\", {\n searches,\n});\n" - language: typescript + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter = MatchKeyword(\"city\", \"london\");\n\nawait client.RecommendBatchAsync(\n collectionName: \"{collection_name}\",\n recommendSearches:\n [\n new()\n {\n CollectionName = \"{collection_name}\",\n Positive = { new PointId[] { 100, 231 } },\n Negative = { new PointId[] { 718 } },\n Limit = 3,\n Filter = filter,\n },\n new()\n {\n CollectionName = \"{collection_name}\",\n Positive = { new PointId[] { 200, 67 } },\n Negative = { new PointId[] { 300 } },\n Limit = 3,\n Filter = filter,\n }\n ]\n);\n" + language: csharp - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nrecommend_queries = [\n models.RecommendRequest(\n positive=[100, 231], negative=[718], filter=filter_, limit=3\n ),\n models.RecommendRequest(positive=[200, 67], negative=[300], limit=3),\n]\n\nclient.recommend_batch(collection_name=\"{collection_name}\", requests=recommend_queries)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nconst searches = [\n {\n positive: [100, 231],\n negative: [718],\n limit: 3,\n },\n {\n positive: [200, 67],\n negative: [300],\n limit: 3,\n },\n];\n\nclient.recommend_batch(\"{collection_name}\", {\n searches,\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\nimport static io.qdrant.client.PointIdFactory.id;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Common.Filter;\nimport io.qdrant.client.grpc.Points.RecommendPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\")).build();\n\nList recommendQueries =\n List.of(\n RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(100), id(231)))\n .addAllNegative(List.of(id(718)))\n .setFilter(filter)\n .setLimit(3)\n .build(),\n RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(200), id(67)))\n .addAllNegative(List.of(id(300)))\n .setFilter(filter)\n .setLimit(3)\n .build());\n\nclient.recommendBatchAsync(\"{collection_name}\", recommendQueries, null).get();\n" language: java @@ -1052,9 +1052,6 @@ paths: - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend/groups' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"positive\": [\n 100,\n 231\n ],\n \"negative\": [\n 718\n ],\n \"group_by\": \"document_id\",\n \"limit\": 3,\n \"group_size\": 2\n}'" language: curl - - code-samples: - - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendGroupsAsync(\n \"{collection_name}\",\n \"document_id\",\n groupSize: 3,\n positive: new ulong[] { 100, 231 },\n negative: new ulong[] { 718 },\n filter: MatchKeyword(\"city\", \"London\"),\n limit: 3\n);\n" - language: csharp - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc recommendGroups() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tgroupSize := uint64(5)\n\tresults, err := client.QueryGroups(context.Background(), &qdrant.QueryPointGroups{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(231)),\n\t\t\t},\n\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\t\t\t},\n\t\t}),\n\t\tGroupBy: \"document_id\",\n\t\tGroupSize: &groupSize,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go @@ -1062,11 +1059,14 @@ paths: - code: "use qdrant_client::qdrant::{RecommendPointGroupsBuilder, RecommendStrategy};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .recommend_groups(\n RecommendPointGroupsBuilder::new(\"{collection_name}\", \"document_id\", 2, 3)\n .add_positive(100)\n .add_positive(200)\n .add_negative(718)\n .strategy(RecommendStrategy::AverageVector),\n )\n .await?;\n" language: rust - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.recommendPointGroups(\"{collection_name}\", {\n positive: [100, 231],\n negative: [718],\n group_by: \"document_id\",\n limit: 3,\n group_size: 2,\n});\n" - language: typescript + - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendGroupsAsync(\n \"{collection_name}\",\n \"document_id\",\n groupSize: 3,\n positive: new ulong[] { 100, 231 },\n negative: new ulong[] { 718 },\n filter: MatchKeyword(\"city\", \"London\"),\n limit: 3\n);\n" + language: csharp - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.recommend_groups(\n collection_name=\"{collection_name}\",\n positive=[100, 231],\n negative=[718],\n group_by=\"document_id\",\n limit=3,\n group_size=2,\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.recommendPointGroups(\"{collection_name}\", {\n positive: [100, 231],\n negative: [718],\n group_by: \"document_id\",\n limit: 3,\n group_size: 2,\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.RecommendPointGroups;\nimport io.qdrant.client.grpc.Points.RecommendStrategy;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.recommendGroupsAsync(RecommendPointGroups.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setGroupBy(\"document_id\")\n .setGroupSize(2)\n .addAllPositive(List.of(id(100), id(200)))\n .addAllNegative(List.of(id(718)))\n .setStrategy(RecommendStrategy.AverageVector)\n .setLimit(3)\n .build());\n" language: java @@ -1080,9 +1080,6 @@ paths: - 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: "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: "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 @@ -1090,11 +1087,14 @@ paths: - 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: "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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.scroll(\n collection_name=\"{collection_name}\",\n scroll_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n limit=1,\n with_payload=True,\n with_vectors=False,\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.scroll(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n limit: 1,\n with_payload: true,\n with_vector: false,\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\nimport static io.qdrant.client.WithPayloadSelectorFactory.enable;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.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 @@ -1116,9 +1116,6 @@ paths: - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"limit\": 1,\n \"filter\": {\n \"must\": [\n {\n \"key\": \"city\",\n \"match\": {\n \"value\": \"London\"\n }\n }\n ]\n }\n}'" language: curl - - code-samples: - - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchAsync(\n collectionName: \"{collection_name}\",\n vector: new float[] { 0.2f, 0.1f, 0.9f, 0.7f },\n filter: MatchKeyword(\"city\", \"London\"),\n limit: 3\n);\n" - language: csharp - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc search() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tlimit := uint64(3)\n\tresults, err := client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQuery(0.2, 0.1, 0.9, 0.7),\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"city\", \"London\"),\n\t\t\t},\n\t\t},\n\t\tLimit: &limit,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go @@ -1126,11 +1123,14 @@ paths: - code: "use qdrant_client::qdrant::{Condition, Filter, SearchParamsBuilder, SearchPointsBuilder};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .search_points(\n SearchPointsBuilder::new(\"{collection_name}\", vec![0.2, 0.1, 0.9, 0.7], 3)\n .filter(Filter::must([Condition::matches(\n \"city\",\n \"London\".to_string(),\n )]))\n .params(SearchParamsBuilder::default().hnsw_ef(128).exact(false)),\n )\n .await?;\n" language: rust - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.search(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"city\",\n match: {\n value: \"London\",\n },\n },\n ],\n },\n vector: [0.2, 0.1, 0.9, 0.7],\n limit: 3,\n});\n" - language: typescript + - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchAsync(\n collectionName: \"{collection_name}\",\n vector: new float[] { 0.2f, 0.1f, 0.9f, 0.7f },\n filter: MatchKeyword(\"city\", \"London\"),\n limit: 3\n);\n" + language: csharp - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.search(\n collection_name=\"{collection_name}\",\n query_filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"city\",\n match=models.MatchValue(\n value=\"London\",\n ),\n )\n ]\n ),\n query_vector=[0.2, 0.1, 0.9, 0.7],\n limit=3,\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.search(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"city\",\n match: {\n value: \"London\",\n },\n },\n ],\n },\n vector: [0.2, 0.1, 0.9, 0.7],\n limit: 3,\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Common.Filter;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .searchAsync(\n SearchPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\")).build())\n .addAllVector(List.of(0.2f, 0.1f, 0.9f, 0.7f))\n .setLimit(3)\n .build())\n .get();\n" language: java @@ -1143,10 +1143,7 @@ paths: x-fern-examples: - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"limit\": 3\n },\n {\n \"vector\": [\n 0.5,\n 0.3,\n 0.2,\n 0.3\n ],\n \"filter\": {\n \"must\": [\n {\n \"key\": \"city\",\n \"match\": {\n \"value\": \"London\"\n }\n }\n ]\n },\n \"limit\": 3\n }\n ]\n}'" - language: curl - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter = MatchKeyword(\"city\", \"London\");\n\nvar searches = new List\n{\n new()\n {\n Vector = { new float[] { 0.2f, 0.1f, 0.9f, 0.7f } },\n Filter = filter,\n Limit = 3\n },\n new()\n {\n Vector = { new float[] { 0.5f, 0.3f, 0.2f, 0.3f } },\n Filter = filter,\n Limit = 3\n }\n};\n\nawait client.SearchBatchAsync(collectionName: \"{collection_name}\", searches: searches);\n" - language: csharp + language: curl - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc searchBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfilter := qdrant.Filter{\n\t\tMust: []*qdrant.Condition{\n\t\t\tqdrant.NewMatch(\"city\", \"London\"),\n\t\t},\n\t}\n\tlimit := uint64(3)\n\tresults, err := client.QueryBatch(context.Background(), &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQuery(0.2, 0.1, 0.9, 0.7),\n\t\t\t\tLimit: &limit,\n\t\t\t\tFilter: &filter,\n\t\t\t},\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQuery(0.5, 0.3, 0.2, 0.3),\n\t\t\t\tLimit: &limit,\n\t\t\t\tFilter: &filter,\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go @@ -1154,11 +1151,14 @@ paths: - code: "use qdrant_client::qdrant::{\n Condition, Filter, SearchBatchPointsBuilder, SearchPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet filter = Filter::must([Condition::matches(\"city\", \"London\".to_string())]);\n\nlet searches = vec![\n SearchPointsBuilder::new(\"{collection_name}\", vec![0.2, 0.1, 0.9, 0.7], 3)\n .filter(filter.clone())\n .build(),\n SearchPointsBuilder::new(\"{collection_name}\", vec![0.5, 0.3, 0.2, 0.3], 3)\n .filter(filter.clone())\n .build(),\n];\n\nclient\n .search_batch_points(SearchBatchPointsBuilder::new(\"{collection_name}\", searches))\n .await?;\n" language: rust - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nconst filter = {\n must: [\n {\n key: \"city\",\n match: {\n value: \"London\",\n },\n },\n ],\n};\n\nconst searches = [\n {\n vector: [0.2, 0.1, 0.9, 0.7],\n filter,\n limit: 3,\n },\n {\n vector: [0.5, 0.3, 0.2, 0.3],\n filter,\n limit: 3,\n },\n];\n\nclient.searchBatch(\"{collection_name}\", {\n searches,\n});\n" - language: typescript + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter = MatchKeyword(\"city\", \"London\");\n\nvar searches = new List\n{\n new()\n {\n Vector = { new float[] { 0.2f, 0.1f, 0.9f, 0.7f } },\n Filter = filter,\n Limit = 3\n },\n new()\n {\n Vector = { new float[] { 0.5f, 0.3f, 0.2f, 0.3f } },\n Filter = filter,\n Limit = 3\n }\n};\n\nawait client.SearchBatchAsync(collectionName: \"{collection_name}\", searches: searches);\n" + language: csharp - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nfilter_ = models.Filter(\n must=[\n models.FieldCondition(\n key=\"city\",\n match=models.MatchValue(\n value=\"London\",\n ),\n )\n ]\n)\n\nsearch_queries = [\n models.SearchRequest(vector=[0.2, 0.1, 0.9, 0.7], filter=filter_, limit=3),\n models.SearchRequest(vector=[0.5, 0.3, 0.2, 0.3], filter=filter_, limit=3),\n]\n\nclient.search_batch(collection_name=\"{collection_name}\", requests=search_queries)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nconst filter = {\n must: [\n {\n key: \"city\",\n match: {\n value: \"London\",\n },\n },\n ],\n};\n\nconst searches = [\n {\n vector: [0.2, 0.1, 0.9, 0.7],\n filter,\n limit: 3,\n },\n {\n vector: [0.5, 0.3, 0.2, 0.3],\n filter,\n limit: 3,\n },\n];\n\nclient.searchBatch(\"{collection_name}\", {\n searches,\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Common.Filter;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\")).build();\nList searches =\n List.of(\n SearchPoints.newBuilder()\n .addAllVector(List.of(0.2f, 0.1f, 0.9f, 0.7f))\n .setFilter(filter)\n .setLimit(3)\n .build(),\n SearchPoints.newBuilder()\n .addAllVector(List.of(0.5f, 0.3f, 0.2f, 0.3f))\n .setFilter(filter)\n .setLimit(3)\n .build());\nclient.searchBatchAsync(\"{collection_name}\", searches, null).get();\n" language: java @@ -1172,9 +1172,6 @@ paths: - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search/groups' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"group_by\": \"document_id\",\n \"limit\": 4,\n \"group_size\": 2\n}'" language: curl - - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchGroupsAsync(\n collectionName: \"{collection_name}\",\n vector: new float[] { 1.1f },\n groupBy: \"document_id\",\n limit: 4,\n groupSize: 2\n);\n" - language: csharp - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc searchGroups() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tgroupSize := uint64(2)\n\tresults, err := client.QueryGroups(context.Background(), &qdrant.QueryPointGroups{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\tGroupBy: \"document_id\",\n\t\tGroupSize: &groupSize,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go @@ -1182,11 +1179,14 @@ paths: - code: "use qdrant_client::qdrant::SearchPointGroupsBuilder;\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .search_groups(SearchPointGroupsBuilder::new(\n \"{collection_name}\",\n vec![1.1],\n 4,\n \"document_id\",\n 2,\n ))\n .await?;\n" language: rust - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.searchPointGroups(\"{collection_name}\", {\n vector: [1.1],\n group_by: \"document_id\",\n limit: 4,\n group_size: 2,\n});\n" - language: typescript + - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchGroupsAsync(\n collectionName: \"{collection_name}\",\n vector: new float[] { 1.1f },\n groupBy: \"document_id\",\n limit: 4,\n groupSize: 2\n);\n" + language: csharp - code-samples: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.search_groups(\n collection_name=\"{collection_name}\",\n query_vector=[1.1],\n group_by=\"document_id\",\n limit=4,\n group_size=2,\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.searchPointGroups(\"{collection_name}\", {\n vector: [1.1],\n group_by: \"document_id\",\n limit: 4,\n group_size: 2,\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.SearchPointGroups;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .searchGroupsAsync(\n SearchPointGroups.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .addAllVector(List.of(1.1f))\n .setGroupBy(\"document_id\")\n .setLimit(4)\n .setGroupSize(2)\n .build())\n .get();\n" language: java @@ -1197,9 +1197,6 @@ paths: /collections/{collection_name}/points/search/matrix/offsets: post: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchMatrixOffsetsAsync(\n \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"),\n sample: 100,\n limit: 5\n);" - language: csharp - code-samples: - code: "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 @@ -1207,11 +1204,14 @@ paths: - 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: "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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.search_matrix_offsets(\n collection_name=\"{collection_name}\",\n sample=100,\n limit=5,\n query_filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"color\", match=models.MatchValue(value=\"red\")\n ),\n ]\n ),\n)" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.searchMatrixOffsets(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n sample: 100,\n limit: 5,\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\nimport io.qdrant.client.grpc.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 @@ -1222,9 +1222,6 @@ paths: /collections/{collection_name}/points/search/matrix/pairs: post: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchMatrixPairsAsync(\n \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"),\n sample: 100,\n limit: 5\n);" - language: csharp - code-samples: - code: "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 @@ -1232,11 +1229,14 @@ paths: - 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: "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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.search_matrix_pairs(\n collection_name=\"{collection_name}\",\n sample=100,\n limit=5,\n query_filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"color\", match=models.MatchValue(value=\"red\")\n ),\n ]\n ),\n)" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.searchMatrixPairs(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n sample: 100,\n limit: 5,\n});" + language: typescript - code-samples: - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\nimport io.qdrant.client.grpc.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 @@ -1250,9 +1250,6 @@ paths: - 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: "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: "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 @@ -1260,11 +1257,14 @@ paths: - 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: "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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.update_vectors(\n collection_name=\"{collection_name}\",\n points=[\n models.PointVectors(\n id=1,\n vector={\n \"image\": [0.1, 0.2, 0.3, 0.4],\n },\n ),\n models.PointVectors(\n id=2,\n vector={\n \"text\": [0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n ),\n ],\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.updateVectors(\"{collection_name}\", {\n points: [\n {\n id: 1,\n vector: {\n image: [0.1, 0.2, 0.3, 0.4],\n },\n },\n {\n id: 2,\n vector: {\n text: [0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n },\n ],\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .updateVectorsAsync(\n \"{collection_name}\",\n List.of(\n PointVectors.newBuilder()\n .setId(id(1))\n .setVectors(namedVectors(Map.of(\"image\", vector(List.of(0.1f, 0.2f, 0.3f, 0.4f)))))\n .build(),\n PointVectors.newBuilder()\n .setId(id(2))\n .setVectors(\n namedVectors(\n Map.of(\n \"text\", vector(List.of(0.9f, 0.8f, 0.7f, 0.6f, 0.5f, 0.4f, 0.3f, 0.2f)))))\n .build()))\n .get();\n" language: java @@ -1278,6 +1278,12 @@ paths: - code-samples: - code: "# Delete vectors by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/vectors/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"points\": [\n 0,\n 3,\n 10\n ],\n \"vectors\": [\n \"text\",\n \"image\"\n ]\n}'\n\n# Delete vectors by filter\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/vectors/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n },\n \"vectors\": [\n \"text\",\n \"image\"\n ]\n}'" language: curl + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteVectors() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.DeleteVectors(context.Background(), &qdrant.DeletePointVectors{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(100)),\n\t\tVectors: &qdrant.VectorsSelector{\n\t\t\tNames: []string{\"text\", \"image\"},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go + - code-samples: + - code: "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: 'using Qdrant.Client; @@ -1290,17 +1296,11 @@ paths: ' language: csharp - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteVectors() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.DeleteVectors(context.Background(), &qdrant.DeletePointVectors{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(100)),\n\t\tVectors: &qdrant.VectorsSelector{\n\t\t\tNames: []string{\"text\", \"image\"},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go - - code-samples: - - code: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete_vectors(\n collection_name=\"{collection_name}\",\n points=[0, 3, 100],\n vectors=[\"text\", \"image\"],\n)\n" + language: python - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.deleteVectors(\"{collection_name}\", {\n points: [0, 3, 10],\n vectors: [\"text\", \"image\"],\n});\n" language: typescript - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete_vectors(\n collection_name=\"{collection_name}\",\n points=[0, 3, 100],\n vectors=[\"text\", \"image\"],\n)\n" - language: python - code-samples: - code: "import 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 @@ -1314,9 +1314,6 @@ paths: - 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: "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: "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 @@ -1324,8 +1321,8 @@ paths: - 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: "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: "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: 'from qdrant_client import QdrantClient @@ -1337,6 +1334,9 @@ paths: ' language: python + - 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: "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 @@ -1350,9 +1350,6 @@ paths: - 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: "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: "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 @@ -1360,8 +1357,8 @@ paths: - 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: "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: "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: 'from qdrant_client import QdrantClient @@ -1373,6 +1370,9 @@ paths: ' language: python + - 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: "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 @@ -1386,17 +1386,6 @@ paths: - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/snapshots' \\\n --header 'api-key: '" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ListSnapshotsAsync("{collection_name}"); - -' - language: csharp - 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 @@ -1412,16 +1401,16 @@ paths: ' language: rust - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.listSnapshots("{collection_name}"); + await client.ListSnapshotsAsync("{collection_name}"); ' - language: typescript + language: csharp - code-samples: - code: 'from qdrant_client import QdrantClient @@ -1433,6 +1422,17 @@ paths: ' language: python + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.listSnapshots("{collection_name}"); + +' + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listSnapshotAsync(\"{collection_name}\").get();\n" language: java @@ -1445,17 +1445,6 @@ paths: - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/snapshots' \\\n --header 'api-key: '" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.CreateSnapshotAsync("{collection_name}"); - -' - language: csharp - 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 @@ -1471,16 +1460,16 @@ paths: ' language: rust - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.createSnapshot("{collection_name}"); + await client.CreateSnapshotAsync("{collection_name}"); ' - language: typescript + language: csharp - code-samples: - code: 'from qdrant_client import QdrantClient @@ -1492,6 +1481,17 @@ paths: ' language: python + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.createSnapshot("{collection_name}"); + +' + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createSnapshotAsync(\"{collection_name}\").get();\n" language: java @@ -1505,12 +1505,12 @@ paths: - code-samples: - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/snapshots/recover' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"location\": \"http://example.com/path/to/snapshot.shapshot\"\n}'" language: curl - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.recoverSnapshot(\"{collection_name}\", {\n location: \"http://example.com/path/to/snapshot.shapshot\",\n});\n" - language: typescript - code-samples: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.recover_snapshot(\n \"{collection_name}\",\n \"http://example.com/path/to/snapshot.shapshot\",\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.recoverSnapshot(\"{collection_name}\", {\n location: \"http://example.com/path/to/snapshot.shapshot\",\n});\n" + language: typescript description: Recovers local collection data from a snapshot. This will overwrite any collection data stored on the node. If the collection does not exist, it will be created. summary: Recover from a snapshot (collection) tags: @@ -1531,6 +1531,12 @@ paths: - 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: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteSnapshot(context.Background(), \"{collection_name}\", \"{snapshot_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go + - code-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: 'using Qdrant.Client; @@ -1543,11 +1549,8 @@ paths: ' language: csharp - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteSnapshot(context.Background(), \"{collection_name}\", \"{snapshot_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go - - code-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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete_snapshot(\n collection_name=\"{collection_name}\", snapshot_name=\"{snapshot_name}\"\n)\n" + language: python - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -1559,9 +1562,6 @@ paths: ' language: typescript - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete_snapshot(\n collection_name=\"{collection_name}\", snapshot_name=\"{snapshot_name}\"\n)\n" - language: python - code-samples: - code: "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 @@ -1580,17 +1580,6 @@ paths: - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/snapshots' \\\n --header 'api-key: '" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ListFullSnapshotsAsync(); - -' - language: csharp - 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 @@ -1606,16 +1595,16 @@ paths: ' language: rust - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.listFullSnapshots(); + await client.ListFullSnapshotsAsync(); ' - language: typescript + language: csharp - code-samples: - code: 'from qdrant_client import QdrantClient @@ -1627,6 +1616,17 @@ paths: ' language: python + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.listFullSnapshots(); + +' + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listFullSnapshotAsync().get();\n" language: java @@ -1639,17 +1639,6 @@ paths: - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/snapshots' \\\n --header 'api-key: '" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.CreateFullSnapshotAsync(); - -' - language: csharp - 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 @@ -1665,16 +1654,16 @@ paths: ' language: rust - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.createFullSnapshot(); + await client.CreateFullSnapshotAsync(); ' - language: typescript + language: csharp - code-samples: - code: 'from qdrant_client import QdrantClient @@ -1686,6 +1675,17 @@ paths: ' language: python + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.createFullSnapshot(); + +' + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createFullSnapshotAsync().get();\n" language: java @@ -1699,17 +1699,6 @@ paths: - code-samples: - code: "curl -X DELETE \\\n 'http://localhost:6333/snapshots/snapshot_name' \\\n --header 'api-key: '" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.DeleteFullSnapshotAsync("{snapshot_name}"); - -' - language: csharp - 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 @@ -1725,16 +1714,16 @@ paths: ' language: rust - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.deleteFullSnapshot("{snapshot_name}"); + await client.DeleteFullSnapshotAsync("{snapshot_name}"); ' - language: typescript + language: csharp - code-samples: - code: 'from qdrant_client import QdrantClient @@ -1746,6 +1735,17 @@ paths: ' language: python + - code-samples: + - 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: "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 diff --git a/fern/apis/v1.18.x/openapi-overrides.yml b/fern/apis/v1.18.x/openapi-overrides.yml index 868d535..e8fe3ca 100644 --- a/fern/apis/v1.18.x/openapi-overrides.yml +++ b/fern/apis/v1.18.x/openapi-overrides.yml @@ -21,17 +21,6 @@ paths: - code: "curl -X GET \\\n 'http://localhost:6333/aliases' \\\n --header\ \ 'api-key: '" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ListAliasesAsync(); - - ' - language: csharp - 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\ @@ -52,16 +41,16 @@ paths: ' language: rust - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.getAliases(); + await client.ListAliasesAsync(); ' - language: typescript + language: csharp - code-samples: - code: 'from qdrant_client import QdrantClient @@ -73,6 +62,17 @@ paths: ' language: python + - 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: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ @@ -109,17 +109,6 @@ paths: - code: "curl -X GET \\\n 'http://localhost:6333/collections' \\\n --header\ \ 'api-key: '" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ListCollectionsAsync(); - - ' - language: csharp - 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\ @@ -140,16 +129,16 @@ paths: ' language: rust - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.getCollections(); + await client.ListCollectionsAsync(); ' - language: typescript + language: csharp - code-samples: - code: 'from qdrant_client import QdrantClient @@ -161,6 +150,17 @@ paths: ' language: python + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.getCollections(); + + ' + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ @@ -190,21 +190,6 @@ paths: ,\n \"new_alias_name\": \"{new_alias_name}\"\n }\n }\n\ \ ]\n}'\n" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.CreateAliasAsync(aliasName: "production_collection", collectionName: - "example_collection"); - - - await client.DeleteAliasAsync("production_collection"); - - ' - language: csharp - code-samples: - code: "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\ @@ -225,14 +210,20 @@ paths: \ alias_name: \"production_collection\".to_string(),\n })\n .await?;\n" language: rust - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.updateCollectionAliases({\n actions: [\n {\n create_alias:\ - \ {\n collection_name: \"example_collection\",\n alias_name:\ - \ \"production_collection\",\n },\n },\n ],\n});\n\nclient.updateCollectionAliases({\n\ - \ actions: [\n {\n delete_alias: {\n alias_name: \"production_collection\"\ - ,\n },\n },\n ],\n});\n" - language: typescript + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.CreateAliasAsync(aliasName: "production_collection", collectionName: + "example_collection"); + + + await client.DeleteAliasAsync("production_collection"); + + ' + language: csharp - code-samples: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.update_collection_aliases(\n change_aliases_operations=[\n\ @@ -243,6 +234,15 @@ paths: \ delete_alias=models.DeleteAlias(alias_name=\"production_collection\"\ )\n ),\n ]\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.updateCollectionAliases({\n actions: [\n {\n create_alias:\ + \ {\n collection_name: \"example_collection\",\n alias_name:\ + \ \"production_collection\",\n },\n },\n ],\n});\n\nclient.updateCollectionAliases({\n\ + \ actions: [\n {\n delete_alias: {\n alias_name: \"production_collection\"\ + ,\n },\n },\n ],\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport\ \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -263,17 +263,6 @@ paths: - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name'\ \ \\\n --header 'api-key: '" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.DeleteCollectionAsync("{collection_name}"); - - ' - language: csharp - 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\ @@ -293,16 +282,16 @@ paths: ' language: rust - code-samples: - - code: 'import { QdrantClient } from ''@qdrant/qdrant-js''; + - code: 'using Qdrant.Client; - const client = new QdrantClient({url: ''http://127.0.0.1:6333''}); + var client = new QdrantClient("localhost", 6334); - client.deleteCollection("{collection_name}"); + await client.DeleteCollectionAsync("{collection_name}"); ' - language: typescript + language: csharp - code-samples: - code: 'from qdrant_client import QdrantClient @@ -314,6 +303,17 @@ paths: ' language: python + - code-samples: + - code: 'import { QdrantClient } from ''@qdrant/qdrant-js''; + + + const client = new QdrantClient({url: ''http://127.0.0.1:6333''}); + + + client.deleteCollection("{collection_name}"); + + ' + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ @@ -330,17 +330,6 @@ paths: - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name'\ \ \\\n --header 'api-key: '" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.GetCollectionInfoAsync("{collection_name}"); - - ' - language: csharp - 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\ @@ -361,16 +350,16 @@ paths: ' language: rust - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.getCollection("{collection_name}"); + await client.GetCollectionInfoAsync("{collection_name}"); ' - language: typescript + language: csharp - code-samples: - code: 'from qdrant_client import QdrantClient @@ -382,6 +371,17 @@ paths: ' language: python + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.getCollection("{collection_name}"); + + ' + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ @@ -400,12 +400,6 @@ paths: \ application/json' \\\n --data-raw '{\n \"optimizers_config\": {\n\ \ \"indexing_threshold\": 10000\n }\n}'" language: curl - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateCollectionAsync(\n\ - \ collectionName: \"{collection_name}\",\n optimizersConfig: new OptimizersConfigDiff\ - \ { IndexingThreshold = 10000 }\n);\n" - language: csharp - code-samples: - code: "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\ @@ -424,17 +418,23 @@ paths: \ ),\n )\n .await?;\n" language: rust - 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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.update_collection(\n collection_name=\"\ {collection_name}\",\n optimizer_config=models.OptimizersConfigDiff(indexing_threshold=10000),\n\ )\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.updateCollection(\"{collection_name}\", {\n optimizers_config:\ + \ {\n indexing_threshold: 10000,\n },\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport\ \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -465,16 +465,6 @@ paths: \ \"sparse_vectors\": {\n \"sparse-vector-name\": {\n \"index\"\ : {\n \"on_disk\": true\n }\n }\n }\n}'\n" language: curl - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.CreateCollectionAsync(\n\ - \tcollectionName: \"{collection_name}\",\n\tvectorsConfig: new VectorParams\ - \ { Size = 100, Distance = Distance.Cosine }\n);\n\n// Or with sparse\ - \ vectors\n\nawait client.CreateCollectionAsync(\n\tcollectionName: \"\ - {collection_name}\",\n\tsparseVectorsConfig: (\"splade-model-name\", new\ - \ SparseVectorParams{\n Index = new SparseIndexConfig {\n \ - \ OnDisk = false,\n }\n })\n);" - language: csharp - code-samples: - code: "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\ @@ -492,6 +482,22 @@ paths: {collection_name}\")\n .vectors_config(VectorParamsBuilder::new(100,\ \ Distance::Cosine)),\n )\n .await?;\n" language: rust + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nawait client.CreateCollectionAsync(\n\ + \tcollectionName: \"{collection_name}\",\n\tvectorsConfig: new VectorParams\ + \ { Size = 100, Distance = Distance.Cosine }\n);\n\n// Or with sparse\ + \ vectors\n\nawait client.CreateCollectionAsync(\n\tcollectionName: \"\ + {collection_name}\",\n\tsparseVectorsConfig: (\"splade-model-name\", new\ + \ SparseVectorParams{\n Index = new SparseIndexConfig {\n \ + \ OnDisk = false,\n }\n })\n);" + language: csharp + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.create_collection(\n collection_name=\"\ + {collection_name}\",\n vectors_config=models.VectorParams(size=100,\ + \ distance=models.Distance.COSINE),\n)\n" + language: python - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ @@ -501,12 +507,6 @@ paths: \ sparse_vectors: {\n \"splade-model-name\": {\n index: {\n \ \ on_disk: false\n }\n }\n }\n});" language: typescript - - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.create_collection(\n collection_name=\"\ - {collection_name}\",\n vectors_config=models.VectorParams(size=100,\ - \ distance=models.Distance.COSINE),\n)\n" - language: python - code-samples: - code: "import 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\ @@ -533,17 +533,6 @@ paths: - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/aliases'\ \ \\\n --header 'api-key: '" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ListCollectionAliasesAsync("{collection_name}"); - - ' - language: csharp - 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\ @@ -564,16 +553,16 @@ paths: ' language: rust - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.getCollectionAliases("{collection_name}"); + await client.ListCollectionAliasesAsync("{collection_name}"); ' - language: typescript + language: csharp - code-samples: - code: 'from qdrant_client import QdrantClient @@ -585,6 +574,17 @@ paths: ' language: python + - 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: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ @@ -613,17 +613,6 @@ paths: - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/exists'\ \ \\\n --header 'api-key: '" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.CollectionExistsAsync("{collection_name}"); - - ' - language: csharp - 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\ @@ -644,16 +633,16 @@ paths: ' language: rust - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.collectionExists("{collection_name}"); + await client.CollectionExistsAsync("{collection_name}"); ' - language: typescript + language: csharp - code-samples: - code: 'from qdrant_client import QdrantClient @@ -663,6 +652,17 @@ paths: client.collection_exists(collection_name="{collection_name}")' language: python + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.collectionExists("{collection_name}"); + + ' + language: typescript - code-samples: - code: 'import static io.qdrant.client.ConditionFactory.matchKeyword; @@ -687,12 +687,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.FacetAsync(\n\t\"\ - {collection_name}\",\n\tfilter: MatchKeyword(\"color\", \"red\"),\n\t\ - key: \"my-payload-key\",\n\tlimit: 10\n);" - language: csharp - code-samples: - code: "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\ @@ -714,6 +708,18 @@ paths: \ \"color\",\n \"red\".to_string(),\n \ \ )])),\n )\n .await?;" language: rust + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nawait client.FacetAsync(\n\t\"\ + {collection_name}\",\n\tfilter: MatchKeyword(\"color\", \"red\"),\n\t\ + key: \"my-payload-key\",\n\tlimit: 10\n);" + language: csharp + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.facet(\n collection_name=\"{collection_name}\"\ + ,\n key=\"my-payload-key\",\n facet_filter=models.Filter(must=[models.Match(\"\ + color\", \"red\")]),\n limit=10,\n)\n\n" + language: python - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ @@ -723,12 +729,6 @@ paths: \ },\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-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nimport static io.qdrant.client.ConditionFactory.matchKeyword;\nimport\ @@ -754,11 +754,6 @@ paths: \ application/json' \\\n --data-raw '{\n \"field_name\": \"field_name\"\ ,\n \"field_schema\": \"keyword\"\n}'" language: curl - - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\"\ - , 6334);\n\nawait client.CreatePayloadIndexAsync(\n collectionName: \"\ - {collection_name}\",\n fieldName: \"name_of_the_field_to_index\"\n);\n" - language: csharp - code-samples: - code: "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\ @@ -777,17 +772,22 @@ paths: \ FieldType::Keyword,\n ),\n )\n .await?;\n" language: rust - 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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.create_payload_index(\n collection_name=\"\ {collection_name}\",\n field_name=\"name_of_the_field_to_index\",\n\ \ field_schema=\"keyword\",\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.createPayloadIndex(\"{collection_name}\", {\n field_name: \"{field_name}\"\ + ,\n field_schema: \"keyword\",\n});\n" + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nimport io.qdrant.client.grpc.Collections.PayloadSchemaType;\n\nQdrantClient\ @@ -808,11 +808,6 @@ paths: - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/index/field_name'\ \ \\\n --header 'api-key: '" language: curl - - 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: "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\ @@ -830,27 +825,32 @@ paths: \ .await?;\n" language: rust - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - 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: 'from qdrant_client import QdrantClient - const client = new QdrantClient({ host: "localhost", port: 6333 }); + client = QdrantClient(url="http://localhost:6333") - client.deletePayloadIndex("{collection_name}", "{field_name}"); + client.delete_payload_index("{collection_name}", "{field_name}"); ' - language: typescript + language: python - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.delete_payload_index("{collection_name}", "{field_name}"); + client.deletePayloadIndex("{collection_name}", "{field_name}"); ' - language: python + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ @@ -870,12 +870,6 @@ paths: \ application/json' \\\n --data-raw '{\n \"ids\": [\n 0,\n 3,\n\ \ 100\n ]\n}'" language: curl - - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\"\ - , 6334);\n\nawait client.RetrieveAsync(\n collectionName: \"{collection_name}\"\ - ,\n ids: [0, 30, 100],\n withPayload: false,\n withVectors: false\n\ - );\n" - language: csharp - code-samples: - code: "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\ @@ -893,15 +887,21 @@ paths: ,\n vec![0.into(), 30.into(), 100.into()],\n ))\n .await?;\n" language: rust - 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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.retrieve(\n collection_name=\"{collection_name}\"\ ,\n ids=[0, 3, 100],\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.retrieve(\"{collection_name}\", {\n ids: [0, 3, 100],\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\ \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -929,17 +929,6 @@ paths: : \"blue\"\n },\n \"vector\": [\n 0.1,\n 0.1,\n\ \ 0.9\n ]\n }\n ]\n}'" language: curl - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.UpsertAsync(\n collectionName:\ - \ \"{collection_name}\",\n points: new List\n {\n new()\n\ - \ {\n Id = 1,\n Vectors = new[] { 0.9f, 0.1f, 0.1f },\n \ - \ Payload = { [\"city\"] = \"red\" }\n },\n new()\n {\n \ - \ Id = 2,\n Vectors = new[] { 0.1f, 0.9f, 0.1f },\n Payload\ - \ = { [\"city\"] = \"green\" }\n },\n new()\n {\n Id = 3,\n\ - \ Vectors = new[] { 0.1f, 0.1f, 0.9f },\n Payload = { [\"city\"\ - ] = \"blue\" }\n }\n }\n);\n" - language: csharp - code-samples: - code: "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\ @@ -979,15 +968,16 @@ paths: \ .await?;\n" language: rust - 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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.upsert(\n collection_name=\"{collection_name}\"\ @@ -1000,6 +990,16 @@ paths: \ payload={\n \"color\": \"blue\",\n },\n \ \ vector=[0.1, 0.1, 0.9],\n ),\n ],\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.upsert(\"{collection_name}\", {\n points: [\n {\n id:\ + \ 1,\n payload: { color: \"red\" },\n vector: [0.9, 0.1, 0.1],\n\ + \ },\n {\n id: 2,\n payload: { color: \"green\" },\n \ + \ vector: [0.1, 0.9, 0.1],\n },\n {\n id: 3,\n payload:\ + \ { color: \"blue\" },\n vector: [0.1, 0.1, 0.9],\n },\n ],\n\ + });\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ \ io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\ @@ -1044,22 +1044,6 @@ paths: \ },\n \"points\": [\n 1\n ]\n }\n\ \ }\n ]\n}'" language: curl - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateBatchAsync(\n\ - \ \"{collection_name}\",\n [\n new()\n {\n \ - \ Upsert = new()\n {\n Points =\n \ - \ {\n new PointStruct { Id = 1, Vectors =\ - \ new[] { 0.9f, 0.1f, 0.1f } },\n }\n }\n \ - \ },\n new()\n {\n UpdateVectors = new()\n\ - \ {\n Points =\n {\n \ - \ new PointVectors { Id = 1, Vectors = new[] { 0.9f, 0.1f,\ - \ 0.1f } },\n }\n }\n },\n new()\n\ - \ {\n SetPayload = new()\n {\n \ - \ PointsSelector = new PointsSelector { Points = new PointsIdsList\ - \ { Ids = { 1 } } },\n Payload = { [\"test_payload_2\"\ - ] = 2, [\"test_payload_3\"] = 3 }\n }\n }\n ]\n);\n" - language: csharp - code-samples: - code: "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\ @@ -1111,21 +1095,21 @@ paths: \ .wait(true),\n )\n .await?;\n" language: rust - 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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.batch_update_points(\n collection_name=\"\ @@ -1144,6 +1128,22 @@ paths: : 3,\n },\n points=[1],\n )\n\ \ ),\n ],\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.batchUpdate(\"{collection_name}\", {\n operations: [\n \ + \ {\n upsert: {\n points: [\n \ + \ {\n id: 1,\n vector:\ + \ [1.0, 2.0, 3.0, 4.0],\n payload: {},\n \ + \ },\n ],\n },\n },\n \ + \ {\n update_vectors: {\n points: [\n \ + \ {\n id: 1,\n \ + \ vector: [1.0, 2.0, 3.0, 4.0],\n },\n \ + \ ],\n },\n },\n {\n set_payload:\ + \ {\n payload: {\n test_payload_2: 2,\n\ + \ test_payload_3: 3,\n },\n \ + \ points: [1],\n },\n },\n ],\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\nimport java.util.Map;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ import static io.qdrant.client.ValueFactory.value;\nimport static io.qdrant.client.VectorsFactory.vectors;\n\ @@ -1198,12 +1198,6 @@ paths: \ \"value\": \"red\"\n }\n }\n ]\n },\n \"exact\"\ : true\n}'" language: curl - - code-samples: - - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\ - \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.CountAsync(\n\ - \ collectionName: \"{collection_name}\",\n filter: MatchKeyword(\"color\"\ - , \"red\"),\n exact: true\n);\n" - language: csharp - code-samples: - code: "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\ @@ -1223,13 +1217,11 @@ paths: \ )]))\n .exact(true),\n )\n .await?;\n" language: rust - 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: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.count(\n collection_name=\"{collection_name}\"\ @@ -1237,6 +1229,14 @@ paths: color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n\ \ exact=True,\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.count(\"{collection_name}\", {\n filter: {\n must: [\n\ + \ {\n key: \"color\",\n match:\ + \ {\n value: \"red\",\n },\n \ + \ },\n ],\n },\n exact: true,\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -1263,22 +1263,6 @@ paths: : [\n {\n \"key\": \"color\",\n \"match\": {\n \ \ \"value\": \"red\"\n }\n }\n ]\n }\n}'\n" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.DeleteAsync(collectionName: "{collection_name}", ids: [0, - 3, 100]); - - - await client.DeleteAsync(collectionName: "{collection_name}", filter: - MatchKeyword("color", "red")); - - ' - language: csharp - code-samples: - code: "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\ @@ -1305,14 +1289,21 @@ paths: \ .wait(true),\n )\n .await?;\n" language: rust - 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: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.DeleteAsync(collectionName: "{collection_name}", ids: [0, + 3, 100]); + + + await client.DeleteAsync(collectionName: "{collection_name}", filter: + MatchKeyword("color", "red")); + + ' + language: csharp - code-samples: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.delete(\n collection_name=\"{collection_name}\"\ @@ -1323,6 +1314,15 @@ paths: \ key=\"color\",\n match=models.MatchValue(value=\"\ red\"),\n ),\n ],\n )\n ),\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.delete(\"{collection_name}\", {\n points: [0, 3, 100],\n});\n\n\ + client.delete(\"{collection_name}\", {\n filter: {\n must: [\n\ + \ {\n key: \"color\",\n match:\ + \ {\n value: \"red\",\n },\n \ + \ },\n ],\n },\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ \ io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport java.util.List;\n\ @@ -1364,17 +1364,6 @@ paths: : \"7f6652c4-89bd-40e0-ab1d-510f7fcddd2b\",\n \"negative\": \"2c2c9f86-0171-4bd2-9ab0-b4754682cddd\"\ \n }\n ],\n \"limit\": 10\n}'" language: curl - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.DiscoverAsync(\n\ - \ collectionName: \"{collection_name}\",\n target: new TargetVector\n\ - \ {\n Single = new VectorExample { Vector = new float[] { 0.2f, 0.1f,\ - \ 0.9f, 0.7f }, }\n },\n context:\n [\n new()\n {\n Positive\ - \ = new VectorExample { Id = 100 },\n Negative = new VectorExample\ - \ { Id = 718 }\n },\n new()\n {\n Positive = new VectorExample\ - \ { Id = 200 },\n Negative = new VectorExample { Id = 300 }\n \ - \ }\n ],\n limit: 10\n);\n" - language: csharp - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc discover() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -1406,13 +1395,16 @@ paths: \ })),\n )\n .await?;\n" language: rust - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.discover(\"{collection_name}\", {\n target: [0.2, 0.1, 0.9,\ - \ 0.7],\n context: [\n {\n positive: 100,\n \ - \ negative: 718,\n },\n {\n positive: 200,\n\ - \ negative: 300,\n },\n ],\n limit: 10,\n});\n" - language: typescript + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nawait client.DiscoverAsync(\n\ + \ collectionName: \"{collection_name}\",\n target: new TargetVector\n\ + \ {\n Single = new VectorExample { Vector = new float[] { 0.2f, 0.1f,\ + \ 0.9f, 0.7f }, }\n },\n context:\n [\n new()\n {\n Positive\ + \ = new VectorExample { Id = 100 },\n Negative = new VectorExample\ + \ { Id = 718 }\n },\n new()\n {\n Positive = new VectorExample\ + \ { Id = 200 },\n Negative = new VectorExample { Id = 300 }\n \ + \ }\n ],\n limit: 10\n);\n" + language: csharp - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.discover(\n \"{collection_name}\"\ @@ -1420,6 +1412,14 @@ paths: \ negative=718),\n models.ContextExamplePair(positive=200, negative=300),\n\ \ ],\n limit=10,\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.discover(\"{collection_name}\", {\n target: [0.2, 0.1, 0.9,\ + \ 0.7],\n context: [\n {\n positive: 100,\n \ + \ negative: 718,\n },\n {\n positive: 200,\n\ + \ negative: 300,\n },\n ],\n limit: 10,\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ import static io.qdrant.client.VectorFactory.vector;\n\nimport io.qdrant.client.QdrantClient;\n\ @@ -1463,30 +1463,6 @@ paths: \ {\n \"positive\": 342,\n \"negative\": 213\n\ \ }\n ],\n \"limit\": 1\n }\n ]\n}'" language: curl - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nvar discoverPoints = new List\n\ - {\n new DiscoverPoints\n {\n CollectionName = \"{collection_name}\"\ - ,\n Target = new TargetVector\n {\n Single =\ - \ new VectorExample { Vector = new float[] { 0.2f, 0.1f, 0.9f, 0.7f },\ - \ }\n },\n Context =\n {\n new ContextExamplePair()\n\ - \ {\n Positive = new VectorExample { Id = 100\ - \ },\n Negative = new VectorExample { Id = 718 }\n \ - \ },\n new ContextExamplePair()\n {\n \ - \ Positive = new VectorExample { Id = 200 },\n \ - \ Negative = new VectorExample { Id = 300 }\n }\n \ - \ },\n Limit = 10\n },\n new DiscoverPoints\n {\n \ - \ CollectionName = \"{collection_name}\",\n Target = new TargetVector\n\ - \ {\n Single = new VectorExample { Vector = new float[]\ - \ { 0.5f, 0.3f, 0.2f, 0.3f }, }\n },\n Context =\n \ - \ {\n new ContextExamplePair()\n {\n \ - \ Positive = new VectorExample { Id = 342 },\n Negative\ - \ = new VectorExample { Id = 213 }\n },\n new ContextExamplePair()\n\ - \ {\n Positive = new VectorExample { Id = 100\ - \ },\n Negative = new VectorExample { Id = 200 }\n \ - \ }\n },\n Limit = 10\n }\n};\nawait client.DiscoverBatchAsync(\"\ - {collection_name}\", discoverPoints);\n" - language: csharp - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc discoverBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -1535,19 +1511,29 @@ paths: \ )\n .build(),\n ],\n);\n\nclient.discover_batch(&discover_points.build()).await?;\n" language: rust - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - const searches = [\n {\n target: [0.2, 0.1, 0.9, 0.7],\n \ - \ context: [\n {\n positive: 100,\n \ - \ negative: 718,\n },\n {\n \ - \ positive: 200,\n negative: 300,\n },\n\ - \ ],\n limit: 10,\n },\n {\n target: [0.5,\ - \ 0.3, 0.2, 0.3],\n context: [\n {\n \ - \ positive: 342,\n negative: 213,\n },\n \ - \ {\n positive: 100,\n negative:\ - \ 200,\n },\n ],\n limit: 5,\n },\n];\n\n\ - client.discoverBatchPoints(\"{collection_name}\", {\n searches,\n});\n" - language: typescript + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nvar discoverPoints = new List\n\ + {\n new DiscoverPoints\n {\n CollectionName = \"{collection_name}\"\ + ,\n Target = new TargetVector\n {\n Single =\ + \ new VectorExample { Vector = new float[] { 0.2f, 0.1f, 0.9f, 0.7f },\ + \ }\n },\n Context =\n {\n new ContextExamplePair()\n\ + \ {\n Positive = new VectorExample { Id = 100\ + \ },\n Negative = new VectorExample { Id = 718 }\n \ + \ },\n new ContextExamplePair()\n {\n \ + \ Positive = new VectorExample { Id = 200 },\n \ + \ Negative = new VectorExample { Id = 300 }\n }\n \ + \ },\n Limit = 10\n },\n new DiscoverPoints\n {\n \ + \ CollectionName = \"{collection_name}\",\n Target = new TargetVector\n\ + \ {\n Single = new VectorExample { Vector = new float[]\ + \ { 0.5f, 0.3f, 0.2f, 0.3f }, }\n },\n Context =\n \ + \ {\n new ContextExamplePair()\n {\n \ + \ Positive = new VectorExample { Id = 342 },\n Negative\ + \ = new VectorExample { Id = 213 }\n },\n new ContextExamplePair()\n\ + \ {\n Positive = new VectorExample { Id = 100\ + \ },\n Negative = new VectorExample { Id = 200 }\n \ + \ }\n },\n Limit = 10\n }\n};\nawait client.DiscoverBatchAsync(\"\ + {collection_name}\", discoverPoints);\n" + language: csharp - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\ndiscover_queries = [\n models.DiscoverRequest(\n\ @@ -1563,6 +1549,20 @@ paths: \ ),\n ],\n limit=5,\n ),\n]\n\nclient.discover_batch(\"\ {collection_name}\", discover_queries)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + const searches = [\n {\n target: [0.2, 0.1, 0.9, 0.7],\n \ + \ context: [\n {\n positive: 100,\n \ + \ negative: 718,\n },\n {\n \ + \ positive: 200,\n negative: 300,\n },\n\ + \ ],\n limit: 10,\n },\n {\n target: [0.5,\ + \ 0.3, 0.2, 0.3],\n context: [\n {\n \ + \ positive: 342,\n negative: 213,\n },\n \ + \ {\n positive: 100,\n negative:\ + \ 200,\n },\n ],\n limit: 5,\n },\n];\n\n\ + client.discoverBatchPoints(\"{collection_name}\", {\n searches,\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ \ io.qdrant.client.VectorFactory.vector;\n\nimport java.util.Arrays;\n\ @@ -1622,13 +1622,6 @@ paths: : {\n \"property1\": \"some_value\",\n \"property2\": 32,\n \"\ property3\": true\n }\n}'" language: curl - - 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: "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\ @@ -1653,12 +1646,12 @@ paths: \ )\n .await?;\n" language: rust - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.setPayload(\"{collection_name}\", {\n payload: {\n property1:\ - \ \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n\ - });\n" - language: typescript + - code: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.set_payload(\n collection_name=\"\ @@ -1666,6 +1659,13 @@ paths: ,\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n\ )\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.setPayload(\"{collection_name}\", {\n payload: {\n property1:\ + \ \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n\ + });\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ \ io.qdrant.client.ValueFactory.value;\n\nimport java.util.List;\nimport\ @@ -1695,13 +1695,6 @@ paths: \ \"must\": [\n {\n \"key\": \"color\",\n \"match\"\ : {\n \"value\": \"red\"\n }\n }\n ]\n }\n}'" language: curl - - 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: "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\ @@ -1725,12 +1718,12 @@ paths: \ }))\n .wait(true),\n )\n .await?;\n" language: rust - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.overwritePayload(\"{collection_name}\", {\n payload: {\n property1:\ - \ \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n\ - });\n" - language: typescript + - code: "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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.overwrite_payload(\n collection_name=\"\ @@ -1738,6 +1731,13 @@ paths: ,\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n\ )\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.overwritePayload(\"{collection_name}\", {\n payload: {\n property1:\ + \ \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n\ + });\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ import static io.qdrant.client.ValueFactory.value;\n\nimport io.qdrant.client.QdrantClient;\n\ @@ -1761,17 +1761,6 @@ paths: \ ' \\\n --data-raw '{\n \"points\": [\n 0,\n 3,\n\ \ 100\n ]\n}'" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ClearPayloadAsync("{collection_name}", [0, 3, 10]); - - ' - language: csharp - code-samples: - code: "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\ @@ -1790,16 +1779,27 @@ paths: \ vec![0.into(), 3.into(), 100.into()],\n },\n ))\n .await?;\n" language: rust - 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: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ClearPayloadAsync("{collection_name}", [0, 3, 10]); + + ' + language: csharp - code-samples: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.clear_payload(\n collection_name=\"\ {collection_name}\",\n points_selector=[0, 3, 100],\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.clearPayload(\"{collection_name}\", {\n points: [0, 3, 100],\n\ + });\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -1826,18 +1826,6 @@ paths: \ \"key\": \"color\",\n \"match\": {\n \"value\"\ : \"red\"\n }\n }\n ]\n }\n}'" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.DeletePayloadAsync("{collection_name}", ["color", "price"], - [0, 3, 10]); - - ' - language: csharp - code-samples: - code: "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\ @@ -1858,17 +1846,29 @@ paths: \ .wait(true),\n )\n .await?;\n" language: rust - 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: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.DeletePayloadAsync("{collection_name}", ["color", "price"], + [0, 3, 10]); + + ' + language: csharp - code-samples: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.delete_payload(\n collection_name=\"\ {collection_name}\",\n keys=[\"color\", \"price\"],\n points=[0,\ \ 3, 100],\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.deletePayload(\"{collection_name}\", {\n keys: [\"color\", \"\ + price\"],\n points: [0, 3, 100],\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -1923,70 +1923,27 @@ paths: \ (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: "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\n\ - await client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\t\ - prefetch: 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\t\ - limit: 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)\n\ - await client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\t\ - prefetch:\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\t\ - Expression = 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 + \ \"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: "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\ @@ -2104,44 +2061,48 @@ paths: \ .await?;\n" language: rust - 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: "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\n\ + await client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\t\ + prefetch: 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\t\ + limit: 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)\n\ + await client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\t\ + prefetch:\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\t\ + Expression = 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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\n# Query nearest by ID\nnearest = client.query_points(\n\ @@ -2189,6 +2150,45 @@ paths: \ )\n ]),\n defaults={\"geo.location\": models.GeoPoint(lat=48.137154,\ \ lon=11.576124)} # Munich\n )\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + // 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: "import static io.qdrant.client.QueryFactory.fusion;\nimport static\ \ io.qdrant.client.QueryFactory.nearest;\nimport static io.qdrant.client.QueryFactory.recommend;\n\ @@ -2305,13 +2305,6 @@ paths: \ 0.423,\n 0.23,\n 0.623\n ],\n \"limit\": 5,\n\ \ \"using\": \"image-vector\"\n }\n ]\n}'" language: curl - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.QueryBatchAsync(\n\ - \tcollectionName: \"{collection_name}\",\n\tqueries: new List\n\ - \t{\n\t\tnew() { Query = new float[] { 0.1f, 0.2f, 0.3f }, },\n\t\tnew()\ - \ { Query = new float[] { 0.4f, 0.5f, 0.6f }, }\n\t}\n);\n" - language: csharp - code-samples: - code: "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\ @@ -2335,12 +2328,12 @@ paths: \ client.query_batch(request).await?;" language: rust - 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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nnearest = client.query_batch_points(\n \ @@ -2348,6 +2341,13 @@ paths: \ query=[0.01, 0.45, 0.67, ...],\n ),\n models.QueryRequest(\n\ \ query=[0.11, 0.35, 0.6, ...],\n ),\n ]\n)" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.queryBatch(\"{collection_name\", {\n searches: [{\n query:\ + \ [0.01, 0.45, 0.67]\n },\n {\n query: [0.11, 0.35, 0.6]\n\ + \ }]\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.QueryFactory.nearest;\n\nimport java.util.List;\n\ \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -2374,12 +2374,6 @@ paths: \ 0.643,\n 0.423\n ],\n \"group_by\": \"document_id\",\n \"limit\"\ : 1,\n \"group_size\": 5\n}'" language: curl - - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\"\ - , 6334);\n\nawait client.QueryGroupsAsync(\n collectionName: \"{collection_name}\"\ - ,\n groupBy: \"document_id\",\n groupSize: 5,\n limit: 10,\n query:\ - \ new float[] {\n 0.01f, 0.45f, 0.67f\n }\n);\n" - language: csharp - code-samples: - code: "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\ @@ -2399,18 +2393,24 @@ paths: \ .limit(10u64)\n .group_size(5u64)\n).await?;\n" language: rust - 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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.query_points_groups(\n collection_name=\"\ {collection_name}\",\n query=[0.01, 0.45, 0.67],\n group_by=\"document_id\"\ ,\n limit=10,\n group_size=5,\n)" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.queryGroups(\"{collection_name}\", {\n query: [0.01, 0.45, 0.67],\n\ + \ group_by: \"document_id\",\n limit: 10,\n group_size: 5,\n\ + });\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.QueryFactory.nearest;\n\ \nimport io.qdrant.client.grpc.Points.QueryPointGroups;\nimport io.qdrant.client.grpc.Points.QueryPoints;\n\ @@ -2439,13 +2439,6 @@ paths: ,\n \"match\": {\n \"value\": \"London\"\n }\n\ \ }\n ]\n },\n \"limit\": 1\n}'" language: curl - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\ - \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendAsync(\n\ - \ \"{collection_name}\",\n positive: new ulong[] { 100, 231 },\n\ - \ negative: new ulong[] { 718 },\n filter: MatchKeyword(\"city\"\ - , \"London\"),\n limit: 3\n);\n" - language: csharp - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc recommend() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2475,15 +2468,12 @@ paths: \ )\n .await?;\n" language: rust - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.recommend(\"{collection_name}\", {\n positive: [100, 231],\n\ - \ negative: [718, [0.2, 0.3, 0.4, 0.5]],\n strategy: \"average_vector\"\ - ,\n filter: {\n must: [\n {\n key:\ - \ \"city\",\n match: {\n value: \"London\"\ - ,\n },\n },\n ],\n },\n limit:\ - \ 3,\n});\n" - language: typescript + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\ + \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendAsync(\n\ + \ \"{collection_name}\",\n positive: new ulong[] { 100, 231 },\n\ + \ negative: new ulong[] { 718 },\n filter: MatchKeyword(\"city\"\ + , \"London\"),\n limit: 3\n);\n" + language: csharp - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.recommend(\n collection_name=\"\ @@ -2494,6 +2484,16 @@ paths: \ value=\"London\",\n ),\n \ \ )\n ]\n ),\n limit=3,\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.recommend(\"{collection_name}\", {\n positive: [100, 231],\n\ + \ negative: [718, [0.2, 0.3, 0.4, 0.5]],\n strategy: \"average_vector\"\ + ,\n filter: {\n must: [\n {\n key:\ + \ \"city\",\n match: {\n value: \"London\"\ + ,\n },\n },\n ],\n },\n limit:\ + \ 3,\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\ @@ -2528,19 +2528,6 @@ paths: \ 67\n ],\n \"negative\": [\n 300\n ],\n\ \ \"limit\": 5\n }\n ]\n}'" language: curl - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\ - \nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter =\ - \ MatchKeyword(\"city\", \"london\");\n\nawait client.RecommendBatchAsync(\n\ - \ collectionName: \"{collection_name}\",\n recommendSearches:\n [\n\ - \ new()\n {\n CollectionName = \"{collection_name}\",\n \ - \ Positive = { new PointId[] { 100, 231 } },\n Negative = { new\ - \ PointId[] { 718 } },\n Limit = 3,\n Filter = filter,\n \ - \ },\n new()\n {\n CollectionName = \"{collection_name}\",\n\ - \ Positive = { new PointId[] { 200, 67 } },\n Negative = { new\ - \ PointId[] { 300 } },\n Limit = 3,\n Filter = filter,\n \ - \ }\n ]\n);\n" - language: csharp - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc recommendBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2575,13 +2562,18 @@ paths: \ .await?;\n" language: rust - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - const searches = [\n {\n positive: [100, 231],\n negative:\ - \ [718],\n limit: 3,\n },\n {\n positive: [200, 67],\n\ - \ negative: [300],\n limit: 3,\n },\n];\n\nclient.recommend_batch(\"\ - {collection_name}\", {\n searches,\n});\n" - language: typescript + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\ + \nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter =\ + \ MatchKeyword(\"city\", \"london\");\n\nawait client.RecommendBatchAsync(\n\ + \ collectionName: \"{collection_name}\",\n recommendSearches:\n [\n\ + \ new()\n {\n CollectionName = \"{collection_name}\",\n \ + \ Positive = { new PointId[] { 100, 231 } },\n Negative = { new\ + \ PointId[] { 718 } },\n Limit = 3,\n Filter = filter,\n \ + \ },\n new()\n {\n CollectionName = \"{collection_name}\",\n\ + \ Positive = { new PointId[] { 200, 67 } },\n Negative = { new\ + \ PointId[] { 300 } },\n Limit = 3,\n Filter = filter,\n \ + \ }\n ]\n);\n" + language: csharp - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nrecommend_queries = [\n models.RecommendRequest(\n\ @@ -2590,6 +2582,14 @@ paths: \ limit=3),\n]\n\nclient.recommend_batch(collection_name=\"{collection_name}\"\ , requests=recommend_queries)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + const searches = [\n {\n positive: [100, 231],\n negative:\ + \ [718],\n limit: 3,\n },\n {\n positive: [200, 67],\n\ + \ negative: [300],\n limit: 3,\n },\n];\n\nclient.recommend_batch(\"\ + {collection_name}\", {\n searches,\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ import static io.qdrant.client.PointIdFactory.id;\n\nimport io.qdrant.client.QdrantClient;\n\ @@ -2623,14 +2623,6 @@ paths: \ 231\n ],\n \"negative\": [\n 718\n ],\n \"group_by\": \"document_id\"\ ,\n \"limit\": 3,\n \"group_size\": 2\n}'" language: curl - - code-samples: - - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\ - \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendGroupsAsync(\n\ - \ \"{collection_name}\",\n \"document_id\",\n groupSize: 3,\n\ - \ positive: new ulong[] { 100, 231 },\n negative: new ulong[] {\ - \ 718 },\n filter: MatchKeyword(\"city\", \"London\"),\n limit:\ - \ 3\n);\n" - language: csharp - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc recommendGroups() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2654,18 +2646,26 @@ paths: \ .strategy(RecommendStrategy::AverageVector),\n )\n .await?;\n" language: rust - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.recommendPointGroups(\"{collection_name}\", {\n positive: [100,\ - \ 231],\n negative: [718],\n group_by: \"document_id\",\n limit:\ - \ 3,\n group_size: 2,\n});\n" - language: typescript + - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\ + \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendGroupsAsync(\n\ + \ \"{collection_name}\",\n \"document_id\",\n groupSize: 3,\n\ + \ positive: new ulong[] { 100, 231 },\n negative: new ulong[] {\ + \ 718 },\n filter: MatchKeyword(\"city\", \"London\"),\n limit:\ + \ 3\n);\n" + language: csharp - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.recommend_groups(\n collection_name=\"\ {collection_name}\",\n positive=[100, 231],\n negative=[718],\n\ \ group_by=\"document_id\",\n limit=3,\n group_size=2,\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.recommendPointGroups(\"{collection_name}\", {\n positive: [100,\ + \ 231],\n negative: [718],\n group_by: \"document_id\",\n limit:\ + \ 3,\n group_size: 2,\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\ \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -2702,12 +2702,6 @@ paths: : \"red\"\n }\n }\n ]\n },\n \"limit\": 2,\n \"with_vector\"\ : false\n}'" language: curl - - code-samples: - - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\ - \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.ScrollAsync(\n\ - \ collectionName: \"{collection_name}\",\n filter: MatchKeyword(\"color\"\ - , \"red\"),\n limit: 1,\n payloadSelector: true\n);\n" - language: csharp - code-samples: - code: "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\ @@ -2729,6 +2723,19 @@ paths: \ )]))\n .limit(1)\n .with_payload(true)\n\ \ .with_vectors(false),\n )\n .await?;\n" language: rust + - code-samples: + - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\ + \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.ScrollAsync(\n\ + \ collectionName: \"{collection_name}\",\n filter: MatchKeyword(\"color\"\ + , \"red\"),\n limit: 1,\n payloadSelector: true\n);\n" + language: csharp + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.scroll(\n collection_name=\"{collection_name}\"\ + ,\n scroll_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"\ + color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n\ + \ limit=1,\n with_payload=True,\n with_vectors=False,\n)\n" + language: python - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ @@ -2738,13 +2745,6 @@ paths: \ },\n ],\n },\n limit: 1,\n with_payload: true,\n\ \ with_vector: false,\n});\n" language: typescript - - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.scroll(\n collection_name=\"{collection_name}\"\ - ,\n scroll_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"\ - color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n\ - \ limit=1,\n with_payload=True,\n with_vectors=False,\n)\n" - language: python - code-samples: - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\nimport\ \ static io.qdrant.client.WithPayloadSelectorFactory.enable;\n\nimport\ @@ -2774,13 +2774,6 @@ paths: : {\n \"value\": \"London\"\n }\n }\n ]\n }\n\ }'" language: curl - - code-samples: - - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\ - \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchAsync(\n\ - \ collectionName: \"{collection_name}\",\n vector: new float[] { 0.2f,\ - \ 0.1f, 0.9f, 0.7f },\n filter: MatchKeyword(\"city\", \"London\"),\n\ - \ limit: 3\n);\n" - language: csharp - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc search() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2803,14 +2796,12 @@ paths: \ )\n .await?;\n" language: rust - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.search(\"{collection_name}\", {\n filter: {\n must: [\n\ - \ {\n key: \"city\",\n match:\ - \ {\n value: \"London\",\n },\n \ - \ },\n ],\n },\n vector: [0.2, 0.1, 0.9, 0.7],\n \ - \ limit: 3,\n});\n" - language: typescript + - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\ + \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchAsync(\n\ + \ collectionName: \"{collection_name}\",\n vector: new float[] { 0.2f,\ + \ 0.1f, 0.9f, 0.7f },\n filter: MatchKeyword(\"city\", \"London\"),\n\ + \ limit: 3\n);\n" + language: csharp - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.search(\n collection_name=\"{collection_name}\"\ @@ -2820,6 +2811,15 @@ paths: \ )\n ]\n ),\n query_vector=[0.2, 0.1, 0.9, 0.7],\n \ \ limit=3,\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.search(\"{collection_name}\", {\n filter: {\n must: [\n\ + \ {\n key: \"city\",\n match:\ + \ {\n value: \"London\",\n },\n \ + \ },\n ],\n },\n vector: [0.2, 0.1, 0.9, 0.7],\n \ + \ limit: 3,\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -2852,16 +2852,6 @@ paths: London\"\n }\n }\n ]\n },\n \"limit\"\ : 3\n }\n ]\n}'" language: curl - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\ - \nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter =\ - \ MatchKeyword(\"city\", \"London\");\n\nvar searches = new List\n\ - {\n new()\n {\n Vector = { new float[] { 0.2f, 0.1f, 0.9f, 0.7f }\ - \ },\n Filter = filter,\n Limit = 3\n },\n new()\n {\n Vector\ - \ = { new float[] { 0.5f, 0.3f, 0.2f, 0.3f } },\n Filter = filter,\n\ - \ Limit = 3\n }\n};\n\nawait client.SearchBatchAsync(collectionName:\ - \ \"{collection_name}\", searches: searches);\n" - language: csharp - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc searchBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2892,16 +2882,15 @@ paths: {collection_name}\", searches))\n .await?;\n" language: rust - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - const filter = {\n must: [\n {\n key: \"city\",\n\ - \ match: {\n value: \"London\",\n \ - \ },\n },\n ],\n};\n\nconst searches = [\n {\n vector:\ - \ [0.2, 0.1, 0.9, 0.7],\n filter,\n limit: 3,\n },\n\ - \ {\n vector: [0.5, 0.3, 0.2, 0.3],\n filter,\n \ - \ limit: 3,\n },\n];\n\nclient.searchBatch(\"{collection_name}\"\ - , {\n searches,\n});\n" - language: typescript + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\ + \nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter =\ + \ MatchKeyword(\"city\", \"London\");\n\nvar searches = new List\n\ + {\n new()\n {\n Vector = { new float[] { 0.2f, 0.1f, 0.9f, 0.7f }\ + \ },\n Filter = filter,\n Limit = 3\n },\n new()\n {\n Vector\ + \ = { new float[] { 0.5f, 0.3f, 0.2f, 0.3f } },\n Filter = filter,\n\ + \ Limit = 3\n }\n};\n\nawait client.SearchBatchAsync(collectionName:\ + \ \"{collection_name}\", searches: searches);\n" + language: csharp - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nfilter_ = models.Filter(\n must=[\n \ @@ -2912,6 +2901,17 @@ paths: \ 0.3, 0.2, 0.3], filter=filter_, limit=3),\n]\n\nclient.search_batch(collection_name=\"\ {collection_name}\", requests=search_queries)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + const filter = {\n must: [\n {\n key: \"city\",\n\ + \ match: {\n value: \"London\",\n \ + \ },\n },\n ],\n};\n\nconst searches = [\n {\n vector:\ + \ [0.2, 0.1, 0.9, 0.7],\n filter,\n limit: 3,\n },\n\ + \ {\n vector: [0.5, 0.3, 0.2, 0.3],\n filter,\n \ + \ limit: 3,\n },\n];\n\nclient.searchBatch(\"{collection_name}\"\ + , {\n searches,\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -2941,12 +2941,6 @@ paths: \ 0.1,\n 0.9,\n 0.7\n ],\n \"group_by\": \"document_id\",\n\ \ \"limit\": 4,\n \"group_size\": 2\n}'" language: curl - - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\"\ - , 6334);\n\nawait client.SearchGroupsAsync(\n collectionName: \"{collection_name}\"\ - ,\n vector: new float[] { 1.1f },\n groupBy: \"document_id\",\n limit:\ - \ 4,\n groupSize: 2\n);\n" - language: csharp - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc searchGroups() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2966,17 +2960,23 @@ paths: ,\n 2,\n ))\n .await?;\n" language: rust - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.searchPointGroups(\"{collection_name}\", {\n vector: [1.1],\n\ - \ group_by: \"document_id\",\n limit: 4,\n group_size: 2,\n});\n" - language: typescript + - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\"\ + , 6334);\n\nawait client.SearchGroupsAsync(\n collectionName: \"{collection_name}\"\ + ,\n vector: new float[] { 1.1f },\n groupBy: \"document_id\",\n limit:\ + \ 4,\n groupSize: 2\n);\n" + language: csharp - code-samples: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.search_groups(\n collection_name=\"\ {collection_name}\",\n query_vector=[1.1],\n group_by=\"document_id\"\ ,\n limit=4,\n group_size=2,\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.searchPointGroups(\"{collection_name}\", {\n vector: [1.1],\n\ + \ group_by: \"document_id\",\n limit: 4,\n group_size: 2,\n});\n" + language: typescript - code-samples: - code: "import java.util.List;\n\nimport io.qdrant.client.QdrantClient;\n\ import io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.SearchPointGroups;\n\ @@ -2996,12 +2996,6 @@ paths: tags: - Search x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.SearchMatrixOffsetsAsync(\n\ - \ \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"\ - ),\n sample: 100,\n limit: 5\n);" - language: csharp - code-samples: - code: "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\ @@ -3024,14 +3018,11 @@ paths: \ .sample(100)\n .limit(5),\n )\n .await?;" language: rust - 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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.search_matrix_offsets(\n collection_name=\"\ @@ -3040,6 +3031,15 @@ paths: color\", match=models.MatchValue(value=\"red\")\n ),\n \ \ ]\n ),\n)" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.searchMatrixOffsets(\"{collection_name}\", {\n filter: {\n \ + \ must: [\n {\n key: \"color\",\n \ + \ match: {\n value: \"red\",\n \ + \ },\n },\n ],\n },\n sample: 100,\n \ + \ limit: 5,\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -3060,12 +3060,6 @@ paths: tags: - Search x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.SearchMatrixPairsAsync(\n\ - \ \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"\ - ),\n sample: 100,\n limit: 5\n);" - language: csharp - code-samples: - code: "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\ @@ -3088,14 +3082,11 @@ paths: \ .sample(100)\n .limit(5),\n )\n .await?;\n" language: rust - 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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.search_matrix_pairs(\n collection_name=\"\ @@ -3104,6 +3095,15 @@ paths: color\", match=models.MatchValue(value=\"red\")\n ),\n \ \ ]\n ),\n)" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.searchMatrixPairs(\"{collection_name}\", {\n filter: {\n \ + \ must: [\n {\n key: \"color\",\n \ + \ match: {\n value: \"red\",\n \ + \ },\n },\n ],\n },\n sample: 100,\n limit:\ + \ 5,\n});" + language: typescript - code-samples: - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -3133,15 +3133,6 @@ paths: : {\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: "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: "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\ @@ -3175,15 +3166,14 @@ paths: \ .await?;\n" language: rust - 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: "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: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.update_vectors(\n collection_name=\"\ @@ -3194,6 +3184,16 @@ paths: \ 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n ),\n \ \ ],\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.updateVectors(\"{collection_name}\", {\n points: [\n \ + \ {\n id: 1,\n vector: {\n image:\ + \ [0.1, 0.2, 0.3, 0.4],\n },\n },\n {\n \ + \ id: 2,\n vector: {\n text: [0.9, 0.8,\ + \ 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n },\n ],\n\ + });\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ \ io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\ @@ -3230,18 +3230,6 @@ paths: \ \"value\": \"red\"\n }\n }\n ]\n },\n \"vectors\"\ : [\n \"text\",\n \"image\"\n ]\n}'" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.DeleteVectorsAsync("{collection_name}", ["text", "image"], - [0, 3, 10]); - - ' - language: csharp - 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\ @@ -3264,17 +3252,29 @@ paths: \ })\n .wait(true),\n )\n .await?;\n" language: rust - 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: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.DeleteVectorsAsync("{collection_name}", ["text", "image"], + [0, 3, 10]); + + ' + language: csharp - code-samples: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.delete_vectors(\n collection_name=\"\ {collection_name}\",\n points=[0, 3, 100],\n vectors=[\"text\",\ \ \"image\"],\n)\n" language: python + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.deleteVectors(\"{collection_name}\", {\n points: [0, 3, 10],\n\ + \ vectors: [\"text\", \"image\"],\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\ \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -3302,12 +3302,6 @@ paths: \ application/json' \\\n --data-raw '{\n \"shard_key\": \"{shard_key}\"\ \n}'" language: curl - - 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: "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\ @@ -3326,11 +3320,11 @@ paths: \ ),\n )\n .await?;\n" language: rust - 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: "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: 'from qdrant_client import QdrantClient @@ -3342,6 +3336,12 @@ paths: ' language: python + - 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: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport\ \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -3366,12 +3366,6 @@ paths: \ application/json' \\\n --data-raw '{\n \"shard_key\": \"{shard_key}\"\ \n}'" language: curl - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.DeleteShardKeyAsync(\n\ - \ \"{collection_name}\",\n new DeleteShardKey { ShardKey = new ShardKey\ - \ { Keyword = \"shard_key\", } }\n);\n" - language: csharp - code-samples: - code: "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\ @@ -3388,11 +3382,11 @@ paths: \ )\n .await?;\n" language: rust - 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: "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: 'from qdrant_client import QdrantClient @@ -3404,6 +3398,12 @@ paths: ' language: python + - 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: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport\ \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -3463,17 +3463,6 @@ paths: - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/snapshots'\ \ \\\n --header 'api-key: '" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ListSnapshotsAsync("{collection_name}"); - - ' - language: csharp - 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\ @@ -3494,16 +3483,16 @@ paths: ' language: rust - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.listSnapshots("{collection_name}"); + await client.ListSnapshotsAsync("{collection_name}"); ' - language: typescript + language: csharp - code-samples: - code: 'from qdrant_client import QdrantClient @@ -3515,6 +3504,17 @@ paths: ' language: python + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.listSnapshots("{collection_name}"); + + ' + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ @@ -3531,17 +3531,6 @@ paths: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/snapshots'\ \ \\\n --header 'api-key: '" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.CreateSnapshotAsync("{collection_name}"); - - ' - language: csharp - 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\ @@ -3562,16 +3551,16 @@ paths: ' language: rust - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.createSnapshot("{collection_name}"); + await client.CreateSnapshotAsync("{collection_name}"); ' - language: typescript + language: csharp - code-samples: - code: 'from qdrant_client import QdrantClient @@ -3583,6 +3572,17 @@ paths: ' language: python + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.createSnapshot("{collection_name}"); + + ' + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ @@ -3604,17 +3604,17 @@ paths: \ application/json' \\\n --data-raw '{\n \"location\": \"http://example.com/path/to/snapshot.shapshot\"\ \n}'" language: curl + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.recover_snapshot(\n \"{collection_name}\"\ + ,\n \"http://example.com/path/to/snapshot.shapshot\",\n)\n" + language: python - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ client.recoverSnapshot(\"{collection_name}\", {\n location: \"http://example.com/path/to/snapshot.shapshot\"\ ,\n});\n" language: typescript - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.recover_snapshot(\n \"{collection_name}\"\ - ,\n \"http://example.com/path/to/snapshot.shapshot\",\n)\n" - language: python /collections/{collection_name}/snapshots/upload: post: description: Recovers local collection data from an uploaded snapshot. This @@ -3639,17 +3639,6 @@ paths: - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/snapshots/snapshot_name'\ \ \\\n --header 'api-key: '" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.DeleteSnapshotAsync("{collection_name}", "{snapshot_name}"); - - ' - language: csharp - 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\ @@ -3666,21 +3655,32 @@ paths: \ .await?;\n" language: rust - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.deleteSnapshot("{collection_name}", "{snapshot_name}"); + await client.DeleteSnapshotAsync("{collection_name}", "{snapshot_name}"); ' - language: typescript + language: csharp - code-samples: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.delete_snapshot(\n collection_name=\"\ {collection_name}\", snapshot_name=\"{snapshot_name}\"\n)\n" language: python + - code-samples: + - code: '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: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ @@ -3740,17 +3740,6 @@ paths: - code: "curl -X GET \\\n 'http://localhost:6333/snapshots' \\\n --header\ \ 'api-key: '" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ListFullSnapshotsAsync(); - - ' - language: csharp - 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\ @@ -3771,16 +3760,16 @@ paths: ' language: rust - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.listFullSnapshots(); + await client.ListFullSnapshotsAsync(); ' - language: typescript + language: csharp - code-samples: - code: 'from qdrant_client import QdrantClient @@ -3792,6 +3781,17 @@ paths: ' language: python + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.listFullSnapshots(); + + ' + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ @@ -3807,17 +3807,6 @@ paths: - code: "curl -X POST \\\n 'http://localhost:6333/snapshots' \\\n --header\ \ 'api-key: '" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.CreateFullSnapshotAsync(); - - ' - language: csharp - 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\ @@ -3838,16 +3827,16 @@ paths: ' language: rust - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.createFullSnapshot(); + await client.CreateFullSnapshotAsync(); ' - language: typescript + language: csharp - code-samples: - code: 'from qdrant_client import QdrantClient @@ -3859,6 +3848,17 @@ paths: ' language: python + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.createFullSnapshot(); + + ' + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ @@ -3875,17 +3875,6 @@ paths: - code: "curl -X DELETE \\\n 'http://localhost:6333/snapshots/snapshot_name'\ \ \\\n --header 'api-key: '" language: curl - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.DeleteFullSnapshotAsync("{snapshot_name}"); - - ' - language: csharp - 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\ @@ -3905,16 +3894,16 @@ paths: ' language: rust - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.deleteFullSnapshot("{snapshot_name}"); + await client.DeleteFullSnapshotAsync("{snapshot_name}"); ' - language: typescript + language: csharp - code-samples: - code: 'from qdrant_client import QdrantClient @@ -3926,6 +3915,17 @@ paths: ' language: python + - code-samples: + - 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: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\