From 0deafefef5cd932a4e12708cde991fe5c35026d6 Mon Sep 17 00:00:00 2001 From: generall Date: Wed, 15 May 2024 00:08:24 +0200 Subject: [PATCH 1/8] upd snippet to test CI --- .github/workflows/sync.yml | 1 + snippets/curl/create_collection.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 14ef927..a030ef8 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -2,6 +2,7 @@ name: sync-openapi on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: + pull_request: jobs: sync: diff --git a/snippets/curl/create_collection.sh b/snippets/curl/create_collection.sh index 98c41e3..b46d9bd 100644 --- a/snippets/curl/create_collection.sh +++ b/snippets/curl/create_collection.sh @@ -17,7 +17,7 @@ curl -X PUT http://localhost:6333/collections/collection_name \ -H "Content-Type: application/json" \ -d '{ "vectors": { - "size": 300, + "size": 1536, "distance": "Cosine" }, "sparse_vectors": { From 4dab0b396a73f1ec6e5de0f443398223d4f156ab Mon Sep 17 00:00:00 2001 From: generall Date: Wed, 15 May 2024 00:22:02 +0200 Subject: [PATCH 2/8] use ready-made action step --- .github/workflows/sync.yml | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index a030ef8..833c03f 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -7,6 +7,10 @@ on: jobs: sync: runs-on: ubuntu-latest + permissions: + # Give the default GITHUB_TOKEN write permission to commit and push the + # added or changed files to the repository. + contents: write steps: - uses: actions/checkout@v2 - name: Set up Python @@ -26,21 +30,9 @@ jobs: - name: Sync Docs run: | bash -x tools/sync-openapi.sh - - name: Commit and push changes - run: | - if [[ `git status --porcelain` ]]; then - # Changes - echo "Changes detected" - else - # No changes - echo "No changes detected" - exit 0 - fi - git config --global user.name 'qdrant' - git config --global user.email 'qdrant@users.noreply.github.com' - git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY - git checkout $GITHUB_HEAD_REF - git add fern/apis - git add fern/versions - git add fern/docs.yml - git commit -am "auto-sync openapi with qdrant core" && git push || true + - uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "Sync OpenAPI" + commit_user_name: "GitHub Actions" + commit_user_email: "team@qdrant.com" + file_pattern: '*.yml' \ No newline at end of file From 766cb634461c6824635763ea0812ce11432a3c23 Mon Sep 17 00:00:00 2001 From: generall Date: Tue, 14 May 2024 22:22:23 +0000 Subject: [PATCH 3/8] Sync OpenAPI --- fern/apis/master/openapi-overrides.yml | 2 +- fern/apis/v1.9.x/openapi-overrides.yml | 2 +- overwrite-snippets.yml | 2077 ++++++++++++++++++++++++ 3 files changed, 2079 insertions(+), 2 deletions(-) create mode 100644 overwrite-snippets.yml diff --git a/fern/apis/master/openapi-overrides.yml b/fern/apis/master/openapi-overrides.yml index 6005245..b890f10 100644 --- a/fern/apis/master/openapi-overrides.yml +++ b/fern/apis/master/openapi-overrides.yml @@ -266,7 +266,7 @@ paths: put: x-fern-examples: - code-samples: - - code: "# Minimal curl command to create a collection with a vector field\n\ncurl -X PUT http://localhost:6333/collections/collection_name \\\n -H \"api-key: \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"vectors\": {\n \"size\": 300,\n \"distance\": \"Cosine\"\n } \n }'\n\n# Or with a sparse vector field\n\ncurl -X PUT http://localhost:6333/collections/collection_name \\\n -H \"api-key: \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"vectors\": {\n \"size\": 300,\n \"distance\": \"Cosine\"\n },\n \"sparse_vectors\": {\n \"splade-model-name\": {\n \"index\": {\n \"on_disk\": true\n }\n }\n }\n }'\n" + - code: "# Minimal curl command to create a collection with a vector field\n\ncurl -X PUT http://localhost:6333/collections/collection_name \\\n -H \"api-key: \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"vectors\": {\n \"size\": 300,\n \"distance\": \"Cosine\"\n } \n }'\n\n# Or with a sparse vector field\n\ncurl -X PUT http://localhost:6333/collections/collection_name \\\n -H \"api-key: \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"vectors\": {\n \"size\": 1536,\n \"distance\": \"Cosine\"\n },\n \"sparse_vectors\": {\n \"splade-model-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\nclient.createCollection(\"{collection_name}\", {\n vectors: { size: 100, distance: \"Cosine\" },\n});\n" diff --git a/fern/apis/v1.9.x/openapi-overrides.yml b/fern/apis/v1.9.x/openapi-overrides.yml index 6005245..b890f10 100644 --- a/fern/apis/v1.9.x/openapi-overrides.yml +++ b/fern/apis/v1.9.x/openapi-overrides.yml @@ -266,7 +266,7 @@ paths: put: x-fern-examples: - code-samples: - - code: "# Minimal curl command to create a collection with a vector field\n\ncurl -X PUT http://localhost:6333/collections/collection_name \\\n -H \"api-key: \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"vectors\": {\n \"size\": 300,\n \"distance\": \"Cosine\"\n } \n }'\n\n# Or with a sparse vector field\n\ncurl -X PUT http://localhost:6333/collections/collection_name \\\n -H \"api-key: \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"vectors\": {\n \"size\": 300,\n \"distance\": \"Cosine\"\n },\n \"sparse_vectors\": {\n \"splade-model-name\": {\n \"index\": {\n \"on_disk\": true\n }\n }\n }\n }'\n" + - code: "# Minimal curl command to create a collection with a vector field\n\ncurl -X PUT http://localhost:6333/collections/collection_name \\\n -H \"api-key: \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"vectors\": {\n \"size\": 300,\n \"distance\": \"Cosine\"\n } \n }'\n\n# Or with a sparse vector field\n\ncurl -X PUT http://localhost:6333/collections/collection_name \\\n -H \"api-key: \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"vectors\": {\n \"size\": 1536,\n \"distance\": \"Cosine\"\n },\n \"sparse_vectors\": {\n \"splade-model-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\nclient.createCollection(\"{collection_name}\", {\n vectors: { size: 100, distance: \"Cosine\" },\n});\n" diff --git a/overwrite-snippets.yml b/overwrite-snippets.yml new file mode 100644 index 0000000..07ecd0f --- /dev/null +++ b/overwrite-snippets.yml @@ -0,0 +1,2077 @@ +paths: + /aliases: + get: + x-fern-examples: + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.getAliases(); + + ' + language: typescript + - code-samples: + - code: 'use qdrant_client::client::QdrantClient; + + + let client = QdrantClient::from_url("http://localhost:6334").build()?; + + + client.list_aliases().await?; + + ' + language: rust + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ListAliasesAsync(); + + ' + language: csharp + - 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 + /collections: + get: + x-fern-examples: + - 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: 'use qdrant_client::client::QdrantClient; + + + let client = QdrantClient::from_url("http://localhost:6334").build()?; + + + client.list_collections().await?; + + ' + language: rust + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ListCollectionsAsync(); + + ' + language: csharp + - 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: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.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: 'use qdrant_client::client::QdrantClient; + + + let client = QdrantClient::from_url("http://localhost:6334").build()?; + + + client.create_alias("example_collection", "production_collection").await?; + + + client.delete_alias("production_collection").await?; + + ' + language: rust + - 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: "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: + x-fern-examples: + - code-samples: + - code: 'import { QdrantClient } from ''@qdrant/qdrant-js''; + + + const client = new QdrantClient({url: ''http://127.0.0.1:6333''}); + + + client.deleteCollection("{collection_name}"); + + ' + language: typescript + - code-samples: + - code: 'use qdrant_client::client::QdrantClient; + + + let client = QdrantClient::from_url("http://localhost:6334").build()?; + + + client.delete_collection("{collection_name}").await?; + + ' + language: rust + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.DeleteCollectionAsync("{collection_name}"); + + ' + 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-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: + x-fern-examples: + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.getCollection("{collection_name}"); + + ' + language: typescript + - code-samples: + - code: 'use qdrant_client::client::QdrantClient; + + + let client = QdrantClient::from_url("http://localhost:6334").build()?; + + + client.collection_info("{collection_name}").await?; + + ' + language: rust + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.GetCollectionInfoAsync("{collection_name}"); + + ' + language: csharp + - 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: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.updateCollection(\"{collection_name}\", {\n optimizers_config:\ + \ {\n indexing_threshold: 10000,\n },\n});\n" + language: typescript + - code-samples: + - code: "use qdrant_client::{client::QdrantClient, qdrant::OptimizersConfigDiff};\n\ + \nlet client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ + \nclient\n .update_collection(\n \"{collection_name}\",\n \ + \ Some(&OptimizersConfigDiff {\n indexing_threshold: Some(10000),\n\ + \ ..Default::default()\n }),\n None,\n \ + \ None,\n None,\n None,\n None,\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.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 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 + put: + x-fern-examples: + - code-samples: + - code: "# Minimal curl command to create a collection with a vector field\n\ + \ncurl -X PUT http://localhost:6333/collections/collection_name \\\n \ + \ -H \"api-key: \" \\\n -H \"Content-Type: application/json\"\ + \ \\\n -d '{\n \"vectors\": {\n \"size\"\ + : 300,\n \"distance\": \"Cosine\"\n } \n \ + \ }'\n\n# Or with a sparse vector field\n\ncurl -X PUT http://localhost:6333/collections/collection_name\ + \ \\\n -H \"api-key: \" \\\n -H \"Content-Type: application/json\"\ + \ \\\n -d '{\n \"vectors\": {\n \"size\"\ + : 1536,\n \"distance\": \"Cosine\"\n },\n \ + \ \"sparse_vectors\": {\n \"splade-model-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" + language: typescript + - code-samples: + - code: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{vectors_config::Config,\ + \ CreateCollection, Distance, VectorParams, VectorsConfig},\n};\n\nlet\ + \ client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ + \nclient\n .create_collection(&CreateCollection {\n collection_name:\ + \ \"{collection_name}\".to_string(),\n vectors_config: Some(VectorsConfig\ + \ {\n config: Some(Config::Params(VectorParams {\n \ + \ size: 100,\n distance: Distance::Cosine.into(),\n\ + \ ..Default::default()\n })),\n }),\n\ + \ ..Default::default()\n })\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.create_collection(\n collection_name=\"\ + {collection_name}\",\n vectors_config=models.VectorParams(size=100,\ + \ distance=models.Distance.COSINE),\n)\n" + language: python + - code-samples: + - code: "import 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" + language: java + /collections/{collection_name}/aliases: + get: + x-fern-examples: + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.getCollectionAliases("{collection_name}"); + + ' + language: typescript + - code-samples: + - code: 'use qdrant_client::client::QdrantClient; + + + let client = QdrantClient::from_url("http://localhost:6334").build()?; + + + client.list_collection_aliases("{collection_name}").await?; + + ' + language: rust + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ListCollectionAliasesAsync("{collection_name}"); + + ' + 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-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}/index: + put: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.createPayloadIndex(\"{collection_name}\", {\n field_name: \"{field_name}\"\ + ,\n field_schema: \"keyword\",\n});\n" + language: typescript + - code-samples: + - code: "use qdrant_client::{client::QdrantClient, qdrant::FieldType};\n\n\ + let client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ + \nclient\n.create_field_index(\n \"{collection_name}\",\n \"{field_name}\"\ + ,\n FieldType::Keyword,\n None,\n None,\n)\n.await?;\n" + language: rust + - 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: "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: + x-fern-examples: + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.deletePayloadIndex("{collection_name}", "{field_name}"); + + ' + language: typescript + - code-samples: + - code: "use qdrant_client::client::QdrantClient;\n\nlet client = QdrantClient::from_url(\"\ + http://localhost:6334\").build()?;\n\nclient\n .delete_field_index(\"\ + {collection_name}\", \"{field_name}\", None)\n .await?;\n" + language: rust + - 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: "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: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.retrieve(\"{collection_name}\", {\n ids: [0, 3, 100],\n});\n" + language: typescript + - code-samples: + - code: "use qdrant_client::client::QdrantClient;\n\nlet client = QdrantClient::from_url(\"\ + http://localhost:6334\").build()?;\n\nclient\n .get_points(\n \ + \ \"{collection_name}\",\n None,\n &[0.into(), 30.into(),\ + \ 100.into()],\n Some(false),\n Some(false),\n None,\n\ + \ )\n .await?;\n" + language: rust + - 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: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\ + \nclient\n .retrieveAsync(\"{collection_name}\", List.of(id(0), id(30),\ + \ id(100)), false, false, null)\n .get();\n" + language: java + put: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.upsert(\"{collection_name}\", {\n points: [\n {\n id:\ + \ 1,\n payload: { color: \"red\" },\n vector: [0.9, 0.1, 0.1],\n\ + \ },\n {\n id: 2,\n payload: { color: \"green\" },\n \ + \ vector: [0.1, 0.9, 0.1],\n },\n {\n id: 3,\n payload:\ + \ { color: \"blue\" },\n vector: [0.1, 0.1, 0.9],\n },\n ],\n\ + });\n" + language: typescript + - code-samples: + - code: "use qdrant_client::{client::QdrantClient, qdrant::PointStruct};\n\ + use serde_json::json;\n\nlet client = QdrantClient::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .upsert_points_batch_blocking(\n \"\ + {collection_name}\".to_string(),\n None,\n vec![\n \ + \ PointStruct::new(\n 1,\n vec![0.9,\ + \ 0.1, 0.1],\n json!(\n {\"color\":\ + \ \"red\"}\n )\n .try_into()\n \ + \ .unwrap(),\n ),\n PointStruct::new(\n \ + \ 2,\n vec![0.1, 0.9, 0.1],\n \ + \ json!(\n {\"color\": \"green\"}\n \ + \ )\n .try_into()\n .unwrap(),\n \ + \ ),\n PointStruct::new(\n 3,\n \ + \ vec![0.1, 0.1, 0.9],\n json!(\n \ + \ {\"color\": \"blue\"}\n )\n .try_into()\n\ + \ .unwrap(),\n ),\n ],\n None,\n\ + \ 100,\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.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 static io.qdrant.client.PointIdFactory.id;\nimport static\ + \ io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\ + \nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\n\ + import io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.PointStruct;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .upsertAsync(\n \ + \ \"{collection_name}\",\n List.of(\n PointStruct.newBuilder()\n\ + \ .setId(id(1))\n .setVectors(\n \ + \ namedVectors(\n Map.of(\n \ + \ \"image\",\n vector(List.of(0.9f,\ + \ 0.1f, 0.1f, 0.2f)),\n \"text\",\n \ + \ vector(List.of(0.4f, 0.7f, 0.1f, 0.8f, 0.1f, 0.1f,\ + \ 0.9f, 0.2f)))))\n .build(),\n PointStruct.newBuilder()\n\ + \ .setId(id(2))\n .setVectors(\n \ + \ namedVectors(\n Map.of(\n \ + \ \"image\",\n List.of(0.2f,\ + \ 0.1f, 0.3f, 0.9f),\n \"text\",\n \ + \ List.of(0.5f, 0.2f, 0.7f, 0.4f, 0.7f, 0.2f, 0.3f,\ + \ 0.9f))))\n .build()))\n .get();\n" + language: java + /collections/{collection_name}/points/batch: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + 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: "use qdrant_client::qdrant::{\n points_selector::PointsSelectorOneOf,\n\ + \ points_update_operation::{\n Operation, PointStructList, SetPayload,\ + \ UpdateVectors,\n },\n PointStruct, PointVectors, PointsIdsList,\ + \ PointsSelector, PointsUpdateOperation,\n};\n\nlet client = QdrantClient::from_url(\"\ + http://localhost:6334\").build()?;\n\nclient\n .batch_updates_blocking(\n\ + \ \"{collection_name}\",\n &[\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 \ + \ json!({}).try_into().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(SetPayload\ + \ {\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 None,\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.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 java.util.List;\nimport java.util.Map;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ + import static io.qdrant.client.ValueFactory.value;\nimport static io.qdrant.client.VectorsFactory.vectors;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.PointStruct;\nimport io.qdrant.client.grpc.Points.PointVectors;\n\ + import io.qdrant.client.grpc.Points.PointsIdsList;\nimport io.qdrant.client.grpc.Points.PointsSelector;\n\ + import io.qdrant.client.grpc.Points.PointsUpdateOperation;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation.PointStructList;\n\ + import io.qdrant.client.grpc.Points.PointsUpdateOperation.SetPayload;\n\ + import io.qdrant.client.grpc.Points.PointsUpdateOperation.UpdateVectors;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .batchUpdateAsync(\n\ + \ \"{collection_name}\",\n List.of(\n PointsUpdateOperation.newBuilder()\n\ + \ .setUpsert(\n PointStructList.newBuilder()\n\ + \ .addPoints(\n PointStruct.newBuilder()\n\ + \ .setId(id(1))\n .setVectors(vectors(\n\ + \ 1.0 f,\n 2.0 f,\n \ + \ 3.0 f,\n 4.0 f))\n \ + \ .build())\n .build())\n .build(),\n\ + \ PointsUpdateOperation.newBuilder()\n .setUpdateVectors(\n\ + \ UpdateVectors.newBuilder()\n .addPoints(\n\ + \ PointVectors.newBuilder()\n .setId(id(1))\n\ + \ .setVectors(vectors(\n 1.0\ + \ f,\n 2.0 f,\n 3.0 f,\n\ + \ 4.0 f))\n .build())\n \ + \ .build())\n .build(),\n PointsUpdateOperation.newBuilder()\n\ + \ .setSetPayload(\n SetPayload.newBuilder()\n\ + \ .setPointsSelector(\n PointsSelector.newBuilder()\n\ + \ .setPoints(PointsIdsList\n \ + \ .newBuilder()\n .addIds(id(1))\n \ + \ .build())\n .build())\n \ + \ .putAllPayload(\n Map.of(\"test_payload_2\",\n\ + \ value(2),\n \"test_payload_3\"\ + ,\n value(3)))\n .build())\n \ + \ .build()))\n .get();\n" + language: java + /collections/{collection_name}/points/count: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + 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: "use qdrant_client::{client::QdrantClient, qdrant::{Condition, CountPoints,\ + \ Filter}};\n\nlet client = QdrantClient::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .count(&CountPoints {\n collection_name:\ + \ \"{collection_name}\".to_string(),\n filter: Some(Filter::must([Condition::matches(\n\ + \ \"color\",\n \"red\".to_string(),\n )])),\n\ + \ exact: Some(true),\n ..Default::default()\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.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 static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ + import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.Filter;\n\nQdrantClient client =\ + \ new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\ + \nclient\n .countAsync(\n \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"\ + color\", \"red\")).build(),\n true)\n .get();\n" + language: java + /collections/{collection_name}/points/delete: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + 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: "use qdrant_client::{client::QdrantClient, qdrant::{points_selector::PointsSelectorOneOf,\ + \ Condition, Filter, PointsIdsList, PointsSelector}};\n\nlet client =\ + \ QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\nclient\n\ + \ .delete_points_blocking(\n \"{collection_name}\",\n \ + \ None,\n &PointsSelector {\n points_selector_one_of:\ + \ Some(PointsSelectorOneOf::Points(PointsIdsList {\n ids:\ + \ vec![0.into(), 3.into(), 100.into()],\n })),\n },\n\ + \ None,\n )\n .await?;\n\n client\n .delete_points_blocking(\n\ + \ \"{collection_name}\",\n None,\n &PointsSelector\ + \ {\n points_selector_one_of: Some(PointsSelectorOneOf::Filter(Filter::must([\n\ + \ Condition::matches(\"color\", \"red\".to_string()),\n\ + \ ]))),\n },\n None,\n )\n\ + \ .await?;\n" + language: rust + - 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: "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.Points.Filter;\n\nQdrantClient client =\ + \ new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\"\ + , 6334, false).build());\n\nclient.deleteAsync(\"{collection_name}\",\ + \ List.of(id(0), id(3), id(100)));\n\nclient\n .deleteAsync(\n \ + \ \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"\ + color\", \"red\")).build())\n .get();\n" + language: java + /collections/{collection_name}/points/discover: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{\n\ + \ target_vector::Target, vector_example::Example, ContextExamplePair,\ + \ DiscoverPoints,\n TargetVector, VectorExample,\n },\n};\n\n\ + let client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ + \nclient\n .discover(&DiscoverPoints {\n collection_name: \"\ + {collection_name}\".to_string(),\n target: Some(TargetVector {\n\ + \ target: Some(Target::Single(VectorExample {\n \ + \ example: Some(Example::Vector(vec![0.2, 0.1, 0.9, 0.7].into())),\n\ + \ })),\n }),\n context: vec![\n ContextExamplePair\ + \ {\n positive: Some(VectorExample {\n \ + \ example: Some(Example::Id(100.into())),\n }),\n \ + \ negative: Some(VectorExample {\n example:\ + \ Some(Example::Id(718.into())),\n }),\n },\n\ + \ ContextExamplePair {\n positive: Some(VectorExample\ + \ {\n example: Some(Example::Id(200.into())),\n \ + \ }),\n negative: Some(VectorExample {\n \ + \ example: Some(Example::Id(300.into())),\n \ + \ }),\n },\n ],\n limit: 10,\n ..Default::default()\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.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 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\ + import io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.ContextExamplePair;\n\ + import io.qdrant.client.grpc.Points.DiscoverPoints;\nimport io.qdrant.client.grpc.Points.TargetVector;\n\ + import 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 + /collections/{collection_name}/points/discover/batch: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{\n\ + \ target_vector::Target, vector_example::Example, ContextExamplePair,\ + \ DiscoverBatchPoints,\n DiscoverPoints, TargetVector, VectorExample,\n\ + \ },\n};\n\nlet client = QdrantClient::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nlet discover_points = &DiscoverBatchPoints {\n collection_name:\ + \ \"{collection_name}\".to_string(),\n discover_points: vec![\n \ + \ DiscoverPoints {\n collection_name: \"{collection_name}\"\ + .to_string(),\n target: Some(TargetVector {\n \ + \ target: Some(Target::Single(VectorExample {\n example:\ + \ Some(Example::Vector(vec![0.2, 0.1, 0.9, 0.7].into())),\n \ + \ })),\n }),\n context: vec![\n \ + \ ContextExamplePair {\n positive: Some(VectorExample\ + \ {\n example: Some(Example::Id(100.into())),\n\ + \ }),\n negative: Some(VectorExample\ + \ {\n example: Some(Example::Id(718.into())),\n\ + \ }),\n },\n ContextExamplePair\ + \ {\n positive: Some(VectorExample {\n \ + \ example: Some(Example::Id(200.into())),\n \ + \ }),\n negative: Some(VectorExample {\n \ + \ example: Some(Example::Id(300.into())),\n \ + \ }),\n },\n ],\n limit:\ + \ 10,\n ..Default::default()\n },\n DiscoverPoints\ + \ {\n collection_name: \"{collection_name}\".to_string(),\n\ + \ target: Some(TargetVector {\n target: Some(Target::Single(VectorExample\ + \ {\n example: Some(Example::Vector(vec![0.5, 0.3,\ + \ 0.2, 0.3].into())),\n })),\n }),\n \ + \ context: vec![\n ContextExamplePair {\n \ + \ positive: Some(VectorExample {\n example:\ + \ Some(Example::Id(342.into())),\n }),\n \ + \ negative: Some(VectorExample {\n example:\ + \ Some(Example::Id(213.into())),\n }),\n \ + \ },\n ContextExamplePair {\n positive:\ + \ Some(VectorExample {\n example: Some(Example::Id(100.into())),\n\ + \ }),\n negative: Some(VectorExample\ + \ {\n example: Some(Example::Id(200.into())),\n\ + \ }),\n },\n ],\n \ + \ limit: 10,\n ..Default::default()\n },\n ],\n\ + \ ..Default::default()\n};\n\nclient.discover_batch(discover_points).await?;\n" + language: rust + - 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: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ + \ io.qdrant.client.VectorFactory.vector;\n\nimport java.util.Arrays;\n\ + import java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport\ + \ io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.ContextExamplePair;\n\ + import io.qdrant.client.grpc.Points.DiscoverPoints;\nimport io.qdrant.client.grpc.Points.TargetVector;\n\ + import 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 + /collections/{collection_name}/points/payload: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + 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: "use qdrant_client::{client::QdrantClient, qdrant::{\n points_selector::PointsSelectorOneOf,\ + \ PointsIdsList, PointsSelector,\n}};\n\nlet client = QdrantClient::from_url(\"\ + http://localhost:6334\").build()?;\n\nclient\n .set_payload_blocking(\n\ + \ \"{collection_name}\",\n None,\n &PointsSelector\ + \ {\n points_selector_one_of: Some(PointsSelectorOneOf::Points(PointsIdsList\ + \ {\n ids: vec![0.into(), 3.into(), 10.into()],\n \ + \ })),\n },\n json!({\n \"property1\":\ + \ \"string\",\n \"property2\": \"string\",\n })\n \ + \ .try_into()\n .unwrap(),\n None,\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.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 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 + put: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.overwritePayload(\"{collection_name}\", {\n payload: {\n property1:\ + \ \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n\ + });\n" + language: typescript + - code-samples: + - code: "use qdrant_client::{client::QdrantClient, qdrant::{\n points_selector::PointsSelectorOneOf,\ + \ PointsIdsList, PointsSelector,\n}};\n\nlet client = QdrantClient::from_url(\"\ + http://localhost:6334\").build()?;\n\nclient\n .overwrite_payload_blocking(\n\ + \ \"{collection_name}\",\n None,\n &PointsSelector\ + \ {\n points_selector_one_of: Some(PointsSelectorOneOf::Points(PointsIdsList\ + \ {\n ids: vec![0.into(), 3.into(), 10.into()],\n \ + \ })),\n },\n json!({\n \"property1\":\ + \ \"string\",\n \"property2\": \"string\",\n })\n \ + \ .try_into()\n .unwrap(),\n None,\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.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 java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ + import static io.qdrant.client.ValueFactory.value;\n\nimport io.qdrant.client.QdrantClient;\n\ + import io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new\ + \ QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\"\ + , 6334, false).build());\n\nclient\n .overwritePayloadAsync(\n \ + \ \"{collection_name}\",\n Map.of(\"property1\", value(\"string\"\ + ), \"property2\", value(\"string\")),\n List.of(id(0), id(3), id(10)),\n\ + \ true,\n null,\n null)\n .get();\n" + language: java + /collections/{collection_name}/points/payload/clear: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.clearPayload(\"{collection_name}\", {\n points: [0, 3, 100],\n\ + });\n" + language: typescript + - code-samples: + - code: "use qdrant_client::{client::QdrantClient, qdrant::{\n points_selector::PointsSelectorOneOf,\ + \ PointsIdsList, PointsSelector,\n}};\n\nlet client = QdrantClient::from_url(\"\ + http://localhost:6334\").build()?;\n\nclient\n .clear_payload(\n \ + \ \"{collection_name}\",\n None,\n Some(PointsSelector\ + \ {\n points_selector_one_of: Some(PointsSelectorOneOf::Points(PointsIdsList\ + \ {\n ids: vec![0.into(), 3.into(), 100.into()],\n \ + \ })),\n }),\n None,\n )\n .await?;\n" + language: rust + - 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: "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: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.deletePayload(\"{collection_name}\", {\n keys: [\"color\", \"\ + price\"],\n points: [0, 3, 100],\n});\n" + language: typescript + - code-samples: + - code: "use qdrant_client::{client::QdrantClient, qdrant::{\n points_selector::PointsSelectorOneOf,\ + \ PointsIdsList, PointsSelector,\n}};\n\nlet client = QdrantClient::from_url(\"\ + http://localhost:6334\").build()?;\n\nclient\n .delete_payload_blocking(\n\ + \ \"{collection_name}\",\n None,\n &PointsSelector\ + \ {\n points_selector_one_of: Some(PointsSelectorOneOf::Points(PointsIdsList\ + \ {\n ids: vec![0.into(), 3.into(), 100.into()],\n \ + \ })),\n },\n vec![\"color\".to_string(), \"price\"\ + .to_string()],\n None,\n )\n .await?;\n" + language: rust + - 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: "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 + /collections/{collection_name}/points/recommend: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{Condition,\ + \ Filter, RecommendPoints, RecommendStrategy},\n};\n\nlet client = QdrantClient::from_url(\"\ + http://localhost:6334\").build()?;\n\nclient\n .recommend(&RecommendPoints\ + \ {\n collection_name: \"{collection_name}\".to_string(),\n \ + \ positive: vec![100.into(), 200.into()],\n positive_vectors:\ + \ vec![vec![100.0, 231.0].into()],\n negative: vec![718.into()],\n\ + \ negative_vectors: vec![vec![0.2, 0.3, 0.4, 0.5].into()],\n \ + \ strategy: Some(RecommendStrategy::AverageVector.into()),\n \ + \ filter: Some(Filter::must([Condition::matches(\n \"city\"\ + ,\n \"London\".to_string(),\n )])),\n limit:\ + \ 3,\n ..Default::default()\n })\n .await?;\n" + language: rust + - 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: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ + import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.RecommendPoints;\n\ + import io.qdrant.client.grpc.Points.RecommendStrategy;\n\nQdrantClient\ + \ client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\"\ + , 6334, false).build());\n\nclient\n .recommendAsync(\n RecommendPoints.newBuilder()\n\ + \ .setCollectionName(\"{collection_name}\")\n .addAllPositive(List.of(id(100),\ + \ id(200)))\n .addAllPositiveVectors(List.of(vector(100.0f,\ + \ 231.0f)))\n .addAllNegative(List.of(id(718)))\n \ + \ .addAllPositiveVectors(List.of(vector(0.2f, 0.3f, 0.4f, 0.5f)))\n\ + \ .setStrategy(RecommendStrategy.AverageVector)\n \ + \ .setFilter(Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\"\ + )))\n .setLimit(3)\n .build())\n .get();\n" + language: java + /collections/{collection_name}/points/recommend/batch: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{Condition,\ + \ Filter, RecommendBatchPoints, RecommendPoints},\n};\n\nlet client =\ + \ QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\nlet filter\ + \ = Filter::must([Condition::matches(\"city\", \"London\".to_string())]);\n\ + \nlet recommend_queries = vec![\n RecommendPoints {\n collection_name:\ + \ \"{collection_name}\".to_string(),\n positive: vec![100.into(),\ + \ 231.into()],\n negative: vec![718.into()],\n filter: Some(filter.clone()),\n\ + \ limit: 3,\n ..Default::default()\n },\n RecommendPoints\ + \ {\n collection_name: \"{collection_name}\".to_string(),\n \ + \ positive: vec![200.into(), 67.into()],\n negative: vec![300.into()],\n\ + \ filter: Some(filter),\n limit: 3,\n ..Default::default()\n\ + \ },\n];\n\nclient\n .recommend_batch(&RecommendBatchPoints {\n\ + \ collection_name: \"{collection_name}\".to_string(),\n \ + \ recommend_points: recommend_queries,\n ..Default::default()\n\ + \ })\n .await?;\n" + language: rust + - 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: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ + import static io.qdrant.client.PointIdFactory.id;\n\nimport io.qdrant.client.QdrantClient;\n\ + import io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\n\ + import io.qdrant.client.grpc.Points.RecommendPoints;\n\nQdrantClient client\ + \ =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334,\ + \ false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"\ + city\", \"London\")).build();\n\nList recommendQueries\ + \ =\n List.of(\n RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(100),\ + \ id(231)))\n .addAllNegative(List.of(id(718)))\n \ + \ .setFilter(filter)\n .setLimit(3)\n .build(),\n\ + \ RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(200),\ + \ id(67)))\n .addAllNegative(List.of(id(300)))\n \ + \ .setFilter(filter)\n .setLimit(3)\n .build());\n\ + \nclient.recommendBatchAsync(\"{collection_name}\", recommendQueries,\ + \ null).get();\n" + language: java + /collections/{collection_name}/points/recommend/groups: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{RecommendPointGroups,\ + \ RecommendStrategy},\n};\n\nlet client = QdrantClient::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .recommend_groups(&RecommendPointGroups {\n\ + \ collection_name: \"{collection_name}\".to_string(),\n \ + \ group_by: \"document_id\".to_string(),\n group_size: 2,\n \ + \ positive: vec![100.into(), 200.into()],\n negative: vec![718.into()],\n\ + \ strategy: Some(RecommendStrategy::AverageVector.into()),\n \ + \ limit: 3,\n ..Default::default()\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.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 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: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.scroll(\"{collection_name}\", {\n filter: {\n must: [\n\ + \ {\n key: \"color\",\n match:\ + \ {\n value: \"red\",\n },\n \ + \ },\n ],\n },\n limit: 1,\n with_payload: true,\n\ + \ with_vector: false,\n});\n" + language: typescript + - code-samples: + - code: "use qdrant_client::{client::QdrantClient, qdrant::{Condition, Filter,\ + \ ScrollPoints}};\n\nlet client = QdrantClient::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .scroll(&ScrollPoints {\n collection_name:\ + \ \"{collection_name}\".to_string(),\n filter: Some(Filter::must([Condition::matches(\n\ + \ \"color\",\n \"red\".to_string(),\n )])),\n\ + \ limit: Some(1),\n with_payload: Some(true.into()),\n \ + \ with_vectors: Some(false.into()),\n ..Default::default()\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 static io.qdrant.client.ConditionFactory.matchKeyword;\nimport\ + \ static io.qdrant.client.WithPayloadSelectorFactory.enable;\n\nimport\ + \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.ScrollPoints;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .scrollAsync(\n \ + \ ScrollPoints.newBuilder()\n .setCollectionName(\"{collection_name}\"\ + )\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"\ + color\", \"red\")).build())\n .setLimit(1)\n .setWithPayload(enable(true))\n\ + \ .build())\n .get();\n" + language: java + /collections/{collection_name}/points/search: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{Condition,\ + \ Filter, SearchParams, SearchPoints},\n};\n\nlet client = QdrantClient::from_url(\"\ + http://localhost:6334\").build()?;\n\nclient\n .search_points(&SearchPoints\ + \ {\n collection_name: \"{collection_name}\".to_string(),\n \ + \ filter: Some(Filter::must([Condition::matches(\n \"city\"\ + ,\n \"London\".to_string(),\n )])),\n params:\ + \ Some(SearchParams {\n hnsw_ef: Some(128),\n exact:\ + \ Some(false),\n ..Default::default()\n }),\n \ + \ vector: vec![0.2, 0.1, 0.9, 0.7],\n limit: 3,\n ..Default::default()\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.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 static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ + import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .searchAsync(\n \ + \ SearchPoints.newBuilder()\n .setCollectionName(\"{collection_name}\"\ + )\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"\ + city\", \"London\")).build())\n .addAllVector(List.of(0.2f,\ + \ 0.1f, 0.9f, 0.7f))\n .setLimit(3)\n .build())\n\ + \ .get();\n" + language: java + /collections/{collection_name}/points/search/batch: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{Condition,\ + \ Filter, SearchBatchPoints, SearchPoints},\n};\n\nlet client = QdrantClient::from_url(\"\ + http://localhost:6334\").build()?;\n\nlet filter = Filter::must([Condition::matches(\"\ + city\", \"London\".to_string())]);\n\nlet searches = vec![\n SearchPoints\ + \ {\n collection_name: \"{collection_name}\".to_string(),\n \ + \ vector: vec![0.2, 0.1, 0.9, 0.7],\n filter: Some(filter.clone()),\n\ + \ limit: 3,\n ..Default::default()\n },\n SearchPoints\ + \ {\n collection_name: \"{collection_name}\".to_string(),\n \ + \ vector: vec![0.5, 0.3, 0.2, 0.3],\n filter: Some(filter),\n\ + \ limit: 3,\n ..Default::default()\n },\n];\n\nclient\n\ + \ .search_batch_points(&SearchBatchPoints {\n collection_name:\ + \ \"{collection_name}\".to_string(),\n search_points: searches,\n\ + \ read_consistency: None,\n ..Default::default()\n })\n\ + \ .await?;\n" + language: rust + - 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: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\ + \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"\ + city\", \"London\")).build();\nList searches =\n List.of(\n\ + \ SearchPoints.newBuilder()\n .addAllVector(List.of(0.2f,\ + \ 0.1f, 0.9f, 0.7f))\n .setFilter(filter)\n .setLimit(3)\n\ + \ .build(),\n SearchPoints.newBuilder()\n \ + \ .addAllVector(List.of(0.5f, 0.3f, 0.2f, 0.3f))\n .setFilter(filter)\n\ + \ .setLimit(3)\n .build());\nclient.searchBatchAsync(\"\ + {collection_name}\", searches, null).get();\n" + language: java + /collections/{collection_name}/points/search/groups: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::SearchPointGroups,\n\ + };\n\nlet client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ + \nclient\n .search_groups(&SearchPointGroups {\n collection_name:\ + \ \"{collection_name}\".to_string(),\n vector: vec![1.1],\n \ + \ group_by: \"document_id\".to_string(),\n limit: 4,\n \ + \ group_size: 2,\n ..Default::default()\n })\n .await?;\n" + language: rust + - 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: "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/vectors: + put: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.updateVectors(\"{collection_name}\", {\n points: [\n \ + \ {\n id: 1,\n vector: {\n image:\ + \ [0.1, 0.2, 0.3, 0.4],\n },\n },\n {\n \ + \ id: 2,\n vector: {\n text: [0.9, 0.8,\ + \ 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n },\n ],\n\ + });\n" + language: typescript + - code-samples: + - code: "use qdrant_client::qdrant::PointVectors;\nuse std::collections::HashMap;\n\ + \nclient\n .update_vectors_blocking(\n \"{collection_name}\"\ + ,\n None,\n &[\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])]).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 None,\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.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 static io.qdrant.client.PointIdFactory.id;\nimport static\ + \ io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\ + \nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\n\ + import io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new\ + \ QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\"\ + , 6334, false).build());\n\nclient\n .updateVectorsAsync(\n \ + \ \"{collection_name}\",\n List.of(\n PointVectors.newBuilder()\n\ + \ .setId(id(1))\n .setVectors(namedVectors(Map.of(\"\ + image\", vector(List.of(0.1f, 0.2f, 0.3f, 0.4f)))))\n .build(),\n\ + \ PointVectors.newBuilder()\n .setId(id(2))\n\ + \ .setVectors(\n namedVectors(\n \ + \ Map.of(\n \"text\", vector(List.of(0.9f,\ + \ 0.8f, 0.7f, 0.6f, 0.5f, 0.4f, 0.3f, 0.2f)))))\n .build()))\n\ + \ .get();\n" + language: java + /collections/{collection_name}/points/vectors/delete: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.deleteVectors(\"{collection_name}\", {\n points: [0, 3, 10],\n\ + \ vectors: [\"text\", \"image\"],\n});\n" + language: typescript + - code-samples: + - code: "use qdrant_client::{client::QdrantClient, qdrant::{\n points_selector::PointsSelectorOneOf,\ + \ PointsIdsList, PointsSelector, VectorsSelector,\n}};\n\nlet client =\ + \ QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\nclient\n\ + \ .delete_vectors_blocking(\n \"{collection_name}\",\n \ + \ None,\n &PointsSelector {\n points_selector_one_of:\ + \ Some(PointsSelectorOneOf::Points(PointsIdsList {\n ids:\ + \ vec![0.into(), 3.into(), 10.into()],\n })),\n },\n\ + \ &VectorsSelector {\n names: vec![\"text\".into(),\ + \ \"image\".into()],\n },\n None,\n )\n .await?;\n" + language: rust + - 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: "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 + /collections/{collection_name}/shards: + put: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n\ + });\n\nclient.createShardKey(\"{collection_name}\", {\n shard_key:\ + \ \"{shard_key}\"\n});\n" + language: typescript + - code-samples: + - code: "use qdrant_client::{client::QdrantClient, qdrant::shard_key::Key};\n\ + \nlet client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ + \nclient\n .create_shard_key(\n \"{collection_name}\",\n \ + \ &Key::Keyword(\"{shard_key\".to_string()),\n None,\n \ + \ None,\n &[],\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.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 + + + client = QdrantClient(url="http://localhost:6333") + + + client.create_shard_key("{collection_name}", "{shard_key}") + + ' + 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.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 + /collections/{collection_name}/shards/delete: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n\ + });\n\nclient.deleteShardKey(\"{collection_name}\", {\n shard_key:\ + \ \"{shard_key}\"\n});\n" + language: typescript + - code-samples: + - code: "use qdrant_client::{client::QdrantClient, qdrant::shard_key::Key};\n\ + \nlet client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ + \nclient\n .delete_shard_key(\"{collection_name}\", &Key::Keyword(\"\ + {shard_key\".to_string()))\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.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 + + + client = QdrantClient(url="http://localhost:6333") + + + client.delete_shard_key("{collection_name}", "{shard_key}") + + ' + 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.deleteShardKeyAsync(DeleteShardKeyRequest.newBuilder()\n\ + \ .setCollectionName(\"{collection_name}\")\n \ + \ .setRequest(DeleteShardKey.newBuilder()\n \ + \ .setShardKey(shardKey(\"{shard_key}\"))\n \ + \ .build())\n .build()).get();\n" + language: java + /collections/{collection_name}/snapshots: + get: + x-fern-examples: + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.listSnapshots("{collection_name}"); + + ' + language: typescript + - code-samples: + - code: 'use qdrant_client::client::QdrantClient; + + + let client = QdrantClient::from_url("http://localhost:6334").build()?; + + + client.list_snapshots("{collection_name}").await?; + + ' + language: rust + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ListSnapshotsAsync("{collection_name}"); + + ' + 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-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 + post: + x-fern-examples: + - 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: 'use qdrant_client::client::QdrantClient; + + + let client = QdrantClient::from_url("http://localhost:6334").build()?; + + + client.create_snapshot("{collection_name}").await?; + + ' + language: rust + - 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 + + + 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: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.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/{snapshot_name}: + delete: + x-fern-examples: + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.deleteSnapshot("{collection_name}", "{snapshot_name}"); + + ' + language: typescript + - code-samples: + - code: "use qdrant_client::client::QdrantClient;\n\nlet client = QdrantClient::from_url(\"\ + http://localhost:6334\").build()?;\n\nclient\n .delete_snapshot(\"\ + {collection_name}\", \"{snapshot_name}\")\n .await?;\n" + language: rust + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.DeleteSnapshotAsync("{collection_name}", "{snapshot_name}"); + + ' + 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 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 + /snapshots: + get: + x-fern-examples: + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.listFullSnapshots(); + + ' + language: typescript + - code-samples: + - code: 'use qdrant_client::client::QdrantClient; + + + let client = QdrantClient::from_url("http://localhost:6334").build()?; + + + client.list_full_snapshots().await?; + + ' + language: rust + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ListFullSnapshotsAsync(); + + ' + language: csharp + - 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: + x-fern-examples: + - 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: 'use qdrant_client::client::QdrantClient; + + + let client = QdrantClient::from_url("http://localhost:6334").build()?; + + + client.create_full_snapshot().await?; + + ' + language: rust + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.CreateFullSnapshotAsync(); + + ' + language: csharp + - 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: + x-fern-examples: + - 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: 'use qdrant_client::client::QdrantClient; + + + let client = QdrantClient::from_url("http://localhost:6334").build()?; + + + client.delete_full_snapshot("{snapshot_name}").await?; + + ' + language: rust + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.DeleteFullSnapshotAsync("{snapshot_name}"); + + ' + 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-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 From 85cb0d83a95c4c9062aad3995c71cac46e13e72f Mon Sep 17 00:00:00 2001 From: generall Date: Wed, 15 May 2024 00:32:47 +0200 Subject: [PATCH 4/8] fix Ci --- .github/workflows/preview.yml | 1 + .github/workflows/sync.yml | 2 +- fern/apis/master/openapi-overrides.yml | 2 +- overwrite-snippets.yml | 2077 ------------------------ 4 files changed, 3 insertions(+), 2079 deletions(-) delete mode 100644 overwrite-snippets.yml diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index ffc2164..5ea7454 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -4,6 +4,7 @@ on: pull_request jobs: run: + needs: sync-openapi runs-on: ubuntu-latest permissions: write-all steps: diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 833c03f..32581ad 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -35,4 +35,4 @@ jobs: commit_message: "Sync OpenAPI" commit_user_name: "GitHub Actions" commit_user_email: "team@qdrant.com" - file_pattern: '*.yml' \ No newline at end of file + file_pattern: 'fern/*.yml' diff --git a/fern/apis/master/openapi-overrides.yml b/fern/apis/master/openapi-overrides.yml index b890f10..6005245 100644 --- a/fern/apis/master/openapi-overrides.yml +++ b/fern/apis/master/openapi-overrides.yml @@ -266,7 +266,7 @@ paths: put: x-fern-examples: - code-samples: - - code: "# Minimal curl command to create a collection with a vector field\n\ncurl -X PUT http://localhost:6333/collections/collection_name \\\n -H \"api-key: \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"vectors\": {\n \"size\": 300,\n \"distance\": \"Cosine\"\n } \n }'\n\n# Or with a sparse vector field\n\ncurl -X PUT http://localhost:6333/collections/collection_name \\\n -H \"api-key: \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"vectors\": {\n \"size\": 1536,\n \"distance\": \"Cosine\"\n },\n \"sparse_vectors\": {\n \"splade-model-name\": {\n \"index\": {\n \"on_disk\": true\n }\n }\n }\n }'\n" + - code: "# Minimal curl command to create a collection with a vector field\n\ncurl -X PUT http://localhost:6333/collections/collection_name \\\n -H \"api-key: \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"vectors\": {\n \"size\": 300,\n \"distance\": \"Cosine\"\n } \n }'\n\n# Or with a sparse vector field\n\ncurl -X PUT http://localhost:6333/collections/collection_name \\\n -H \"api-key: \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"vectors\": {\n \"size\": 300,\n \"distance\": \"Cosine\"\n },\n \"sparse_vectors\": {\n \"splade-model-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\nclient.createCollection(\"{collection_name}\", {\n vectors: { size: 100, distance: \"Cosine\" },\n});\n" diff --git a/overwrite-snippets.yml b/overwrite-snippets.yml deleted file mode 100644 index 07ecd0f..0000000 --- a/overwrite-snippets.yml +++ /dev/null @@ -1,2077 +0,0 @@ -paths: - /aliases: - get: - x-fern-examples: - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.getAliases(); - - ' - language: typescript - - code-samples: - - code: 'use qdrant_client::client::QdrantClient; - - - let client = QdrantClient::from_url("http://localhost:6334").build()?; - - - client.list_aliases().await?; - - ' - language: rust - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ListAliasesAsync(); - - ' - language: csharp - - 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 - /collections: - get: - x-fern-examples: - - 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: 'use qdrant_client::client::QdrantClient; - - - let client = QdrantClient::from_url("http://localhost:6334").build()?; - - - client.list_collections().await?; - - ' - language: rust - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ListCollectionsAsync(); - - ' - language: csharp - - 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: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.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: 'use qdrant_client::client::QdrantClient; - - - let client = QdrantClient::from_url("http://localhost:6334").build()?; - - - client.create_alias("example_collection", "production_collection").await?; - - - client.delete_alias("production_collection").await?; - - ' - language: rust - - 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: "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: - x-fern-examples: - - code-samples: - - code: 'import { QdrantClient } from ''@qdrant/qdrant-js''; - - - const client = new QdrantClient({url: ''http://127.0.0.1:6333''}); - - - client.deleteCollection("{collection_name}"); - - ' - language: typescript - - code-samples: - - code: 'use qdrant_client::client::QdrantClient; - - - let client = QdrantClient::from_url("http://localhost:6334").build()?; - - - client.delete_collection("{collection_name}").await?; - - ' - language: rust - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.DeleteCollectionAsync("{collection_name}"); - - ' - 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-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: - x-fern-examples: - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.getCollection("{collection_name}"); - - ' - language: typescript - - code-samples: - - code: 'use qdrant_client::client::QdrantClient; - - - let client = QdrantClient::from_url("http://localhost:6334").build()?; - - - client.collection_info("{collection_name}").await?; - - ' - language: rust - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.GetCollectionInfoAsync("{collection_name}"); - - ' - language: csharp - - 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: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.updateCollection(\"{collection_name}\", {\n optimizers_config:\ - \ {\n indexing_threshold: 10000,\n },\n});\n" - language: typescript - - code-samples: - - code: "use qdrant_client::{client::QdrantClient, qdrant::OptimizersConfigDiff};\n\ - \nlet client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ - \nclient\n .update_collection(\n \"{collection_name}\",\n \ - \ Some(&OptimizersConfigDiff {\n indexing_threshold: Some(10000),\n\ - \ ..Default::default()\n }),\n None,\n \ - \ None,\n None,\n None,\n None,\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.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 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 - put: - x-fern-examples: - - code-samples: - - code: "# Minimal curl command to create a collection with a vector field\n\ - \ncurl -X PUT http://localhost:6333/collections/collection_name \\\n \ - \ -H \"api-key: \" \\\n -H \"Content-Type: application/json\"\ - \ \\\n -d '{\n \"vectors\": {\n \"size\"\ - : 300,\n \"distance\": \"Cosine\"\n } \n \ - \ }'\n\n# Or with a sparse vector field\n\ncurl -X PUT http://localhost:6333/collections/collection_name\ - \ \\\n -H \"api-key: \" \\\n -H \"Content-Type: application/json\"\ - \ \\\n -d '{\n \"vectors\": {\n \"size\"\ - : 1536,\n \"distance\": \"Cosine\"\n },\n \ - \ \"sparse_vectors\": {\n \"splade-model-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" - language: typescript - - code-samples: - - code: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{vectors_config::Config,\ - \ CreateCollection, Distance, VectorParams, VectorsConfig},\n};\n\nlet\ - \ client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ - \nclient\n .create_collection(&CreateCollection {\n collection_name:\ - \ \"{collection_name}\".to_string(),\n vectors_config: Some(VectorsConfig\ - \ {\n config: Some(Config::Params(VectorParams {\n \ - \ size: 100,\n distance: Distance::Cosine.into(),\n\ - \ ..Default::default()\n })),\n }),\n\ - \ ..Default::default()\n })\n .await?;\n" - language: rust - - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.create_collection(\n collection_name=\"\ - {collection_name}\",\n vectors_config=models.VectorParams(size=100,\ - \ distance=models.Distance.COSINE),\n)\n" - language: python - - code-samples: - - code: "import 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" - language: java - /collections/{collection_name}/aliases: - get: - x-fern-examples: - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.getCollectionAliases("{collection_name}"); - - ' - language: typescript - - code-samples: - - code: 'use qdrant_client::client::QdrantClient; - - - let client = QdrantClient::from_url("http://localhost:6334").build()?; - - - client.list_collection_aliases("{collection_name}").await?; - - ' - language: rust - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ListCollectionAliasesAsync("{collection_name}"); - - ' - 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-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}/index: - put: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.createPayloadIndex(\"{collection_name}\", {\n field_name: \"{field_name}\"\ - ,\n field_schema: \"keyword\",\n});\n" - language: typescript - - code-samples: - - code: "use qdrant_client::{client::QdrantClient, qdrant::FieldType};\n\n\ - let client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ - \nclient\n.create_field_index(\n \"{collection_name}\",\n \"{field_name}\"\ - ,\n FieldType::Keyword,\n None,\n None,\n)\n.await?;\n" - language: rust - - 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: "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: - x-fern-examples: - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.deletePayloadIndex("{collection_name}", "{field_name}"); - - ' - language: typescript - - code-samples: - - code: "use qdrant_client::client::QdrantClient;\n\nlet client = QdrantClient::from_url(\"\ - http://localhost:6334\").build()?;\n\nclient\n .delete_field_index(\"\ - {collection_name}\", \"{field_name}\", None)\n .await?;\n" - language: rust - - 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: "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: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.retrieve(\"{collection_name}\", {\n ids: [0, 3, 100],\n});\n" - language: typescript - - code-samples: - - code: "use qdrant_client::client::QdrantClient;\n\nlet client = QdrantClient::from_url(\"\ - http://localhost:6334\").build()?;\n\nclient\n .get_points(\n \ - \ \"{collection_name}\",\n None,\n &[0.into(), 30.into(),\ - \ 100.into()],\n Some(false),\n Some(false),\n None,\n\ - \ )\n .await?;\n" - language: rust - - 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: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\ - \nclient\n .retrieveAsync(\"{collection_name}\", List.of(id(0), id(30),\ - \ id(100)), false, false, null)\n .get();\n" - language: java - put: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.upsert(\"{collection_name}\", {\n points: [\n {\n id:\ - \ 1,\n payload: { color: \"red\" },\n vector: [0.9, 0.1, 0.1],\n\ - \ },\n {\n id: 2,\n payload: { color: \"green\" },\n \ - \ vector: [0.1, 0.9, 0.1],\n },\n {\n id: 3,\n payload:\ - \ { color: \"blue\" },\n vector: [0.1, 0.1, 0.9],\n },\n ],\n\ - });\n" - language: typescript - - code-samples: - - code: "use qdrant_client::{client::QdrantClient, qdrant::PointStruct};\n\ - use serde_json::json;\n\nlet client = QdrantClient::from_url(\"http://localhost:6334\"\ - ).build()?;\n\nclient\n .upsert_points_batch_blocking(\n \"\ - {collection_name}\".to_string(),\n None,\n vec![\n \ - \ PointStruct::new(\n 1,\n vec![0.9,\ - \ 0.1, 0.1],\n json!(\n {\"color\":\ - \ \"red\"}\n )\n .try_into()\n \ - \ .unwrap(),\n ),\n PointStruct::new(\n \ - \ 2,\n vec![0.1, 0.9, 0.1],\n \ - \ json!(\n {\"color\": \"green\"}\n \ - \ )\n .try_into()\n .unwrap(),\n \ - \ ),\n PointStruct::new(\n 3,\n \ - \ vec![0.1, 0.1, 0.9],\n json!(\n \ - \ {\"color\": \"blue\"}\n )\n .try_into()\n\ - \ .unwrap(),\n ),\n ],\n None,\n\ - \ 100,\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.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 static io.qdrant.client.PointIdFactory.id;\nimport static\ - \ io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\ - \nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\n\ - import io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.PointStruct;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .upsertAsync(\n \ - \ \"{collection_name}\",\n List.of(\n PointStruct.newBuilder()\n\ - \ .setId(id(1))\n .setVectors(\n \ - \ namedVectors(\n Map.of(\n \ - \ \"image\",\n vector(List.of(0.9f,\ - \ 0.1f, 0.1f, 0.2f)),\n \"text\",\n \ - \ vector(List.of(0.4f, 0.7f, 0.1f, 0.8f, 0.1f, 0.1f,\ - \ 0.9f, 0.2f)))))\n .build(),\n PointStruct.newBuilder()\n\ - \ .setId(id(2))\n .setVectors(\n \ - \ namedVectors(\n Map.of(\n \ - \ \"image\",\n List.of(0.2f,\ - \ 0.1f, 0.3f, 0.9f),\n \"text\",\n \ - \ List.of(0.5f, 0.2f, 0.7f, 0.4f, 0.7f, 0.2f, 0.3f,\ - \ 0.9f))))\n .build()))\n .get();\n" - language: java - /collections/{collection_name}/points/batch: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "use qdrant_client::qdrant::{\n points_selector::PointsSelectorOneOf,\n\ - \ points_update_operation::{\n Operation, PointStructList, SetPayload,\ - \ UpdateVectors,\n },\n PointStruct, PointVectors, PointsIdsList,\ - \ PointsSelector, PointsUpdateOperation,\n};\n\nlet client = QdrantClient::from_url(\"\ - http://localhost:6334\").build()?;\n\nclient\n .batch_updates_blocking(\n\ - \ \"{collection_name}\",\n &[\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 \ - \ json!({}).try_into().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(SetPayload\ - \ {\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 None,\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.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 java.util.List;\nimport java.util.Map;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ - import static io.qdrant.client.ValueFactory.value;\nimport static io.qdrant.client.VectorsFactory.vectors;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Points.PointStruct;\nimport io.qdrant.client.grpc.Points.PointVectors;\n\ - import io.qdrant.client.grpc.Points.PointsIdsList;\nimport io.qdrant.client.grpc.Points.PointsSelector;\n\ - import io.qdrant.client.grpc.Points.PointsUpdateOperation;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation.PointStructList;\n\ - import io.qdrant.client.grpc.Points.PointsUpdateOperation.SetPayload;\n\ - import io.qdrant.client.grpc.Points.PointsUpdateOperation.UpdateVectors;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .batchUpdateAsync(\n\ - \ \"{collection_name}\",\n List.of(\n PointsUpdateOperation.newBuilder()\n\ - \ .setUpsert(\n PointStructList.newBuilder()\n\ - \ .addPoints(\n PointStruct.newBuilder()\n\ - \ .setId(id(1))\n .setVectors(vectors(\n\ - \ 1.0 f,\n 2.0 f,\n \ - \ 3.0 f,\n 4.0 f))\n \ - \ .build())\n .build())\n .build(),\n\ - \ PointsUpdateOperation.newBuilder()\n .setUpdateVectors(\n\ - \ UpdateVectors.newBuilder()\n .addPoints(\n\ - \ PointVectors.newBuilder()\n .setId(id(1))\n\ - \ .setVectors(vectors(\n 1.0\ - \ f,\n 2.0 f,\n 3.0 f,\n\ - \ 4.0 f))\n .build())\n \ - \ .build())\n .build(),\n PointsUpdateOperation.newBuilder()\n\ - \ .setSetPayload(\n SetPayload.newBuilder()\n\ - \ .setPointsSelector(\n PointsSelector.newBuilder()\n\ - \ .setPoints(PointsIdsList\n \ - \ .newBuilder()\n .addIds(id(1))\n \ - \ .build())\n .build())\n \ - \ .putAllPayload(\n Map.of(\"test_payload_2\",\n\ - \ value(2),\n \"test_payload_3\"\ - ,\n value(3)))\n .build())\n \ - \ .build()))\n .get();\n" - language: java - /collections/{collection_name}/points/count: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "use qdrant_client::{client::QdrantClient, qdrant::{Condition, CountPoints,\ - \ Filter}};\n\nlet client = QdrantClient::from_url(\"http://localhost:6334\"\ - ).build()?;\n\nclient\n .count(&CountPoints {\n collection_name:\ - \ \"{collection_name}\".to_string(),\n filter: Some(Filter::must([Condition::matches(\n\ - \ \"color\",\n \"red\".to_string(),\n )])),\n\ - \ exact: Some(true),\n ..Default::default()\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.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 static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ - import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Points.Filter;\n\nQdrantClient client =\ - \ new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\ - \nclient\n .countAsync(\n \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"\ - color\", \"red\")).build(),\n true)\n .get();\n" - language: java - /collections/{collection_name}/points/delete: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "use qdrant_client::{client::QdrantClient, qdrant::{points_selector::PointsSelectorOneOf,\ - \ Condition, Filter, PointsIdsList, PointsSelector}};\n\nlet client =\ - \ QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\nclient\n\ - \ .delete_points_blocking(\n \"{collection_name}\",\n \ - \ None,\n &PointsSelector {\n points_selector_one_of:\ - \ Some(PointsSelectorOneOf::Points(PointsIdsList {\n ids:\ - \ vec![0.into(), 3.into(), 100.into()],\n })),\n },\n\ - \ None,\n )\n .await?;\n\n client\n .delete_points_blocking(\n\ - \ \"{collection_name}\",\n None,\n &PointsSelector\ - \ {\n points_selector_one_of: Some(PointsSelectorOneOf::Filter(Filter::must([\n\ - \ Condition::matches(\"color\", \"red\".to_string()),\n\ - \ ]))),\n },\n None,\n )\n\ - \ .await?;\n" - language: rust - - 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: "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.Points.Filter;\n\nQdrantClient client =\ - \ new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\"\ - , 6334, false).build());\n\nclient.deleteAsync(\"{collection_name}\",\ - \ List.of(id(0), id(3), id(100)));\n\nclient\n .deleteAsync(\n \ - \ \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"\ - color\", \"red\")).build())\n .get();\n" - language: java - /collections/{collection_name}/points/discover: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{\n\ - \ target_vector::Target, vector_example::Example, ContextExamplePair,\ - \ DiscoverPoints,\n TargetVector, VectorExample,\n },\n};\n\n\ - let client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ - \nclient\n .discover(&DiscoverPoints {\n collection_name: \"\ - {collection_name}\".to_string(),\n target: Some(TargetVector {\n\ - \ target: Some(Target::Single(VectorExample {\n \ - \ example: Some(Example::Vector(vec![0.2, 0.1, 0.9, 0.7].into())),\n\ - \ })),\n }),\n context: vec![\n ContextExamplePair\ - \ {\n positive: Some(VectorExample {\n \ - \ example: Some(Example::Id(100.into())),\n }),\n \ - \ negative: Some(VectorExample {\n example:\ - \ Some(Example::Id(718.into())),\n }),\n },\n\ - \ ContextExamplePair {\n positive: Some(VectorExample\ - \ {\n example: Some(Example::Id(200.into())),\n \ - \ }),\n negative: Some(VectorExample {\n \ - \ example: Some(Example::Id(300.into())),\n \ - \ }),\n },\n ],\n limit: 10,\n ..Default::default()\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.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 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\ - import io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.ContextExamplePair;\n\ - import io.qdrant.client.grpc.Points.DiscoverPoints;\nimport io.qdrant.client.grpc.Points.TargetVector;\n\ - import 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 - /collections/{collection_name}/points/discover/batch: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{\n\ - \ target_vector::Target, vector_example::Example, ContextExamplePair,\ - \ DiscoverBatchPoints,\n DiscoverPoints, TargetVector, VectorExample,\n\ - \ },\n};\n\nlet client = QdrantClient::from_url(\"http://localhost:6334\"\ - ).build()?;\n\nlet discover_points = &DiscoverBatchPoints {\n collection_name:\ - \ \"{collection_name}\".to_string(),\n discover_points: vec![\n \ - \ DiscoverPoints {\n collection_name: \"{collection_name}\"\ - .to_string(),\n target: Some(TargetVector {\n \ - \ target: Some(Target::Single(VectorExample {\n example:\ - \ Some(Example::Vector(vec![0.2, 0.1, 0.9, 0.7].into())),\n \ - \ })),\n }),\n context: vec![\n \ - \ ContextExamplePair {\n positive: Some(VectorExample\ - \ {\n example: Some(Example::Id(100.into())),\n\ - \ }),\n negative: Some(VectorExample\ - \ {\n example: Some(Example::Id(718.into())),\n\ - \ }),\n },\n ContextExamplePair\ - \ {\n positive: Some(VectorExample {\n \ - \ example: Some(Example::Id(200.into())),\n \ - \ }),\n negative: Some(VectorExample {\n \ - \ example: Some(Example::Id(300.into())),\n \ - \ }),\n },\n ],\n limit:\ - \ 10,\n ..Default::default()\n },\n DiscoverPoints\ - \ {\n collection_name: \"{collection_name}\".to_string(),\n\ - \ target: Some(TargetVector {\n target: Some(Target::Single(VectorExample\ - \ {\n example: Some(Example::Vector(vec![0.5, 0.3,\ - \ 0.2, 0.3].into())),\n })),\n }),\n \ - \ context: vec![\n ContextExamplePair {\n \ - \ positive: Some(VectorExample {\n example:\ - \ Some(Example::Id(342.into())),\n }),\n \ - \ negative: Some(VectorExample {\n example:\ - \ Some(Example::Id(213.into())),\n }),\n \ - \ },\n ContextExamplePair {\n positive:\ - \ Some(VectorExample {\n example: Some(Example::Id(100.into())),\n\ - \ }),\n negative: Some(VectorExample\ - \ {\n example: Some(Example::Id(200.into())),\n\ - \ }),\n },\n ],\n \ - \ limit: 10,\n ..Default::default()\n },\n ],\n\ - \ ..Default::default()\n};\n\nclient.discover_batch(discover_points).await?;\n" - language: rust - - 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: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ - \ io.qdrant.client.VectorFactory.vector;\n\nimport java.util.Arrays;\n\ - import java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport\ - \ io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.ContextExamplePair;\n\ - import io.qdrant.client.grpc.Points.DiscoverPoints;\nimport io.qdrant.client.grpc.Points.TargetVector;\n\ - import 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 - /collections/{collection_name}/points/payload: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "use qdrant_client::{client::QdrantClient, qdrant::{\n points_selector::PointsSelectorOneOf,\ - \ PointsIdsList, PointsSelector,\n}};\n\nlet client = QdrantClient::from_url(\"\ - http://localhost:6334\").build()?;\n\nclient\n .set_payload_blocking(\n\ - \ \"{collection_name}\",\n None,\n &PointsSelector\ - \ {\n points_selector_one_of: Some(PointsSelectorOneOf::Points(PointsIdsList\ - \ {\n ids: vec![0.into(), 3.into(), 10.into()],\n \ - \ })),\n },\n json!({\n \"property1\":\ - \ \"string\",\n \"property2\": \"string\",\n })\n \ - \ .try_into()\n .unwrap(),\n None,\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.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 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 - put: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.overwritePayload(\"{collection_name}\", {\n payload: {\n property1:\ - \ \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n\ - });\n" - language: typescript - - code-samples: - - code: "use qdrant_client::{client::QdrantClient, qdrant::{\n points_selector::PointsSelectorOneOf,\ - \ PointsIdsList, PointsSelector,\n}};\n\nlet client = QdrantClient::from_url(\"\ - http://localhost:6334\").build()?;\n\nclient\n .overwrite_payload_blocking(\n\ - \ \"{collection_name}\",\n None,\n &PointsSelector\ - \ {\n points_selector_one_of: Some(PointsSelectorOneOf::Points(PointsIdsList\ - \ {\n ids: vec![0.into(), 3.into(), 10.into()],\n \ - \ })),\n },\n json!({\n \"property1\":\ - \ \"string\",\n \"property2\": \"string\",\n })\n \ - \ .try_into()\n .unwrap(),\n None,\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.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 java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ - import static io.qdrant.client.ValueFactory.value;\n\nimport io.qdrant.client.QdrantClient;\n\ - import io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new\ - \ QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\"\ - , 6334, false).build());\n\nclient\n .overwritePayloadAsync(\n \ - \ \"{collection_name}\",\n Map.of(\"property1\", value(\"string\"\ - ), \"property2\", value(\"string\")),\n List.of(id(0), id(3), id(10)),\n\ - \ true,\n null,\n null)\n .get();\n" - language: java - /collections/{collection_name}/points/payload/clear: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.clearPayload(\"{collection_name}\", {\n points: [0, 3, 100],\n\ - });\n" - language: typescript - - code-samples: - - code: "use qdrant_client::{client::QdrantClient, qdrant::{\n points_selector::PointsSelectorOneOf,\ - \ PointsIdsList, PointsSelector,\n}};\n\nlet client = QdrantClient::from_url(\"\ - http://localhost:6334\").build()?;\n\nclient\n .clear_payload(\n \ - \ \"{collection_name}\",\n None,\n Some(PointsSelector\ - \ {\n points_selector_one_of: Some(PointsSelectorOneOf::Points(PointsIdsList\ - \ {\n ids: vec![0.into(), 3.into(), 100.into()],\n \ - \ })),\n }),\n None,\n )\n .await?;\n" - language: rust - - 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: "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: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.deletePayload(\"{collection_name}\", {\n keys: [\"color\", \"\ - price\"],\n points: [0, 3, 100],\n});\n" - language: typescript - - code-samples: - - code: "use qdrant_client::{client::QdrantClient, qdrant::{\n points_selector::PointsSelectorOneOf,\ - \ PointsIdsList, PointsSelector,\n}};\n\nlet client = QdrantClient::from_url(\"\ - http://localhost:6334\").build()?;\n\nclient\n .delete_payload_blocking(\n\ - \ \"{collection_name}\",\n None,\n &PointsSelector\ - \ {\n points_selector_one_of: Some(PointsSelectorOneOf::Points(PointsIdsList\ - \ {\n ids: vec![0.into(), 3.into(), 100.into()],\n \ - \ })),\n },\n vec![\"color\".to_string(), \"price\"\ - .to_string()],\n None,\n )\n .await?;\n" - language: rust - - 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: "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 - /collections/{collection_name}/points/recommend: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{Condition,\ - \ Filter, RecommendPoints, RecommendStrategy},\n};\n\nlet client = QdrantClient::from_url(\"\ - http://localhost:6334\").build()?;\n\nclient\n .recommend(&RecommendPoints\ - \ {\n collection_name: \"{collection_name}\".to_string(),\n \ - \ positive: vec![100.into(), 200.into()],\n positive_vectors:\ - \ vec![vec![100.0, 231.0].into()],\n negative: vec![718.into()],\n\ - \ negative_vectors: vec![vec![0.2, 0.3, 0.4, 0.5].into()],\n \ - \ strategy: Some(RecommendStrategy::AverageVector.into()),\n \ - \ filter: Some(Filter::must([Condition::matches(\n \"city\"\ - ,\n \"London\".to_string(),\n )])),\n limit:\ - \ 3,\n ..Default::default()\n })\n .await?;\n" - language: rust - - 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: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ - import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.RecommendPoints;\n\ - import io.qdrant.client.grpc.Points.RecommendStrategy;\n\nQdrantClient\ - \ client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\"\ - , 6334, false).build());\n\nclient\n .recommendAsync(\n RecommendPoints.newBuilder()\n\ - \ .setCollectionName(\"{collection_name}\")\n .addAllPositive(List.of(id(100),\ - \ id(200)))\n .addAllPositiveVectors(List.of(vector(100.0f,\ - \ 231.0f)))\n .addAllNegative(List.of(id(718)))\n \ - \ .addAllPositiveVectors(List.of(vector(0.2f, 0.3f, 0.4f, 0.5f)))\n\ - \ .setStrategy(RecommendStrategy.AverageVector)\n \ - \ .setFilter(Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\"\ - )))\n .setLimit(3)\n .build())\n .get();\n" - language: java - /collections/{collection_name}/points/recommend/batch: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{Condition,\ - \ Filter, RecommendBatchPoints, RecommendPoints},\n};\n\nlet client =\ - \ QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\nlet filter\ - \ = Filter::must([Condition::matches(\"city\", \"London\".to_string())]);\n\ - \nlet recommend_queries = vec![\n RecommendPoints {\n collection_name:\ - \ \"{collection_name}\".to_string(),\n positive: vec![100.into(),\ - \ 231.into()],\n negative: vec![718.into()],\n filter: Some(filter.clone()),\n\ - \ limit: 3,\n ..Default::default()\n },\n RecommendPoints\ - \ {\n collection_name: \"{collection_name}\".to_string(),\n \ - \ positive: vec![200.into(), 67.into()],\n negative: vec![300.into()],\n\ - \ filter: Some(filter),\n limit: 3,\n ..Default::default()\n\ - \ },\n];\n\nclient\n .recommend_batch(&RecommendBatchPoints {\n\ - \ collection_name: \"{collection_name}\".to_string(),\n \ - \ recommend_points: recommend_queries,\n ..Default::default()\n\ - \ })\n .await?;\n" - language: rust - - 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: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ - import static io.qdrant.client.PointIdFactory.id;\n\nimport io.qdrant.client.QdrantClient;\n\ - import io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\n\ - import io.qdrant.client.grpc.Points.RecommendPoints;\n\nQdrantClient client\ - \ =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334,\ - \ false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"\ - city\", \"London\")).build();\n\nList recommendQueries\ - \ =\n List.of(\n RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(100),\ - \ id(231)))\n .addAllNegative(List.of(id(718)))\n \ - \ .setFilter(filter)\n .setLimit(3)\n .build(),\n\ - \ RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(200),\ - \ id(67)))\n .addAllNegative(List.of(id(300)))\n \ - \ .setFilter(filter)\n .setLimit(3)\n .build());\n\ - \nclient.recommendBatchAsync(\"{collection_name}\", recommendQueries,\ - \ null).get();\n" - language: java - /collections/{collection_name}/points/recommend/groups: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{RecommendPointGroups,\ - \ RecommendStrategy},\n};\n\nlet client = QdrantClient::from_url(\"http://localhost:6334\"\ - ).build()?;\n\nclient\n .recommend_groups(&RecommendPointGroups {\n\ - \ collection_name: \"{collection_name}\".to_string(),\n \ - \ group_by: \"document_id\".to_string(),\n group_size: 2,\n \ - \ positive: vec![100.into(), 200.into()],\n negative: vec![718.into()],\n\ - \ strategy: Some(RecommendStrategy::AverageVector.into()),\n \ - \ limit: 3,\n ..Default::default()\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.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 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: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.scroll(\"{collection_name}\", {\n filter: {\n must: [\n\ - \ {\n key: \"color\",\n match:\ - \ {\n value: \"red\",\n },\n \ - \ },\n ],\n },\n limit: 1,\n with_payload: true,\n\ - \ with_vector: false,\n});\n" - language: typescript - - code-samples: - - code: "use qdrant_client::{client::QdrantClient, qdrant::{Condition, Filter,\ - \ ScrollPoints}};\n\nlet client = QdrantClient::from_url(\"http://localhost:6334\"\ - ).build()?;\n\nclient\n .scroll(&ScrollPoints {\n collection_name:\ - \ \"{collection_name}\".to_string(),\n filter: Some(Filter::must([Condition::matches(\n\ - \ \"color\",\n \"red\".to_string(),\n )])),\n\ - \ limit: Some(1),\n with_payload: Some(true.into()),\n \ - \ with_vectors: Some(false.into()),\n ..Default::default()\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 static io.qdrant.client.ConditionFactory.matchKeyword;\nimport\ - \ static io.qdrant.client.WithPayloadSelectorFactory.enable;\n\nimport\ - \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.ScrollPoints;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .scrollAsync(\n \ - \ ScrollPoints.newBuilder()\n .setCollectionName(\"{collection_name}\"\ - )\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"\ - color\", \"red\")).build())\n .setLimit(1)\n .setWithPayload(enable(true))\n\ - \ .build())\n .get();\n" - language: java - /collections/{collection_name}/points/search: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{Condition,\ - \ Filter, SearchParams, SearchPoints},\n};\n\nlet client = QdrantClient::from_url(\"\ - http://localhost:6334\").build()?;\n\nclient\n .search_points(&SearchPoints\ - \ {\n collection_name: \"{collection_name}\".to_string(),\n \ - \ filter: Some(Filter::must([Condition::matches(\n \"city\"\ - ,\n \"London\".to_string(),\n )])),\n params:\ - \ Some(SearchParams {\n hnsw_ef: Some(128),\n exact:\ - \ Some(false),\n ..Default::default()\n }),\n \ - \ vector: vec![0.2, 0.1, 0.9, 0.7],\n limit: 3,\n ..Default::default()\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.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 static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ - import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .searchAsync(\n \ - \ SearchPoints.newBuilder()\n .setCollectionName(\"{collection_name}\"\ - )\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"\ - city\", \"London\")).build())\n .addAllVector(List.of(0.2f,\ - \ 0.1f, 0.9f, 0.7f))\n .setLimit(3)\n .build())\n\ - \ .get();\n" - language: java - /collections/{collection_name}/points/search/batch: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{Condition,\ - \ Filter, SearchBatchPoints, SearchPoints},\n};\n\nlet client = QdrantClient::from_url(\"\ - http://localhost:6334\").build()?;\n\nlet filter = Filter::must([Condition::matches(\"\ - city\", \"London\".to_string())]);\n\nlet searches = vec![\n SearchPoints\ - \ {\n collection_name: \"{collection_name}\".to_string(),\n \ - \ vector: vec![0.2, 0.1, 0.9, 0.7],\n filter: Some(filter.clone()),\n\ - \ limit: 3,\n ..Default::default()\n },\n SearchPoints\ - \ {\n collection_name: \"{collection_name}\".to_string(),\n \ - \ vector: vec![0.5, 0.3, 0.2, 0.3],\n filter: Some(filter),\n\ - \ limit: 3,\n ..Default::default()\n },\n];\n\nclient\n\ - \ .search_batch_points(&SearchBatchPoints {\n collection_name:\ - \ \"{collection_name}\".to_string(),\n search_points: searches,\n\ - \ read_consistency: None,\n ..Default::default()\n })\n\ - \ .await?;\n" - language: rust - - 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: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\ - \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"\ - city\", \"London\")).build();\nList searches =\n List.of(\n\ - \ SearchPoints.newBuilder()\n .addAllVector(List.of(0.2f,\ - \ 0.1f, 0.9f, 0.7f))\n .setFilter(filter)\n .setLimit(3)\n\ - \ .build(),\n SearchPoints.newBuilder()\n \ - \ .addAllVector(List.of(0.5f, 0.3f, 0.2f, 0.3f))\n .setFilter(filter)\n\ - \ .setLimit(3)\n .build());\nclient.searchBatchAsync(\"\ - {collection_name}\", searches, null).get();\n" - language: java - /collections/{collection_name}/points/search/groups: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::SearchPointGroups,\n\ - };\n\nlet client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ - \nclient\n .search_groups(&SearchPointGroups {\n collection_name:\ - \ \"{collection_name}\".to_string(),\n vector: vec![1.1],\n \ - \ group_by: \"document_id\".to_string(),\n limit: 4,\n \ - \ group_size: 2,\n ..Default::default()\n })\n .await?;\n" - language: rust - - 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: "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/vectors: - put: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.updateVectors(\"{collection_name}\", {\n points: [\n \ - \ {\n id: 1,\n vector: {\n image:\ - \ [0.1, 0.2, 0.3, 0.4],\n },\n },\n {\n \ - \ id: 2,\n vector: {\n text: [0.9, 0.8,\ - \ 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n },\n ],\n\ - });\n" - language: typescript - - code-samples: - - code: "use qdrant_client::qdrant::PointVectors;\nuse std::collections::HashMap;\n\ - \nclient\n .update_vectors_blocking(\n \"{collection_name}\"\ - ,\n None,\n &[\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])]).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 None,\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.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 static io.qdrant.client.PointIdFactory.id;\nimport static\ - \ io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\ - \nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\n\ - import io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new\ - \ QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\"\ - , 6334, false).build());\n\nclient\n .updateVectorsAsync(\n \ - \ \"{collection_name}\",\n List.of(\n PointVectors.newBuilder()\n\ - \ .setId(id(1))\n .setVectors(namedVectors(Map.of(\"\ - image\", vector(List.of(0.1f, 0.2f, 0.3f, 0.4f)))))\n .build(),\n\ - \ PointVectors.newBuilder()\n .setId(id(2))\n\ - \ .setVectors(\n namedVectors(\n \ - \ Map.of(\n \"text\", vector(List.of(0.9f,\ - \ 0.8f, 0.7f, 0.6f, 0.5f, 0.4f, 0.3f, 0.2f)))))\n .build()))\n\ - \ .get();\n" - language: java - /collections/{collection_name}/points/vectors/delete: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.deleteVectors(\"{collection_name}\", {\n points: [0, 3, 10],\n\ - \ vectors: [\"text\", \"image\"],\n});\n" - language: typescript - - code-samples: - - code: "use qdrant_client::{client::QdrantClient, qdrant::{\n points_selector::PointsSelectorOneOf,\ - \ PointsIdsList, PointsSelector, VectorsSelector,\n}};\n\nlet client =\ - \ QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\nclient\n\ - \ .delete_vectors_blocking(\n \"{collection_name}\",\n \ - \ None,\n &PointsSelector {\n points_selector_one_of:\ - \ Some(PointsSelectorOneOf::Points(PointsIdsList {\n ids:\ - \ vec![0.into(), 3.into(), 10.into()],\n })),\n },\n\ - \ &VectorsSelector {\n names: vec![\"text\".into(),\ - \ \"image\".into()],\n },\n None,\n )\n .await?;\n" - language: rust - - 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: "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 - /collections/{collection_name}/shards: - put: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n\ - });\n\nclient.createShardKey(\"{collection_name}\", {\n shard_key:\ - \ \"{shard_key}\"\n});\n" - language: typescript - - code-samples: - - code: "use qdrant_client::{client::QdrantClient, qdrant::shard_key::Key};\n\ - \nlet client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ - \nclient\n .create_shard_key(\n \"{collection_name}\",\n \ - \ &Key::Keyword(\"{shard_key\".to_string()),\n None,\n \ - \ None,\n &[],\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.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 - - - client = QdrantClient(url="http://localhost:6333") - - - client.create_shard_key("{collection_name}", "{shard_key}") - - ' - 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.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 - /collections/{collection_name}/shards/delete: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n\ - });\n\nclient.deleteShardKey(\"{collection_name}\", {\n shard_key:\ - \ \"{shard_key}\"\n});\n" - language: typescript - - code-samples: - - code: "use qdrant_client::{client::QdrantClient, qdrant::shard_key::Key};\n\ - \nlet client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ - \nclient\n .delete_shard_key(\"{collection_name}\", &Key::Keyword(\"\ - {shard_key\".to_string()))\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.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 - - - client = QdrantClient(url="http://localhost:6333") - - - client.delete_shard_key("{collection_name}", "{shard_key}") - - ' - 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.deleteShardKeyAsync(DeleteShardKeyRequest.newBuilder()\n\ - \ .setCollectionName(\"{collection_name}\")\n \ - \ .setRequest(DeleteShardKey.newBuilder()\n \ - \ .setShardKey(shardKey(\"{shard_key}\"))\n \ - \ .build())\n .build()).get();\n" - language: java - /collections/{collection_name}/snapshots: - get: - x-fern-examples: - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.listSnapshots("{collection_name}"); - - ' - language: typescript - - code-samples: - - code: 'use qdrant_client::client::QdrantClient; - - - let client = QdrantClient::from_url("http://localhost:6334").build()?; - - - client.list_snapshots("{collection_name}").await?; - - ' - language: rust - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ListSnapshotsAsync("{collection_name}"); - - ' - 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-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 - post: - x-fern-examples: - - 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: 'use qdrant_client::client::QdrantClient; - - - let client = QdrantClient::from_url("http://localhost:6334").build()?; - - - client.create_snapshot("{collection_name}").await?; - - ' - language: rust - - 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 - - - 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: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.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/{snapshot_name}: - delete: - x-fern-examples: - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.deleteSnapshot("{collection_name}", "{snapshot_name}"); - - ' - language: typescript - - code-samples: - - code: "use qdrant_client::client::QdrantClient;\n\nlet client = QdrantClient::from_url(\"\ - http://localhost:6334\").build()?;\n\nclient\n .delete_snapshot(\"\ - {collection_name}\", \"{snapshot_name}\")\n .await?;\n" - language: rust - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.DeleteSnapshotAsync("{collection_name}", "{snapshot_name}"); - - ' - 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 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 - /snapshots: - get: - x-fern-examples: - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.listFullSnapshots(); - - ' - language: typescript - - code-samples: - - code: 'use qdrant_client::client::QdrantClient; - - - let client = QdrantClient::from_url("http://localhost:6334").build()?; - - - client.list_full_snapshots().await?; - - ' - language: rust - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ListFullSnapshotsAsync(); - - ' - language: csharp - - 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: - x-fern-examples: - - 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: 'use qdrant_client::client::QdrantClient; - - - let client = QdrantClient::from_url("http://localhost:6334").build()?; - - - client.create_full_snapshot().await?; - - ' - language: rust - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.CreateFullSnapshotAsync(); - - ' - language: csharp - - 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: - x-fern-examples: - - 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: 'use qdrant_client::client::QdrantClient; - - - let client = QdrantClient::from_url("http://localhost:6334").build()?; - - - client.delete_full_snapshot("{snapshot_name}").await?; - - ' - language: rust - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.DeleteFullSnapshotAsync("{snapshot_name}"); - - ' - 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-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 From 554e011586bc4dfe078c8f14d008a849948dbdc0 Mon Sep 17 00:00:00 2001 From: generall Date: Wed, 15 May 2024 00:38:05 +0200 Subject: [PATCH 5/8] fix Ci --- .github/workflows/preview.yml | 8 ++++++-- .github/workflows/sync.yml | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 5ea7454..f3a7d64 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -1,10 +1,14 @@ name: preview-docs -on: pull_request +on: + workflow_run: + workflows: ["sync-openapi"] + # branches: [main] + types: + - completed jobs: run: - needs: sync-openapi runs-on: ubuntu-latest permissions: write-all steps: diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 32581ad..290ae6f 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -35,4 +35,3 @@ jobs: commit_message: "Sync OpenAPI" commit_user_name: "GitHub Actions" commit_user_email: "team@qdrant.com" - file_pattern: 'fern/*.yml' From 0dc97e00eddbf0a68fb31ea9d1c1e7ede4679638 Mon Sep 17 00:00:00 2001 From: generall Date: Tue, 14 May 2024 22:38:23 +0000 Subject: [PATCH 6/8] Sync OpenAPI --- fern/apis/master/openapi-overrides.yml | 2 +- overwrite-snippets.yml | 2077 ++++++++++++++++++++++++ qdrant | 1 + 3 files changed, 2079 insertions(+), 1 deletion(-) create mode 100644 overwrite-snippets.yml create mode 160000 qdrant diff --git a/fern/apis/master/openapi-overrides.yml b/fern/apis/master/openapi-overrides.yml index 6005245..b890f10 100644 --- a/fern/apis/master/openapi-overrides.yml +++ b/fern/apis/master/openapi-overrides.yml @@ -266,7 +266,7 @@ paths: put: x-fern-examples: - code-samples: - - code: "# Minimal curl command to create a collection with a vector field\n\ncurl -X PUT http://localhost:6333/collections/collection_name \\\n -H \"api-key: \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"vectors\": {\n \"size\": 300,\n \"distance\": \"Cosine\"\n } \n }'\n\n# Or with a sparse vector field\n\ncurl -X PUT http://localhost:6333/collections/collection_name \\\n -H \"api-key: \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"vectors\": {\n \"size\": 300,\n \"distance\": \"Cosine\"\n },\n \"sparse_vectors\": {\n \"splade-model-name\": {\n \"index\": {\n \"on_disk\": true\n }\n }\n }\n }'\n" + - code: "# Minimal curl command to create a collection with a vector field\n\ncurl -X PUT http://localhost:6333/collections/collection_name \\\n -H \"api-key: \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"vectors\": {\n \"size\": 300,\n \"distance\": \"Cosine\"\n } \n }'\n\n# Or with a sparse vector field\n\ncurl -X PUT http://localhost:6333/collections/collection_name \\\n -H \"api-key: \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"vectors\": {\n \"size\": 1536,\n \"distance\": \"Cosine\"\n },\n \"sparse_vectors\": {\n \"splade-model-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\nclient.createCollection(\"{collection_name}\", {\n vectors: { size: 100, distance: \"Cosine\" },\n});\n" diff --git a/overwrite-snippets.yml b/overwrite-snippets.yml new file mode 100644 index 0000000..07ecd0f --- /dev/null +++ b/overwrite-snippets.yml @@ -0,0 +1,2077 @@ +paths: + /aliases: + get: + x-fern-examples: + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.getAliases(); + + ' + language: typescript + - code-samples: + - code: 'use qdrant_client::client::QdrantClient; + + + let client = QdrantClient::from_url("http://localhost:6334").build()?; + + + client.list_aliases().await?; + + ' + language: rust + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ListAliasesAsync(); + + ' + language: csharp + - 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 + /collections: + get: + x-fern-examples: + - 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: 'use qdrant_client::client::QdrantClient; + + + let client = QdrantClient::from_url("http://localhost:6334").build()?; + + + client.list_collections().await?; + + ' + language: rust + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ListCollectionsAsync(); + + ' + language: csharp + - 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: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.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: 'use qdrant_client::client::QdrantClient; + + + let client = QdrantClient::from_url("http://localhost:6334").build()?; + + + client.create_alias("example_collection", "production_collection").await?; + + + client.delete_alias("production_collection").await?; + + ' + language: rust + - 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: "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: + x-fern-examples: + - code-samples: + - code: 'import { QdrantClient } from ''@qdrant/qdrant-js''; + + + const client = new QdrantClient({url: ''http://127.0.0.1:6333''}); + + + client.deleteCollection("{collection_name}"); + + ' + language: typescript + - code-samples: + - code: 'use qdrant_client::client::QdrantClient; + + + let client = QdrantClient::from_url("http://localhost:6334").build()?; + + + client.delete_collection("{collection_name}").await?; + + ' + language: rust + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.DeleteCollectionAsync("{collection_name}"); + + ' + 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-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: + x-fern-examples: + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.getCollection("{collection_name}"); + + ' + language: typescript + - code-samples: + - code: 'use qdrant_client::client::QdrantClient; + + + let client = QdrantClient::from_url("http://localhost:6334").build()?; + + + client.collection_info("{collection_name}").await?; + + ' + language: rust + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.GetCollectionInfoAsync("{collection_name}"); + + ' + language: csharp + - 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: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.updateCollection(\"{collection_name}\", {\n optimizers_config:\ + \ {\n indexing_threshold: 10000,\n },\n});\n" + language: typescript + - code-samples: + - code: "use qdrant_client::{client::QdrantClient, qdrant::OptimizersConfigDiff};\n\ + \nlet client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ + \nclient\n .update_collection(\n \"{collection_name}\",\n \ + \ Some(&OptimizersConfigDiff {\n indexing_threshold: Some(10000),\n\ + \ ..Default::default()\n }),\n None,\n \ + \ None,\n None,\n None,\n None,\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.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 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 + put: + x-fern-examples: + - code-samples: + - code: "# Minimal curl command to create a collection with a vector field\n\ + \ncurl -X PUT http://localhost:6333/collections/collection_name \\\n \ + \ -H \"api-key: \" \\\n -H \"Content-Type: application/json\"\ + \ \\\n -d '{\n \"vectors\": {\n \"size\"\ + : 300,\n \"distance\": \"Cosine\"\n } \n \ + \ }'\n\n# Or with a sparse vector field\n\ncurl -X PUT http://localhost:6333/collections/collection_name\ + \ \\\n -H \"api-key: \" \\\n -H \"Content-Type: application/json\"\ + \ \\\n -d '{\n \"vectors\": {\n \"size\"\ + : 1536,\n \"distance\": \"Cosine\"\n },\n \ + \ \"sparse_vectors\": {\n \"splade-model-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" + language: typescript + - code-samples: + - code: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{vectors_config::Config,\ + \ CreateCollection, Distance, VectorParams, VectorsConfig},\n};\n\nlet\ + \ client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ + \nclient\n .create_collection(&CreateCollection {\n collection_name:\ + \ \"{collection_name}\".to_string(),\n vectors_config: Some(VectorsConfig\ + \ {\n config: Some(Config::Params(VectorParams {\n \ + \ size: 100,\n distance: Distance::Cosine.into(),\n\ + \ ..Default::default()\n })),\n }),\n\ + \ ..Default::default()\n })\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.create_collection(\n collection_name=\"\ + {collection_name}\",\n vectors_config=models.VectorParams(size=100,\ + \ distance=models.Distance.COSINE),\n)\n" + language: python + - code-samples: + - code: "import 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" + language: java + /collections/{collection_name}/aliases: + get: + x-fern-examples: + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.getCollectionAliases("{collection_name}"); + + ' + language: typescript + - code-samples: + - code: 'use qdrant_client::client::QdrantClient; + + + let client = QdrantClient::from_url("http://localhost:6334").build()?; + + + client.list_collection_aliases("{collection_name}").await?; + + ' + language: rust + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ListCollectionAliasesAsync("{collection_name}"); + + ' + 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-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}/index: + put: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.createPayloadIndex(\"{collection_name}\", {\n field_name: \"{field_name}\"\ + ,\n field_schema: \"keyword\",\n});\n" + language: typescript + - code-samples: + - code: "use qdrant_client::{client::QdrantClient, qdrant::FieldType};\n\n\ + let client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ + \nclient\n.create_field_index(\n \"{collection_name}\",\n \"{field_name}\"\ + ,\n FieldType::Keyword,\n None,\n None,\n)\n.await?;\n" + language: rust + - 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: "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: + x-fern-examples: + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.deletePayloadIndex("{collection_name}", "{field_name}"); + + ' + language: typescript + - code-samples: + - code: "use qdrant_client::client::QdrantClient;\n\nlet client = QdrantClient::from_url(\"\ + http://localhost:6334\").build()?;\n\nclient\n .delete_field_index(\"\ + {collection_name}\", \"{field_name}\", None)\n .await?;\n" + language: rust + - 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: "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: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.retrieve(\"{collection_name}\", {\n ids: [0, 3, 100],\n});\n" + language: typescript + - code-samples: + - code: "use qdrant_client::client::QdrantClient;\n\nlet client = QdrantClient::from_url(\"\ + http://localhost:6334\").build()?;\n\nclient\n .get_points(\n \ + \ \"{collection_name}\",\n None,\n &[0.into(), 30.into(),\ + \ 100.into()],\n Some(false),\n Some(false),\n None,\n\ + \ )\n .await?;\n" + language: rust + - 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: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\ + \nclient\n .retrieveAsync(\"{collection_name}\", List.of(id(0), id(30),\ + \ id(100)), false, false, null)\n .get();\n" + language: java + put: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.upsert(\"{collection_name}\", {\n points: [\n {\n id:\ + \ 1,\n payload: { color: \"red\" },\n vector: [0.9, 0.1, 0.1],\n\ + \ },\n {\n id: 2,\n payload: { color: \"green\" },\n \ + \ vector: [0.1, 0.9, 0.1],\n },\n {\n id: 3,\n payload:\ + \ { color: \"blue\" },\n vector: [0.1, 0.1, 0.9],\n },\n ],\n\ + });\n" + language: typescript + - code-samples: + - code: "use qdrant_client::{client::QdrantClient, qdrant::PointStruct};\n\ + use serde_json::json;\n\nlet client = QdrantClient::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .upsert_points_batch_blocking(\n \"\ + {collection_name}\".to_string(),\n None,\n vec![\n \ + \ PointStruct::new(\n 1,\n vec![0.9,\ + \ 0.1, 0.1],\n json!(\n {\"color\":\ + \ \"red\"}\n )\n .try_into()\n \ + \ .unwrap(),\n ),\n PointStruct::new(\n \ + \ 2,\n vec![0.1, 0.9, 0.1],\n \ + \ json!(\n {\"color\": \"green\"}\n \ + \ )\n .try_into()\n .unwrap(),\n \ + \ ),\n PointStruct::new(\n 3,\n \ + \ vec![0.1, 0.1, 0.9],\n json!(\n \ + \ {\"color\": \"blue\"}\n )\n .try_into()\n\ + \ .unwrap(),\n ),\n ],\n None,\n\ + \ 100,\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.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 static io.qdrant.client.PointIdFactory.id;\nimport static\ + \ io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\ + \nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\n\ + import io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.PointStruct;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .upsertAsync(\n \ + \ \"{collection_name}\",\n List.of(\n PointStruct.newBuilder()\n\ + \ .setId(id(1))\n .setVectors(\n \ + \ namedVectors(\n Map.of(\n \ + \ \"image\",\n vector(List.of(0.9f,\ + \ 0.1f, 0.1f, 0.2f)),\n \"text\",\n \ + \ vector(List.of(0.4f, 0.7f, 0.1f, 0.8f, 0.1f, 0.1f,\ + \ 0.9f, 0.2f)))))\n .build(),\n PointStruct.newBuilder()\n\ + \ .setId(id(2))\n .setVectors(\n \ + \ namedVectors(\n Map.of(\n \ + \ \"image\",\n List.of(0.2f,\ + \ 0.1f, 0.3f, 0.9f),\n \"text\",\n \ + \ List.of(0.5f, 0.2f, 0.7f, 0.4f, 0.7f, 0.2f, 0.3f,\ + \ 0.9f))))\n .build()))\n .get();\n" + language: java + /collections/{collection_name}/points/batch: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + 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: "use qdrant_client::qdrant::{\n points_selector::PointsSelectorOneOf,\n\ + \ points_update_operation::{\n Operation, PointStructList, SetPayload,\ + \ UpdateVectors,\n },\n PointStruct, PointVectors, PointsIdsList,\ + \ PointsSelector, PointsUpdateOperation,\n};\n\nlet client = QdrantClient::from_url(\"\ + http://localhost:6334\").build()?;\n\nclient\n .batch_updates_blocking(\n\ + \ \"{collection_name}\",\n &[\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 \ + \ json!({}).try_into().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(SetPayload\ + \ {\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 None,\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.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 java.util.List;\nimport java.util.Map;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ + import static io.qdrant.client.ValueFactory.value;\nimport static io.qdrant.client.VectorsFactory.vectors;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.PointStruct;\nimport io.qdrant.client.grpc.Points.PointVectors;\n\ + import io.qdrant.client.grpc.Points.PointsIdsList;\nimport io.qdrant.client.grpc.Points.PointsSelector;\n\ + import io.qdrant.client.grpc.Points.PointsUpdateOperation;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation.PointStructList;\n\ + import io.qdrant.client.grpc.Points.PointsUpdateOperation.SetPayload;\n\ + import io.qdrant.client.grpc.Points.PointsUpdateOperation.UpdateVectors;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .batchUpdateAsync(\n\ + \ \"{collection_name}\",\n List.of(\n PointsUpdateOperation.newBuilder()\n\ + \ .setUpsert(\n PointStructList.newBuilder()\n\ + \ .addPoints(\n PointStruct.newBuilder()\n\ + \ .setId(id(1))\n .setVectors(vectors(\n\ + \ 1.0 f,\n 2.0 f,\n \ + \ 3.0 f,\n 4.0 f))\n \ + \ .build())\n .build())\n .build(),\n\ + \ PointsUpdateOperation.newBuilder()\n .setUpdateVectors(\n\ + \ UpdateVectors.newBuilder()\n .addPoints(\n\ + \ PointVectors.newBuilder()\n .setId(id(1))\n\ + \ .setVectors(vectors(\n 1.0\ + \ f,\n 2.0 f,\n 3.0 f,\n\ + \ 4.0 f))\n .build())\n \ + \ .build())\n .build(),\n PointsUpdateOperation.newBuilder()\n\ + \ .setSetPayload(\n SetPayload.newBuilder()\n\ + \ .setPointsSelector(\n PointsSelector.newBuilder()\n\ + \ .setPoints(PointsIdsList\n \ + \ .newBuilder()\n .addIds(id(1))\n \ + \ .build())\n .build())\n \ + \ .putAllPayload(\n Map.of(\"test_payload_2\",\n\ + \ value(2),\n \"test_payload_3\"\ + ,\n value(3)))\n .build())\n \ + \ .build()))\n .get();\n" + language: java + /collections/{collection_name}/points/count: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + 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: "use qdrant_client::{client::QdrantClient, qdrant::{Condition, CountPoints,\ + \ Filter}};\n\nlet client = QdrantClient::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .count(&CountPoints {\n collection_name:\ + \ \"{collection_name}\".to_string(),\n filter: Some(Filter::must([Condition::matches(\n\ + \ \"color\",\n \"red\".to_string(),\n )])),\n\ + \ exact: Some(true),\n ..Default::default()\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.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 static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ + import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.Filter;\n\nQdrantClient client =\ + \ new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\ + \nclient\n .countAsync(\n \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"\ + color\", \"red\")).build(),\n true)\n .get();\n" + language: java + /collections/{collection_name}/points/delete: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + 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: "use qdrant_client::{client::QdrantClient, qdrant::{points_selector::PointsSelectorOneOf,\ + \ Condition, Filter, PointsIdsList, PointsSelector}};\n\nlet client =\ + \ QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\nclient\n\ + \ .delete_points_blocking(\n \"{collection_name}\",\n \ + \ None,\n &PointsSelector {\n points_selector_one_of:\ + \ Some(PointsSelectorOneOf::Points(PointsIdsList {\n ids:\ + \ vec![0.into(), 3.into(), 100.into()],\n })),\n },\n\ + \ None,\n )\n .await?;\n\n client\n .delete_points_blocking(\n\ + \ \"{collection_name}\",\n None,\n &PointsSelector\ + \ {\n points_selector_one_of: Some(PointsSelectorOneOf::Filter(Filter::must([\n\ + \ Condition::matches(\"color\", \"red\".to_string()),\n\ + \ ]))),\n },\n None,\n )\n\ + \ .await?;\n" + language: rust + - 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: "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.Points.Filter;\n\nQdrantClient client =\ + \ new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\"\ + , 6334, false).build());\n\nclient.deleteAsync(\"{collection_name}\",\ + \ List.of(id(0), id(3), id(100)));\n\nclient\n .deleteAsync(\n \ + \ \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"\ + color\", \"red\")).build())\n .get();\n" + language: java + /collections/{collection_name}/points/discover: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{\n\ + \ target_vector::Target, vector_example::Example, ContextExamplePair,\ + \ DiscoverPoints,\n TargetVector, VectorExample,\n },\n};\n\n\ + let client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ + \nclient\n .discover(&DiscoverPoints {\n collection_name: \"\ + {collection_name}\".to_string(),\n target: Some(TargetVector {\n\ + \ target: Some(Target::Single(VectorExample {\n \ + \ example: Some(Example::Vector(vec![0.2, 0.1, 0.9, 0.7].into())),\n\ + \ })),\n }),\n context: vec![\n ContextExamplePair\ + \ {\n positive: Some(VectorExample {\n \ + \ example: Some(Example::Id(100.into())),\n }),\n \ + \ negative: Some(VectorExample {\n example:\ + \ Some(Example::Id(718.into())),\n }),\n },\n\ + \ ContextExamplePair {\n positive: Some(VectorExample\ + \ {\n example: Some(Example::Id(200.into())),\n \ + \ }),\n negative: Some(VectorExample {\n \ + \ example: Some(Example::Id(300.into())),\n \ + \ }),\n },\n ],\n limit: 10,\n ..Default::default()\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.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 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\ + import io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.ContextExamplePair;\n\ + import io.qdrant.client.grpc.Points.DiscoverPoints;\nimport io.qdrant.client.grpc.Points.TargetVector;\n\ + import 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 + /collections/{collection_name}/points/discover/batch: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{\n\ + \ target_vector::Target, vector_example::Example, ContextExamplePair,\ + \ DiscoverBatchPoints,\n DiscoverPoints, TargetVector, VectorExample,\n\ + \ },\n};\n\nlet client = QdrantClient::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nlet discover_points = &DiscoverBatchPoints {\n collection_name:\ + \ \"{collection_name}\".to_string(),\n discover_points: vec![\n \ + \ DiscoverPoints {\n collection_name: \"{collection_name}\"\ + .to_string(),\n target: Some(TargetVector {\n \ + \ target: Some(Target::Single(VectorExample {\n example:\ + \ Some(Example::Vector(vec![0.2, 0.1, 0.9, 0.7].into())),\n \ + \ })),\n }),\n context: vec![\n \ + \ ContextExamplePair {\n positive: Some(VectorExample\ + \ {\n example: Some(Example::Id(100.into())),\n\ + \ }),\n negative: Some(VectorExample\ + \ {\n example: Some(Example::Id(718.into())),\n\ + \ }),\n },\n ContextExamplePair\ + \ {\n positive: Some(VectorExample {\n \ + \ example: Some(Example::Id(200.into())),\n \ + \ }),\n negative: Some(VectorExample {\n \ + \ example: Some(Example::Id(300.into())),\n \ + \ }),\n },\n ],\n limit:\ + \ 10,\n ..Default::default()\n },\n DiscoverPoints\ + \ {\n collection_name: \"{collection_name}\".to_string(),\n\ + \ target: Some(TargetVector {\n target: Some(Target::Single(VectorExample\ + \ {\n example: Some(Example::Vector(vec![0.5, 0.3,\ + \ 0.2, 0.3].into())),\n })),\n }),\n \ + \ context: vec![\n ContextExamplePair {\n \ + \ positive: Some(VectorExample {\n example:\ + \ Some(Example::Id(342.into())),\n }),\n \ + \ negative: Some(VectorExample {\n example:\ + \ Some(Example::Id(213.into())),\n }),\n \ + \ },\n ContextExamplePair {\n positive:\ + \ Some(VectorExample {\n example: Some(Example::Id(100.into())),\n\ + \ }),\n negative: Some(VectorExample\ + \ {\n example: Some(Example::Id(200.into())),\n\ + \ }),\n },\n ],\n \ + \ limit: 10,\n ..Default::default()\n },\n ],\n\ + \ ..Default::default()\n};\n\nclient.discover_batch(discover_points).await?;\n" + language: rust + - 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: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ + \ io.qdrant.client.VectorFactory.vector;\n\nimport java.util.Arrays;\n\ + import java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport\ + \ io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.ContextExamplePair;\n\ + import io.qdrant.client.grpc.Points.DiscoverPoints;\nimport io.qdrant.client.grpc.Points.TargetVector;\n\ + import 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 + /collections/{collection_name}/points/payload: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + 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: "use qdrant_client::{client::QdrantClient, qdrant::{\n points_selector::PointsSelectorOneOf,\ + \ PointsIdsList, PointsSelector,\n}};\n\nlet client = QdrantClient::from_url(\"\ + http://localhost:6334\").build()?;\n\nclient\n .set_payload_blocking(\n\ + \ \"{collection_name}\",\n None,\n &PointsSelector\ + \ {\n points_selector_one_of: Some(PointsSelectorOneOf::Points(PointsIdsList\ + \ {\n ids: vec![0.into(), 3.into(), 10.into()],\n \ + \ })),\n },\n json!({\n \"property1\":\ + \ \"string\",\n \"property2\": \"string\",\n })\n \ + \ .try_into()\n .unwrap(),\n None,\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.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 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 + put: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.overwritePayload(\"{collection_name}\", {\n payload: {\n property1:\ + \ \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n\ + });\n" + language: typescript + - code-samples: + - code: "use qdrant_client::{client::QdrantClient, qdrant::{\n points_selector::PointsSelectorOneOf,\ + \ PointsIdsList, PointsSelector,\n}};\n\nlet client = QdrantClient::from_url(\"\ + http://localhost:6334\").build()?;\n\nclient\n .overwrite_payload_blocking(\n\ + \ \"{collection_name}\",\n None,\n &PointsSelector\ + \ {\n points_selector_one_of: Some(PointsSelectorOneOf::Points(PointsIdsList\ + \ {\n ids: vec![0.into(), 3.into(), 10.into()],\n \ + \ })),\n },\n json!({\n \"property1\":\ + \ \"string\",\n \"property2\": \"string\",\n })\n \ + \ .try_into()\n .unwrap(),\n None,\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.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 java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ + import static io.qdrant.client.ValueFactory.value;\n\nimport io.qdrant.client.QdrantClient;\n\ + import io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new\ + \ QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\"\ + , 6334, false).build());\n\nclient\n .overwritePayloadAsync(\n \ + \ \"{collection_name}\",\n Map.of(\"property1\", value(\"string\"\ + ), \"property2\", value(\"string\")),\n List.of(id(0), id(3), id(10)),\n\ + \ true,\n null,\n null)\n .get();\n" + language: java + /collections/{collection_name}/points/payload/clear: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.clearPayload(\"{collection_name}\", {\n points: [0, 3, 100],\n\ + });\n" + language: typescript + - code-samples: + - code: "use qdrant_client::{client::QdrantClient, qdrant::{\n points_selector::PointsSelectorOneOf,\ + \ PointsIdsList, PointsSelector,\n}};\n\nlet client = QdrantClient::from_url(\"\ + http://localhost:6334\").build()?;\n\nclient\n .clear_payload(\n \ + \ \"{collection_name}\",\n None,\n Some(PointsSelector\ + \ {\n points_selector_one_of: Some(PointsSelectorOneOf::Points(PointsIdsList\ + \ {\n ids: vec![0.into(), 3.into(), 100.into()],\n \ + \ })),\n }),\n None,\n )\n .await?;\n" + language: rust + - 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: "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: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.deletePayload(\"{collection_name}\", {\n keys: [\"color\", \"\ + price\"],\n points: [0, 3, 100],\n});\n" + language: typescript + - code-samples: + - code: "use qdrant_client::{client::QdrantClient, qdrant::{\n points_selector::PointsSelectorOneOf,\ + \ PointsIdsList, PointsSelector,\n}};\n\nlet client = QdrantClient::from_url(\"\ + http://localhost:6334\").build()?;\n\nclient\n .delete_payload_blocking(\n\ + \ \"{collection_name}\",\n None,\n &PointsSelector\ + \ {\n points_selector_one_of: Some(PointsSelectorOneOf::Points(PointsIdsList\ + \ {\n ids: vec![0.into(), 3.into(), 100.into()],\n \ + \ })),\n },\n vec![\"color\".to_string(), \"price\"\ + .to_string()],\n None,\n )\n .await?;\n" + language: rust + - 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: "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 + /collections/{collection_name}/points/recommend: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{Condition,\ + \ Filter, RecommendPoints, RecommendStrategy},\n};\n\nlet client = QdrantClient::from_url(\"\ + http://localhost:6334\").build()?;\n\nclient\n .recommend(&RecommendPoints\ + \ {\n collection_name: \"{collection_name}\".to_string(),\n \ + \ positive: vec![100.into(), 200.into()],\n positive_vectors:\ + \ vec![vec![100.0, 231.0].into()],\n negative: vec![718.into()],\n\ + \ negative_vectors: vec![vec![0.2, 0.3, 0.4, 0.5].into()],\n \ + \ strategy: Some(RecommendStrategy::AverageVector.into()),\n \ + \ filter: Some(Filter::must([Condition::matches(\n \"city\"\ + ,\n \"London\".to_string(),\n )])),\n limit:\ + \ 3,\n ..Default::default()\n })\n .await?;\n" + language: rust + - 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: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ + import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.RecommendPoints;\n\ + import io.qdrant.client.grpc.Points.RecommendStrategy;\n\nQdrantClient\ + \ client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\"\ + , 6334, false).build());\n\nclient\n .recommendAsync(\n RecommendPoints.newBuilder()\n\ + \ .setCollectionName(\"{collection_name}\")\n .addAllPositive(List.of(id(100),\ + \ id(200)))\n .addAllPositiveVectors(List.of(vector(100.0f,\ + \ 231.0f)))\n .addAllNegative(List.of(id(718)))\n \ + \ .addAllPositiveVectors(List.of(vector(0.2f, 0.3f, 0.4f, 0.5f)))\n\ + \ .setStrategy(RecommendStrategy.AverageVector)\n \ + \ .setFilter(Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\"\ + )))\n .setLimit(3)\n .build())\n .get();\n" + language: java + /collections/{collection_name}/points/recommend/batch: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{Condition,\ + \ Filter, RecommendBatchPoints, RecommendPoints},\n};\n\nlet client =\ + \ QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\nlet filter\ + \ = Filter::must([Condition::matches(\"city\", \"London\".to_string())]);\n\ + \nlet recommend_queries = vec![\n RecommendPoints {\n collection_name:\ + \ \"{collection_name}\".to_string(),\n positive: vec![100.into(),\ + \ 231.into()],\n negative: vec![718.into()],\n filter: Some(filter.clone()),\n\ + \ limit: 3,\n ..Default::default()\n },\n RecommendPoints\ + \ {\n collection_name: \"{collection_name}\".to_string(),\n \ + \ positive: vec![200.into(), 67.into()],\n negative: vec![300.into()],\n\ + \ filter: Some(filter),\n limit: 3,\n ..Default::default()\n\ + \ },\n];\n\nclient\n .recommend_batch(&RecommendBatchPoints {\n\ + \ collection_name: \"{collection_name}\".to_string(),\n \ + \ recommend_points: recommend_queries,\n ..Default::default()\n\ + \ })\n .await?;\n" + language: rust + - 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: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ + import static io.qdrant.client.PointIdFactory.id;\n\nimport io.qdrant.client.QdrantClient;\n\ + import io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\n\ + import io.qdrant.client.grpc.Points.RecommendPoints;\n\nQdrantClient client\ + \ =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334,\ + \ false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"\ + city\", \"London\")).build();\n\nList recommendQueries\ + \ =\n List.of(\n RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(100),\ + \ id(231)))\n .addAllNegative(List.of(id(718)))\n \ + \ .setFilter(filter)\n .setLimit(3)\n .build(),\n\ + \ RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(200),\ + \ id(67)))\n .addAllNegative(List.of(id(300)))\n \ + \ .setFilter(filter)\n .setLimit(3)\n .build());\n\ + \nclient.recommendBatchAsync(\"{collection_name}\", recommendQueries,\ + \ null).get();\n" + language: java + /collections/{collection_name}/points/recommend/groups: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{RecommendPointGroups,\ + \ RecommendStrategy},\n};\n\nlet client = QdrantClient::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .recommend_groups(&RecommendPointGroups {\n\ + \ collection_name: \"{collection_name}\".to_string(),\n \ + \ group_by: \"document_id\".to_string(),\n group_size: 2,\n \ + \ positive: vec![100.into(), 200.into()],\n negative: vec![718.into()],\n\ + \ strategy: Some(RecommendStrategy::AverageVector.into()),\n \ + \ limit: 3,\n ..Default::default()\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.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 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: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.scroll(\"{collection_name}\", {\n filter: {\n must: [\n\ + \ {\n key: \"color\",\n match:\ + \ {\n value: \"red\",\n },\n \ + \ },\n ],\n },\n limit: 1,\n with_payload: true,\n\ + \ with_vector: false,\n});\n" + language: typescript + - code-samples: + - code: "use qdrant_client::{client::QdrantClient, qdrant::{Condition, Filter,\ + \ ScrollPoints}};\n\nlet client = QdrantClient::from_url(\"http://localhost:6334\"\ + ).build()?;\n\nclient\n .scroll(&ScrollPoints {\n collection_name:\ + \ \"{collection_name}\".to_string(),\n filter: Some(Filter::must([Condition::matches(\n\ + \ \"color\",\n \"red\".to_string(),\n )])),\n\ + \ limit: Some(1),\n with_payload: Some(true.into()),\n \ + \ with_vectors: Some(false.into()),\n ..Default::default()\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 static io.qdrant.client.ConditionFactory.matchKeyword;\nimport\ + \ static io.qdrant.client.WithPayloadSelectorFactory.enable;\n\nimport\ + \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.ScrollPoints;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .scrollAsync(\n \ + \ ScrollPoints.newBuilder()\n .setCollectionName(\"{collection_name}\"\ + )\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"\ + color\", \"red\")).build())\n .setLimit(1)\n .setWithPayload(enable(true))\n\ + \ .build())\n .get();\n" + language: java + /collections/{collection_name}/points/search: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{Condition,\ + \ Filter, SearchParams, SearchPoints},\n};\n\nlet client = QdrantClient::from_url(\"\ + http://localhost:6334\").build()?;\n\nclient\n .search_points(&SearchPoints\ + \ {\n collection_name: \"{collection_name}\".to_string(),\n \ + \ filter: Some(Filter::must([Condition::matches(\n \"city\"\ + ,\n \"London\".to_string(),\n )])),\n params:\ + \ Some(SearchParams {\n hnsw_ef: Some(128),\n exact:\ + \ Some(false),\n ..Default::default()\n }),\n \ + \ vector: vec![0.2, 0.1, 0.9, 0.7],\n limit: 3,\n ..Default::default()\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.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 static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ + import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .searchAsync(\n \ + \ SearchPoints.newBuilder()\n .setCollectionName(\"{collection_name}\"\ + )\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"\ + city\", \"London\")).build())\n .addAllVector(List.of(0.2f,\ + \ 0.1f, 0.9f, 0.7f))\n .setLimit(3)\n .build())\n\ + \ .get();\n" + language: java + /collections/{collection_name}/points/search/batch: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{Condition,\ + \ Filter, SearchBatchPoints, SearchPoints},\n};\n\nlet client = QdrantClient::from_url(\"\ + http://localhost:6334\").build()?;\n\nlet filter = Filter::must([Condition::matches(\"\ + city\", \"London\".to_string())]);\n\nlet searches = vec![\n SearchPoints\ + \ {\n collection_name: \"{collection_name}\".to_string(),\n \ + \ vector: vec![0.2, 0.1, 0.9, 0.7],\n filter: Some(filter.clone()),\n\ + \ limit: 3,\n ..Default::default()\n },\n SearchPoints\ + \ {\n collection_name: \"{collection_name}\".to_string(),\n \ + \ vector: vec![0.5, 0.3, 0.2, 0.3],\n filter: Some(filter),\n\ + \ limit: 3,\n ..Default::default()\n },\n];\n\nclient\n\ + \ .search_batch_points(&SearchBatchPoints {\n collection_name:\ + \ \"{collection_name}\".to_string(),\n search_points: searches,\n\ + \ read_consistency: None,\n ..Default::default()\n })\n\ + \ .await?;\n" + language: rust + - 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: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\ + \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"\ + city\", \"London\")).build();\nList searches =\n List.of(\n\ + \ SearchPoints.newBuilder()\n .addAllVector(List.of(0.2f,\ + \ 0.1f, 0.9f, 0.7f))\n .setFilter(filter)\n .setLimit(3)\n\ + \ .build(),\n SearchPoints.newBuilder()\n \ + \ .addAllVector(List.of(0.5f, 0.3f, 0.2f, 0.3f))\n .setFilter(filter)\n\ + \ .setLimit(3)\n .build());\nclient.searchBatchAsync(\"\ + {collection_name}\", searches, null).get();\n" + language: java + /collections/{collection_name}/points/search/groups: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::SearchPointGroups,\n\ + };\n\nlet client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ + \nclient\n .search_groups(&SearchPointGroups {\n collection_name:\ + \ \"{collection_name}\".to_string(),\n vector: vec![1.1],\n \ + \ group_by: \"document_id\".to_string(),\n limit: 4,\n \ + \ group_size: 2,\n ..Default::default()\n })\n .await?;\n" + language: rust + - 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: "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/vectors: + put: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.updateVectors(\"{collection_name}\", {\n points: [\n \ + \ {\n id: 1,\n vector: {\n image:\ + \ [0.1, 0.2, 0.3, 0.4],\n },\n },\n {\n \ + \ id: 2,\n vector: {\n text: [0.9, 0.8,\ + \ 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n },\n ],\n\ + });\n" + language: typescript + - code-samples: + - code: "use qdrant_client::qdrant::PointVectors;\nuse std::collections::HashMap;\n\ + \nclient\n .update_vectors_blocking(\n \"{collection_name}\"\ + ,\n None,\n &[\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])]).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 None,\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.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 static io.qdrant.client.PointIdFactory.id;\nimport static\ + \ io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\ + \nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\n\ + import io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new\ + \ QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\"\ + , 6334, false).build());\n\nclient\n .updateVectorsAsync(\n \ + \ \"{collection_name}\",\n List.of(\n PointVectors.newBuilder()\n\ + \ .setId(id(1))\n .setVectors(namedVectors(Map.of(\"\ + image\", vector(List.of(0.1f, 0.2f, 0.3f, 0.4f)))))\n .build(),\n\ + \ PointVectors.newBuilder()\n .setId(id(2))\n\ + \ .setVectors(\n namedVectors(\n \ + \ Map.of(\n \"text\", vector(List.of(0.9f,\ + \ 0.8f, 0.7f, 0.6f, 0.5f, 0.4f, 0.3f, 0.2f)))))\n .build()))\n\ + \ .get();\n" + language: java + /collections/{collection_name}/points/vectors/delete: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.deleteVectors(\"{collection_name}\", {\n points: [0, 3, 10],\n\ + \ vectors: [\"text\", \"image\"],\n});\n" + language: typescript + - code-samples: + - code: "use qdrant_client::{client::QdrantClient, qdrant::{\n points_selector::PointsSelectorOneOf,\ + \ PointsIdsList, PointsSelector, VectorsSelector,\n}};\n\nlet client =\ + \ QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\nclient\n\ + \ .delete_vectors_blocking(\n \"{collection_name}\",\n \ + \ None,\n &PointsSelector {\n points_selector_one_of:\ + \ Some(PointsSelectorOneOf::Points(PointsIdsList {\n ids:\ + \ vec![0.into(), 3.into(), 10.into()],\n })),\n },\n\ + \ &VectorsSelector {\n names: vec![\"text\".into(),\ + \ \"image\".into()],\n },\n None,\n )\n .await?;\n" + language: rust + - 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: "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 + /collections/{collection_name}/shards: + put: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n\ + });\n\nclient.createShardKey(\"{collection_name}\", {\n shard_key:\ + \ \"{shard_key}\"\n});\n" + language: typescript + - code-samples: + - code: "use qdrant_client::{client::QdrantClient, qdrant::shard_key::Key};\n\ + \nlet client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ + \nclient\n .create_shard_key(\n \"{collection_name}\",\n \ + \ &Key::Keyword(\"{shard_key\".to_string()),\n None,\n \ + \ None,\n &[],\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.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 + + + client = QdrantClient(url="http://localhost:6333") + + + client.create_shard_key("{collection_name}", "{shard_key}") + + ' + 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.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 + /collections/{collection_name}/shards/delete: + post: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n\ + });\n\nclient.deleteShardKey(\"{collection_name}\", {\n shard_key:\ + \ \"{shard_key}\"\n});\n" + language: typescript + - code-samples: + - code: "use qdrant_client::{client::QdrantClient, qdrant::shard_key::Key};\n\ + \nlet client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ + \nclient\n .delete_shard_key(\"{collection_name}\", &Key::Keyword(\"\ + {shard_key\".to_string()))\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.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 + + + client = QdrantClient(url="http://localhost:6333") + + + client.delete_shard_key("{collection_name}", "{shard_key}") + + ' + 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.deleteShardKeyAsync(DeleteShardKeyRequest.newBuilder()\n\ + \ .setCollectionName(\"{collection_name}\")\n \ + \ .setRequest(DeleteShardKey.newBuilder()\n \ + \ .setShardKey(shardKey(\"{shard_key}\"))\n \ + \ .build())\n .build()).get();\n" + language: java + /collections/{collection_name}/snapshots: + get: + x-fern-examples: + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.listSnapshots("{collection_name}"); + + ' + language: typescript + - code-samples: + - code: 'use qdrant_client::client::QdrantClient; + + + let client = QdrantClient::from_url("http://localhost:6334").build()?; + + + client.list_snapshots("{collection_name}").await?; + + ' + language: rust + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ListSnapshotsAsync("{collection_name}"); + + ' + 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-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 + post: + x-fern-examples: + - 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: 'use qdrant_client::client::QdrantClient; + + + let client = QdrantClient::from_url("http://localhost:6334").build()?; + + + client.create_snapshot("{collection_name}").await?; + + ' + language: rust + - 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 + + + 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: + x-fern-examples: + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.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/{snapshot_name}: + delete: + x-fern-examples: + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.deleteSnapshot("{collection_name}", "{snapshot_name}"); + + ' + language: typescript + - code-samples: + - code: "use qdrant_client::client::QdrantClient;\n\nlet client = QdrantClient::from_url(\"\ + http://localhost:6334\").build()?;\n\nclient\n .delete_snapshot(\"\ + {collection_name}\", \"{snapshot_name}\")\n .await?;\n" + language: rust + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.DeleteSnapshotAsync("{collection_name}", "{snapshot_name}"); + + ' + 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 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 + /snapshots: + get: + x-fern-examples: + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.listFullSnapshots(); + + ' + language: typescript + - code-samples: + - code: 'use qdrant_client::client::QdrantClient; + + + let client = QdrantClient::from_url("http://localhost:6334").build()?; + + + client.list_full_snapshots().await?; + + ' + language: rust + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.ListFullSnapshotsAsync(); + + ' + language: csharp + - 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: + x-fern-examples: + - 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: 'use qdrant_client::client::QdrantClient; + + + let client = QdrantClient::from_url("http://localhost:6334").build()?; + + + client.create_full_snapshot().await?; + + ' + language: rust + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.CreateFullSnapshotAsync(); + + ' + language: csharp + - 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: + x-fern-examples: + - 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: 'use qdrant_client::client::QdrantClient; + + + let client = QdrantClient::from_url("http://localhost:6334").build()?; + + + client.delete_full_snapshot("{snapshot_name}").await?; + + ' + language: rust + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.DeleteFullSnapshotAsync("{snapshot_name}"); + + ' + 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-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/qdrant b/qdrant new file mode 160000 index 0000000..34f7f8e --- /dev/null +++ b/qdrant @@ -0,0 +1 @@ +Subproject commit 34f7f8ec2d8455c0b3fe0f1fb134907ba7816a08 From b201303b14b28fbf2f89c163b0e9d7ea20fdb6a7 Mon Sep 17 00:00:00 2001 From: generall Date: Wed, 15 May 2024 00:39:55 +0200 Subject: [PATCH 7/8] fix Ci --- tools/sync-openapi.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/sync-openapi.sh b/tools/sync-openapi.sh index 78c7bdf..b7964fe 100644 --- a/tools/sync-openapi.sh +++ b/tools/sync-openapi.sh @@ -31,6 +31,8 @@ python tools/generate_snippet_overwrites.py --openapi qdrant/docs/redoc/master/o yq eval-all 'select(fileIndex == 0) * select(fileIndex == 1)' fern/openapi-overrides-template.yml overwrite-snippets.yml > $PROJECT_ROOT/fern/apis/master/openapi-overrides.yml +rm overwrite-snippets.yml + # Find latest version inside the repository `docs/redoc` starting with `v*` latest_version=$(ls qdrant/docs/redoc | grep -oP 'v\d.*' | sort -V | tail -n 1) From 400ded60e3dc2d84478b3d4e5acea215db948512 Mon Sep 17 00:00:00 2001 From: generall Date: Tue, 14 May 2024 22:40:26 +0000 Subject: [PATCH 8/8] Sync OpenAPI --- overwrite-snippets.yml | 2077 ---------------------------------------- 1 file changed, 2077 deletions(-) delete mode 100644 overwrite-snippets.yml diff --git a/overwrite-snippets.yml b/overwrite-snippets.yml deleted file mode 100644 index 07ecd0f..0000000 --- a/overwrite-snippets.yml +++ /dev/null @@ -1,2077 +0,0 @@ -paths: - /aliases: - get: - x-fern-examples: - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.getAliases(); - - ' - language: typescript - - code-samples: - - code: 'use qdrant_client::client::QdrantClient; - - - let client = QdrantClient::from_url("http://localhost:6334").build()?; - - - client.list_aliases().await?; - - ' - language: rust - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ListAliasesAsync(); - - ' - language: csharp - - 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 - /collections: - get: - x-fern-examples: - - 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: 'use qdrant_client::client::QdrantClient; - - - let client = QdrantClient::from_url("http://localhost:6334").build()?; - - - client.list_collections().await?; - - ' - language: rust - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ListCollectionsAsync(); - - ' - language: csharp - - 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: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.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: 'use qdrant_client::client::QdrantClient; - - - let client = QdrantClient::from_url("http://localhost:6334").build()?; - - - client.create_alias("example_collection", "production_collection").await?; - - - client.delete_alias("production_collection").await?; - - ' - language: rust - - 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: "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: - x-fern-examples: - - code-samples: - - code: 'import { QdrantClient } from ''@qdrant/qdrant-js''; - - - const client = new QdrantClient({url: ''http://127.0.0.1:6333''}); - - - client.deleteCollection("{collection_name}"); - - ' - language: typescript - - code-samples: - - code: 'use qdrant_client::client::QdrantClient; - - - let client = QdrantClient::from_url("http://localhost:6334").build()?; - - - client.delete_collection("{collection_name}").await?; - - ' - language: rust - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.DeleteCollectionAsync("{collection_name}"); - - ' - 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-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: - x-fern-examples: - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.getCollection("{collection_name}"); - - ' - language: typescript - - code-samples: - - code: 'use qdrant_client::client::QdrantClient; - - - let client = QdrantClient::from_url("http://localhost:6334").build()?; - - - client.collection_info("{collection_name}").await?; - - ' - language: rust - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.GetCollectionInfoAsync("{collection_name}"); - - ' - language: csharp - - 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: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.updateCollection(\"{collection_name}\", {\n optimizers_config:\ - \ {\n indexing_threshold: 10000,\n },\n});\n" - language: typescript - - code-samples: - - code: "use qdrant_client::{client::QdrantClient, qdrant::OptimizersConfigDiff};\n\ - \nlet client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ - \nclient\n .update_collection(\n \"{collection_name}\",\n \ - \ Some(&OptimizersConfigDiff {\n indexing_threshold: Some(10000),\n\ - \ ..Default::default()\n }),\n None,\n \ - \ None,\n None,\n None,\n None,\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.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 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 - put: - x-fern-examples: - - code-samples: - - code: "# Minimal curl command to create a collection with a vector field\n\ - \ncurl -X PUT http://localhost:6333/collections/collection_name \\\n \ - \ -H \"api-key: \" \\\n -H \"Content-Type: application/json\"\ - \ \\\n -d '{\n \"vectors\": {\n \"size\"\ - : 300,\n \"distance\": \"Cosine\"\n } \n \ - \ }'\n\n# Or with a sparse vector field\n\ncurl -X PUT http://localhost:6333/collections/collection_name\ - \ \\\n -H \"api-key: \" \\\n -H \"Content-Type: application/json\"\ - \ \\\n -d '{\n \"vectors\": {\n \"size\"\ - : 1536,\n \"distance\": \"Cosine\"\n },\n \ - \ \"sparse_vectors\": {\n \"splade-model-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" - language: typescript - - code-samples: - - code: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{vectors_config::Config,\ - \ CreateCollection, Distance, VectorParams, VectorsConfig},\n};\n\nlet\ - \ client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ - \nclient\n .create_collection(&CreateCollection {\n collection_name:\ - \ \"{collection_name}\".to_string(),\n vectors_config: Some(VectorsConfig\ - \ {\n config: Some(Config::Params(VectorParams {\n \ - \ size: 100,\n distance: Distance::Cosine.into(),\n\ - \ ..Default::default()\n })),\n }),\n\ - \ ..Default::default()\n })\n .await?;\n" - language: rust - - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.create_collection(\n collection_name=\"\ - {collection_name}\",\n vectors_config=models.VectorParams(size=100,\ - \ distance=models.Distance.COSINE),\n)\n" - language: python - - code-samples: - - code: "import 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" - language: java - /collections/{collection_name}/aliases: - get: - x-fern-examples: - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.getCollectionAliases("{collection_name}"); - - ' - language: typescript - - code-samples: - - code: 'use qdrant_client::client::QdrantClient; - - - let client = QdrantClient::from_url("http://localhost:6334").build()?; - - - client.list_collection_aliases("{collection_name}").await?; - - ' - language: rust - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ListCollectionAliasesAsync("{collection_name}"); - - ' - 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-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}/index: - put: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.createPayloadIndex(\"{collection_name}\", {\n field_name: \"{field_name}\"\ - ,\n field_schema: \"keyword\",\n});\n" - language: typescript - - code-samples: - - code: "use qdrant_client::{client::QdrantClient, qdrant::FieldType};\n\n\ - let client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ - \nclient\n.create_field_index(\n \"{collection_name}\",\n \"{field_name}\"\ - ,\n FieldType::Keyword,\n None,\n None,\n)\n.await?;\n" - language: rust - - 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: "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: - x-fern-examples: - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.deletePayloadIndex("{collection_name}", "{field_name}"); - - ' - language: typescript - - code-samples: - - code: "use qdrant_client::client::QdrantClient;\n\nlet client = QdrantClient::from_url(\"\ - http://localhost:6334\").build()?;\n\nclient\n .delete_field_index(\"\ - {collection_name}\", \"{field_name}\", None)\n .await?;\n" - language: rust - - 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: "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: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.retrieve(\"{collection_name}\", {\n ids: [0, 3, 100],\n});\n" - language: typescript - - code-samples: - - code: "use qdrant_client::client::QdrantClient;\n\nlet client = QdrantClient::from_url(\"\ - http://localhost:6334\").build()?;\n\nclient\n .get_points(\n \ - \ \"{collection_name}\",\n None,\n &[0.into(), 30.into(),\ - \ 100.into()],\n Some(false),\n Some(false),\n None,\n\ - \ )\n .await?;\n" - language: rust - - 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: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\ - \nclient\n .retrieveAsync(\"{collection_name}\", List.of(id(0), id(30),\ - \ id(100)), false, false, null)\n .get();\n" - language: java - put: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.upsert(\"{collection_name}\", {\n points: [\n {\n id:\ - \ 1,\n payload: { color: \"red\" },\n vector: [0.9, 0.1, 0.1],\n\ - \ },\n {\n id: 2,\n payload: { color: \"green\" },\n \ - \ vector: [0.1, 0.9, 0.1],\n },\n {\n id: 3,\n payload:\ - \ { color: \"blue\" },\n vector: [0.1, 0.1, 0.9],\n },\n ],\n\ - });\n" - language: typescript - - code-samples: - - code: "use qdrant_client::{client::QdrantClient, qdrant::PointStruct};\n\ - use serde_json::json;\n\nlet client = QdrantClient::from_url(\"http://localhost:6334\"\ - ).build()?;\n\nclient\n .upsert_points_batch_blocking(\n \"\ - {collection_name}\".to_string(),\n None,\n vec![\n \ - \ PointStruct::new(\n 1,\n vec![0.9,\ - \ 0.1, 0.1],\n json!(\n {\"color\":\ - \ \"red\"}\n )\n .try_into()\n \ - \ .unwrap(),\n ),\n PointStruct::new(\n \ - \ 2,\n vec![0.1, 0.9, 0.1],\n \ - \ json!(\n {\"color\": \"green\"}\n \ - \ )\n .try_into()\n .unwrap(),\n \ - \ ),\n PointStruct::new(\n 3,\n \ - \ vec![0.1, 0.1, 0.9],\n json!(\n \ - \ {\"color\": \"blue\"}\n )\n .try_into()\n\ - \ .unwrap(),\n ),\n ],\n None,\n\ - \ 100,\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.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 static io.qdrant.client.PointIdFactory.id;\nimport static\ - \ io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\ - \nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\n\ - import io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.PointStruct;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .upsertAsync(\n \ - \ \"{collection_name}\",\n List.of(\n PointStruct.newBuilder()\n\ - \ .setId(id(1))\n .setVectors(\n \ - \ namedVectors(\n Map.of(\n \ - \ \"image\",\n vector(List.of(0.9f,\ - \ 0.1f, 0.1f, 0.2f)),\n \"text\",\n \ - \ vector(List.of(0.4f, 0.7f, 0.1f, 0.8f, 0.1f, 0.1f,\ - \ 0.9f, 0.2f)))))\n .build(),\n PointStruct.newBuilder()\n\ - \ .setId(id(2))\n .setVectors(\n \ - \ namedVectors(\n Map.of(\n \ - \ \"image\",\n List.of(0.2f,\ - \ 0.1f, 0.3f, 0.9f),\n \"text\",\n \ - \ List.of(0.5f, 0.2f, 0.7f, 0.4f, 0.7f, 0.2f, 0.3f,\ - \ 0.9f))))\n .build()))\n .get();\n" - language: java - /collections/{collection_name}/points/batch: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "use qdrant_client::qdrant::{\n points_selector::PointsSelectorOneOf,\n\ - \ points_update_operation::{\n Operation, PointStructList, SetPayload,\ - \ UpdateVectors,\n },\n PointStruct, PointVectors, PointsIdsList,\ - \ PointsSelector, PointsUpdateOperation,\n};\n\nlet client = QdrantClient::from_url(\"\ - http://localhost:6334\").build()?;\n\nclient\n .batch_updates_blocking(\n\ - \ \"{collection_name}\",\n &[\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 \ - \ json!({}).try_into().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(SetPayload\ - \ {\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 None,\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.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 java.util.List;\nimport java.util.Map;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ - import static io.qdrant.client.ValueFactory.value;\nimport static io.qdrant.client.VectorsFactory.vectors;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Points.PointStruct;\nimport io.qdrant.client.grpc.Points.PointVectors;\n\ - import io.qdrant.client.grpc.Points.PointsIdsList;\nimport io.qdrant.client.grpc.Points.PointsSelector;\n\ - import io.qdrant.client.grpc.Points.PointsUpdateOperation;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation.PointStructList;\n\ - import io.qdrant.client.grpc.Points.PointsUpdateOperation.SetPayload;\n\ - import io.qdrant.client.grpc.Points.PointsUpdateOperation.UpdateVectors;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .batchUpdateAsync(\n\ - \ \"{collection_name}\",\n List.of(\n PointsUpdateOperation.newBuilder()\n\ - \ .setUpsert(\n PointStructList.newBuilder()\n\ - \ .addPoints(\n PointStruct.newBuilder()\n\ - \ .setId(id(1))\n .setVectors(vectors(\n\ - \ 1.0 f,\n 2.0 f,\n \ - \ 3.0 f,\n 4.0 f))\n \ - \ .build())\n .build())\n .build(),\n\ - \ PointsUpdateOperation.newBuilder()\n .setUpdateVectors(\n\ - \ UpdateVectors.newBuilder()\n .addPoints(\n\ - \ PointVectors.newBuilder()\n .setId(id(1))\n\ - \ .setVectors(vectors(\n 1.0\ - \ f,\n 2.0 f,\n 3.0 f,\n\ - \ 4.0 f))\n .build())\n \ - \ .build())\n .build(),\n PointsUpdateOperation.newBuilder()\n\ - \ .setSetPayload(\n SetPayload.newBuilder()\n\ - \ .setPointsSelector(\n PointsSelector.newBuilder()\n\ - \ .setPoints(PointsIdsList\n \ - \ .newBuilder()\n .addIds(id(1))\n \ - \ .build())\n .build())\n \ - \ .putAllPayload(\n Map.of(\"test_payload_2\",\n\ - \ value(2),\n \"test_payload_3\"\ - ,\n value(3)))\n .build())\n \ - \ .build()))\n .get();\n" - language: java - /collections/{collection_name}/points/count: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "use qdrant_client::{client::QdrantClient, qdrant::{Condition, CountPoints,\ - \ Filter}};\n\nlet client = QdrantClient::from_url(\"http://localhost:6334\"\ - ).build()?;\n\nclient\n .count(&CountPoints {\n collection_name:\ - \ \"{collection_name}\".to_string(),\n filter: Some(Filter::must([Condition::matches(\n\ - \ \"color\",\n \"red\".to_string(),\n )])),\n\ - \ exact: Some(true),\n ..Default::default()\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.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 static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ - import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Points.Filter;\n\nQdrantClient client =\ - \ new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\ - \nclient\n .countAsync(\n \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"\ - color\", \"red\")).build(),\n true)\n .get();\n" - language: java - /collections/{collection_name}/points/delete: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "use qdrant_client::{client::QdrantClient, qdrant::{points_selector::PointsSelectorOneOf,\ - \ Condition, Filter, PointsIdsList, PointsSelector}};\n\nlet client =\ - \ QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\nclient\n\ - \ .delete_points_blocking(\n \"{collection_name}\",\n \ - \ None,\n &PointsSelector {\n points_selector_one_of:\ - \ Some(PointsSelectorOneOf::Points(PointsIdsList {\n ids:\ - \ vec![0.into(), 3.into(), 100.into()],\n })),\n },\n\ - \ None,\n )\n .await?;\n\n client\n .delete_points_blocking(\n\ - \ \"{collection_name}\",\n None,\n &PointsSelector\ - \ {\n points_selector_one_of: Some(PointsSelectorOneOf::Filter(Filter::must([\n\ - \ Condition::matches(\"color\", \"red\".to_string()),\n\ - \ ]))),\n },\n None,\n )\n\ - \ .await?;\n" - language: rust - - 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: "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.Points.Filter;\n\nQdrantClient client =\ - \ new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\"\ - , 6334, false).build());\n\nclient.deleteAsync(\"{collection_name}\",\ - \ List.of(id(0), id(3), id(100)));\n\nclient\n .deleteAsync(\n \ - \ \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"\ - color\", \"red\")).build())\n .get();\n" - language: java - /collections/{collection_name}/points/discover: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{\n\ - \ target_vector::Target, vector_example::Example, ContextExamplePair,\ - \ DiscoverPoints,\n TargetVector, VectorExample,\n },\n};\n\n\ - let client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ - \nclient\n .discover(&DiscoverPoints {\n collection_name: \"\ - {collection_name}\".to_string(),\n target: Some(TargetVector {\n\ - \ target: Some(Target::Single(VectorExample {\n \ - \ example: Some(Example::Vector(vec![0.2, 0.1, 0.9, 0.7].into())),\n\ - \ })),\n }),\n context: vec![\n ContextExamplePair\ - \ {\n positive: Some(VectorExample {\n \ - \ example: Some(Example::Id(100.into())),\n }),\n \ - \ negative: Some(VectorExample {\n example:\ - \ Some(Example::Id(718.into())),\n }),\n },\n\ - \ ContextExamplePair {\n positive: Some(VectorExample\ - \ {\n example: Some(Example::Id(200.into())),\n \ - \ }),\n negative: Some(VectorExample {\n \ - \ example: Some(Example::Id(300.into())),\n \ - \ }),\n },\n ],\n limit: 10,\n ..Default::default()\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.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 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\ - import io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.ContextExamplePair;\n\ - import io.qdrant.client.grpc.Points.DiscoverPoints;\nimport io.qdrant.client.grpc.Points.TargetVector;\n\ - import 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 - /collections/{collection_name}/points/discover/batch: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{\n\ - \ target_vector::Target, vector_example::Example, ContextExamplePair,\ - \ DiscoverBatchPoints,\n DiscoverPoints, TargetVector, VectorExample,\n\ - \ },\n};\n\nlet client = QdrantClient::from_url(\"http://localhost:6334\"\ - ).build()?;\n\nlet discover_points = &DiscoverBatchPoints {\n collection_name:\ - \ \"{collection_name}\".to_string(),\n discover_points: vec![\n \ - \ DiscoverPoints {\n collection_name: \"{collection_name}\"\ - .to_string(),\n target: Some(TargetVector {\n \ - \ target: Some(Target::Single(VectorExample {\n example:\ - \ Some(Example::Vector(vec![0.2, 0.1, 0.9, 0.7].into())),\n \ - \ })),\n }),\n context: vec![\n \ - \ ContextExamplePair {\n positive: Some(VectorExample\ - \ {\n example: Some(Example::Id(100.into())),\n\ - \ }),\n negative: Some(VectorExample\ - \ {\n example: Some(Example::Id(718.into())),\n\ - \ }),\n },\n ContextExamplePair\ - \ {\n positive: Some(VectorExample {\n \ - \ example: Some(Example::Id(200.into())),\n \ - \ }),\n negative: Some(VectorExample {\n \ - \ example: Some(Example::Id(300.into())),\n \ - \ }),\n },\n ],\n limit:\ - \ 10,\n ..Default::default()\n },\n DiscoverPoints\ - \ {\n collection_name: \"{collection_name}\".to_string(),\n\ - \ target: Some(TargetVector {\n target: Some(Target::Single(VectorExample\ - \ {\n example: Some(Example::Vector(vec![0.5, 0.3,\ - \ 0.2, 0.3].into())),\n })),\n }),\n \ - \ context: vec![\n ContextExamplePair {\n \ - \ positive: Some(VectorExample {\n example:\ - \ Some(Example::Id(342.into())),\n }),\n \ - \ negative: Some(VectorExample {\n example:\ - \ Some(Example::Id(213.into())),\n }),\n \ - \ },\n ContextExamplePair {\n positive:\ - \ Some(VectorExample {\n example: Some(Example::Id(100.into())),\n\ - \ }),\n negative: Some(VectorExample\ - \ {\n example: Some(Example::Id(200.into())),\n\ - \ }),\n },\n ],\n \ - \ limit: 10,\n ..Default::default()\n },\n ],\n\ - \ ..Default::default()\n};\n\nclient.discover_batch(discover_points).await?;\n" - language: rust - - 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: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ - \ io.qdrant.client.VectorFactory.vector;\n\nimport java.util.Arrays;\n\ - import java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport\ - \ io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.ContextExamplePair;\n\ - import io.qdrant.client.grpc.Points.DiscoverPoints;\nimport io.qdrant.client.grpc.Points.TargetVector;\n\ - import 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 - /collections/{collection_name}/points/payload: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "use qdrant_client::{client::QdrantClient, qdrant::{\n points_selector::PointsSelectorOneOf,\ - \ PointsIdsList, PointsSelector,\n}};\n\nlet client = QdrantClient::from_url(\"\ - http://localhost:6334\").build()?;\n\nclient\n .set_payload_blocking(\n\ - \ \"{collection_name}\",\n None,\n &PointsSelector\ - \ {\n points_selector_one_of: Some(PointsSelectorOneOf::Points(PointsIdsList\ - \ {\n ids: vec![0.into(), 3.into(), 10.into()],\n \ - \ })),\n },\n json!({\n \"property1\":\ - \ \"string\",\n \"property2\": \"string\",\n })\n \ - \ .try_into()\n .unwrap(),\n None,\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.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 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 - put: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.overwritePayload(\"{collection_name}\", {\n payload: {\n property1:\ - \ \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n\ - });\n" - language: typescript - - code-samples: - - code: "use qdrant_client::{client::QdrantClient, qdrant::{\n points_selector::PointsSelectorOneOf,\ - \ PointsIdsList, PointsSelector,\n}};\n\nlet client = QdrantClient::from_url(\"\ - http://localhost:6334\").build()?;\n\nclient\n .overwrite_payload_blocking(\n\ - \ \"{collection_name}\",\n None,\n &PointsSelector\ - \ {\n points_selector_one_of: Some(PointsSelectorOneOf::Points(PointsIdsList\ - \ {\n ids: vec![0.into(), 3.into(), 10.into()],\n \ - \ })),\n },\n json!({\n \"property1\":\ - \ \"string\",\n \"property2\": \"string\",\n })\n \ - \ .try_into()\n .unwrap(),\n None,\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.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 java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ - import static io.qdrant.client.ValueFactory.value;\n\nimport io.qdrant.client.QdrantClient;\n\ - import io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new\ - \ QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\"\ - , 6334, false).build());\n\nclient\n .overwritePayloadAsync(\n \ - \ \"{collection_name}\",\n Map.of(\"property1\", value(\"string\"\ - ), \"property2\", value(\"string\")),\n List.of(id(0), id(3), id(10)),\n\ - \ true,\n null,\n null)\n .get();\n" - language: java - /collections/{collection_name}/points/payload/clear: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.clearPayload(\"{collection_name}\", {\n points: [0, 3, 100],\n\ - });\n" - language: typescript - - code-samples: - - code: "use qdrant_client::{client::QdrantClient, qdrant::{\n points_selector::PointsSelectorOneOf,\ - \ PointsIdsList, PointsSelector,\n}};\n\nlet client = QdrantClient::from_url(\"\ - http://localhost:6334\").build()?;\n\nclient\n .clear_payload(\n \ - \ \"{collection_name}\",\n None,\n Some(PointsSelector\ - \ {\n points_selector_one_of: Some(PointsSelectorOneOf::Points(PointsIdsList\ - \ {\n ids: vec![0.into(), 3.into(), 100.into()],\n \ - \ })),\n }),\n None,\n )\n .await?;\n" - language: rust - - 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: "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: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.deletePayload(\"{collection_name}\", {\n keys: [\"color\", \"\ - price\"],\n points: [0, 3, 100],\n});\n" - language: typescript - - code-samples: - - code: "use qdrant_client::{client::QdrantClient, qdrant::{\n points_selector::PointsSelectorOneOf,\ - \ PointsIdsList, PointsSelector,\n}};\n\nlet client = QdrantClient::from_url(\"\ - http://localhost:6334\").build()?;\n\nclient\n .delete_payload_blocking(\n\ - \ \"{collection_name}\",\n None,\n &PointsSelector\ - \ {\n points_selector_one_of: Some(PointsSelectorOneOf::Points(PointsIdsList\ - \ {\n ids: vec![0.into(), 3.into(), 100.into()],\n \ - \ })),\n },\n vec![\"color\".to_string(), \"price\"\ - .to_string()],\n None,\n )\n .await?;\n" - language: rust - - 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: "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 - /collections/{collection_name}/points/recommend: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{Condition,\ - \ Filter, RecommendPoints, RecommendStrategy},\n};\n\nlet client = QdrantClient::from_url(\"\ - http://localhost:6334\").build()?;\n\nclient\n .recommend(&RecommendPoints\ - \ {\n collection_name: \"{collection_name}\".to_string(),\n \ - \ positive: vec![100.into(), 200.into()],\n positive_vectors:\ - \ vec![vec![100.0, 231.0].into()],\n negative: vec![718.into()],\n\ - \ negative_vectors: vec![vec![0.2, 0.3, 0.4, 0.5].into()],\n \ - \ strategy: Some(RecommendStrategy::AverageVector.into()),\n \ - \ filter: Some(Filter::must([Condition::matches(\n \"city\"\ - ,\n \"London\".to_string(),\n )])),\n limit:\ - \ 3,\n ..Default::default()\n })\n .await?;\n" - language: rust - - 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: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ - import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.RecommendPoints;\n\ - import io.qdrant.client.grpc.Points.RecommendStrategy;\n\nQdrantClient\ - \ client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\"\ - , 6334, false).build());\n\nclient\n .recommendAsync(\n RecommendPoints.newBuilder()\n\ - \ .setCollectionName(\"{collection_name}\")\n .addAllPositive(List.of(id(100),\ - \ id(200)))\n .addAllPositiveVectors(List.of(vector(100.0f,\ - \ 231.0f)))\n .addAllNegative(List.of(id(718)))\n \ - \ .addAllPositiveVectors(List.of(vector(0.2f, 0.3f, 0.4f, 0.5f)))\n\ - \ .setStrategy(RecommendStrategy.AverageVector)\n \ - \ .setFilter(Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\"\ - )))\n .setLimit(3)\n .build())\n .get();\n" - language: java - /collections/{collection_name}/points/recommend/batch: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{Condition,\ - \ Filter, RecommendBatchPoints, RecommendPoints},\n};\n\nlet client =\ - \ QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\nlet filter\ - \ = Filter::must([Condition::matches(\"city\", \"London\".to_string())]);\n\ - \nlet recommend_queries = vec![\n RecommendPoints {\n collection_name:\ - \ \"{collection_name}\".to_string(),\n positive: vec![100.into(),\ - \ 231.into()],\n negative: vec![718.into()],\n filter: Some(filter.clone()),\n\ - \ limit: 3,\n ..Default::default()\n },\n RecommendPoints\ - \ {\n collection_name: \"{collection_name}\".to_string(),\n \ - \ positive: vec![200.into(), 67.into()],\n negative: vec![300.into()],\n\ - \ filter: Some(filter),\n limit: 3,\n ..Default::default()\n\ - \ },\n];\n\nclient\n .recommend_batch(&RecommendBatchPoints {\n\ - \ collection_name: \"{collection_name}\".to_string(),\n \ - \ recommend_points: recommend_queries,\n ..Default::default()\n\ - \ })\n .await?;\n" - language: rust - - 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: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ - import static io.qdrant.client.PointIdFactory.id;\n\nimport io.qdrant.client.QdrantClient;\n\ - import io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\n\ - import io.qdrant.client.grpc.Points.RecommendPoints;\n\nQdrantClient client\ - \ =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334,\ - \ false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"\ - city\", \"London\")).build();\n\nList recommendQueries\ - \ =\n List.of(\n RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(100),\ - \ id(231)))\n .addAllNegative(List.of(id(718)))\n \ - \ .setFilter(filter)\n .setLimit(3)\n .build(),\n\ - \ RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(200),\ - \ id(67)))\n .addAllNegative(List.of(id(300)))\n \ - \ .setFilter(filter)\n .setLimit(3)\n .build());\n\ - \nclient.recommendBatchAsync(\"{collection_name}\", recommendQueries,\ - \ null).get();\n" - language: java - /collections/{collection_name}/points/recommend/groups: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{RecommendPointGroups,\ - \ RecommendStrategy},\n};\n\nlet client = QdrantClient::from_url(\"http://localhost:6334\"\ - ).build()?;\n\nclient\n .recommend_groups(&RecommendPointGroups {\n\ - \ collection_name: \"{collection_name}\".to_string(),\n \ - \ group_by: \"document_id\".to_string(),\n group_size: 2,\n \ - \ positive: vec![100.into(), 200.into()],\n negative: vec![718.into()],\n\ - \ strategy: Some(RecommendStrategy::AverageVector.into()),\n \ - \ limit: 3,\n ..Default::default()\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.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 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: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.scroll(\"{collection_name}\", {\n filter: {\n must: [\n\ - \ {\n key: \"color\",\n match:\ - \ {\n value: \"red\",\n },\n \ - \ },\n ],\n },\n limit: 1,\n with_payload: true,\n\ - \ with_vector: false,\n});\n" - language: typescript - - code-samples: - - code: "use qdrant_client::{client::QdrantClient, qdrant::{Condition, Filter,\ - \ ScrollPoints}};\n\nlet client = QdrantClient::from_url(\"http://localhost:6334\"\ - ).build()?;\n\nclient\n .scroll(&ScrollPoints {\n collection_name:\ - \ \"{collection_name}\".to_string(),\n filter: Some(Filter::must([Condition::matches(\n\ - \ \"color\",\n \"red\".to_string(),\n )])),\n\ - \ limit: Some(1),\n with_payload: Some(true.into()),\n \ - \ with_vectors: Some(false.into()),\n ..Default::default()\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 static io.qdrant.client.ConditionFactory.matchKeyword;\nimport\ - \ static io.qdrant.client.WithPayloadSelectorFactory.enable;\n\nimport\ - \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.ScrollPoints;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .scrollAsync(\n \ - \ ScrollPoints.newBuilder()\n .setCollectionName(\"{collection_name}\"\ - )\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"\ - color\", \"red\")).build())\n .setLimit(1)\n .setWithPayload(enable(true))\n\ - \ .build())\n .get();\n" - language: java - /collections/{collection_name}/points/search: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{Condition,\ - \ Filter, SearchParams, SearchPoints},\n};\n\nlet client = QdrantClient::from_url(\"\ - http://localhost:6334\").build()?;\n\nclient\n .search_points(&SearchPoints\ - \ {\n collection_name: \"{collection_name}\".to_string(),\n \ - \ filter: Some(Filter::must([Condition::matches(\n \"city\"\ - ,\n \"London\".to_string(),\n )])),\n params:\ - \ Some(SearchParams {\n hnsw_ef: Some(128),\n exact:\ - \ Some(false),\n ..Default::default()\n }),\n \ - \ vector: vec![0.2, 0.1, 0.9, 0.7],\n limit: 3,\n ..Default::default()\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.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 static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ - import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .searchAsync(\n \ - \ SearchPoints.newBuilder()\n .setCollectionName(\"{collection_name}\"\ - )\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"\ - city\", \"London\")).build())\n .addAllVector(List.of(0.2f,\ - \ 0.1f, 0.9f, 0.7f))\n .setLimit(3)\n .build())\n\ - \ .get();\n" - language: java - /collections/{collection_name}/points/search/batch: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::{Condition,\ - \ Filter, SearchBatchPoints, SearchPoints},\n};\n\nlet client = QdrantClient::from_url(\"\ - http://localhost:6334\").build()?;\n\nlet filter = Filter::must([Condition::matches(\"\ - city\", \"London\".to_string())]);\n\nlet searches = vec![\n SearchPoints\ - \ {\n collection_name: \"{collection_name}\".to_string(),\n \ - \ vector: vec![0.2, 0.1, 0.9, 0.7],\n filter: Some(filter.clone()),\n\ - \ limit: 3,\n ..Default::default()\n },\n SearchPoints\ - \ {\n collection_name: \"{collection_name}\".to_string(),\n \ - \ vector: vec![0.5, 0.3, 0.2, 0.3],\n filter: Some(filter),\n\ - \ limit: 3,\n ..Default::default()\n },\n];\n\nclient\n\ - \ .search_batch_points(&SearchBatchPoints {\n collection_name:\ - \ \"{collection_name}\".to_string(),\n search_points: searches,\n\ - \ read_consistency: None,\n ..Default::default()\n })\n\ - \ .await?;\n" - language: rust - - 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: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\ - \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"\ - city\", \"London\")).build();\nList searches =\n List.of(\n\ - \ SearchPoints.newBuilder()\n .addAllVector(List.of(0.2f,\ - \ 0.1f, 0.9f, 0.7f))\n .setFilter(filter)\n .setLimit(3)\n\ - \ .build(),\n SearchPoints.newBuilder()\n \ - \ .addAllVector(List.of(0.5f, 0.3f, 0.2f, 0.3f))\n .setFilter(filter)\n\ - \ .setLimit(3)\n .build());\nclient.searchBatchAsync(\"\ - {collection_name}\", searches, null).get();\n" - language: java - /collections/{collection_name}/points/search/groups: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "use qdrant_client::{\n client::QdrantClient,\n qdrant::SearchPointGroups,\n\ - };\n\nlet client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ - \nclient\n .search_groups(&SearchPointGroups {\n collection_name:\ - \ \"{collection_name}\".to_string(),\n vector: vec![1.1],\n \ - \ group_by: \"document_id\".to_string(),\n limit: 4,\n \ - \ group_size: 2,\n ..Default::default()\n })\n .await?;\n" - language: rust - - 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: "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/vectors: - put: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.updateVectors(\"{collection_name}\", {\n points: [\n \ - \ {\n id: 1,\n vector: {\n image:\ - \ [0.1, 0.2, 0.3, 0.4],\n },\n },\n {\n \ - \ id: 2,\n vector: {\n text: [0.9, 0.8,\ - \ 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n },\n ],\n\ - });\n" - language: typescript - - code-samples: - - code: "use qdrant_client::qdrant::PointVectors;\nuse std::collections::HashMap;\n\ - \nclient\n .update_vectors_blocking(\n \"{collection_name}\"\ - ,\n None,\n &[\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])]).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 None,\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.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 static io.qdrant.client.PointIdFactory.id;\nimport static\ - \ io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\ - \nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\n\ - import io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new\ - \ QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\"\ - , 6334, false).build());\n\nclient\n .updateVectorsAsync(\n \ - \ \"{collection_name}\",\n List.of(\n PointVectors.newBuilder()\n\ - \ .setId(id(1))\n .setVectors(namedVectors(Map.of(\"\ - image\", vector(List.of(0.1f, 0.2f, 0.3f, 0.4f)))))\n .build(),\n\ - \ PointVectors.newBuilder()\n .setId(id(2))\n\ - \ .setVectors(\n namedVectors(\n \ - \ Map.of(\n \"text\", vector(List.of(0.9f,\ - \ 0.8f, 0.7f, 0.6f, 0.5f, 0.4f, 0.3f, 0.2f)))))\n .build()))\n\ - \ .get();\n" - language: java - /collections/{collection_name}/points/vectors/delete: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.deleteVectors(\"{collection_name}\", {\n points: [0, 3, 10],\n\ - \ vectors: [\"text\", \"image\"],\n});\n" - language: typescript - - code-samples: - - code: "use qdrant_client::{client::QdrantClient, qdrant::{\n points_selector::PointsSelectorOneOf,\ - \ PointsIdsList, PointsSelector, VectorsSelector,\n}};\n\nlet client =\ - \ QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\nclient\n\ - \ .delete_vectors_blocking(\n \"{collection_name}\",\n \ - \ None,\n &PointsSelector {\n points_selector_one_of:\ - \ Some(PointsSelectorOneOf::Points(PointsIdsList {\n ids:\ - \ vec![0.into(), 3.into(), 10.into()],\n })),\n },\n\ - \ &VectorsSelector {\n names: vec![\"text\".into(),\ - \ \"image\".into()],\n },\n None,\n )\n .await?;\n" - language: rust - - 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: "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 - /collections/{collection_name}/shards: - put: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n\ - });\n\nclient.createShardKey(\"{collection_name}\", {\n shard_key:\ - \ \"{shard_key}\"\n});\n" - language: typescript - - code-samples: - - code: "use qdrant_client::{client::QdrantClient, qdrant::shard_key::Key};\n\ - \nlet client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ - \nclient\n .create_shard_key(\n \"{collection_name}\",\n \ - \ &Key::Keyword(\"{shard_key\".to_string()),\n None,\n \ - \ None,\n &[],\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.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 - - - client = QdrantClient(url="http://localhost:6333") - - - client.create_shard_key("{collection_name}", "{shard_key}") - - ' - 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.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 - /collections/{collection_name}/shards/delete: - post: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n\ - });\n\nclient.deleteShardKey(\"{collection_name}\", {\n shard_key:\ - \ \"{shard_key}\"\n});\n" - language: typescript - - code-samples: - - code: "use qdrant_client::{client::QdrantClient, qdrant::shard_key::Key};\n\ - \nlet client = QdrantClient::from_url(\"http://localhost:6334\").build()?;\n\ - \nclient\n .delete_shard_key(\"{collection_name}\", &Key::Keyword(\"\ - {shard_key\".to_string()))\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.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 - - - client = QdrantClient(url="http://localhost:6333") - - - client.delete_shard_key("{collection_name}", "{shard_key}") - - ' - 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.deleteShardKeyAsync(DeleteShardKeyRequest.newBuilder()\n\ - \ .setCollectionName(\"{collection_name}\")\n \ - \ .setRequest(DeleteShardKey.newBuilder()\n \ - \ .setShardKey(shardKey(\"{shard_key}\"))\n \ - \ .build())\n .build()).get();\n" - language: java - /collections/{collection_name}/snapshots: - get: - x-fern-examples: - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.listSnapshots("{collection_name}"); - - ' - language: typescript - - code-samples: - - code: 'use qdrant_client::client::QdrantClient; - - - let client = QdrantClient::from_url("http://localhost:6334").build()?; - - - client.list_snapshots("{collection_name}").await?; - - ' - language: rust - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ListSnapshotsAsync("{collection_name}"); - - ' - 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-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 - post: - x-fern-examples: - - 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: 'use qdrant_client::client::QdrantClient; - - - let client = QdrantClient::from_url("http://localhost:6334").build()?; - - - client.create_snapshot("{collection_name}").await?; - - ' - language: rust - - 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 - - - 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: - x-fern-examples: - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.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/{snapshot_name}: - delete: - x-fern-examples: - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.deleteSnapshot("{collection_name}", "{snapshot_name}"); - - ' - language: typescript - - code-samples: - - code: "use qdrant_client::client::QdrantClient;\n\nlet client = QdrantClient::from_url(\"\ - http://localhost:6334\").build()?;\n\nclient\n .delete_snapshot(\"\ - {collection_name}\", \"{snapshot_name}\")\n .await?;\n" - language: rust - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.DeleteSnapshotAsync("{collection_name}", "{snapshot_name}"); - - ' - 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 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 - /snapshots: - get: - x-fern-examples: - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - - - const client = new QdrantClient({ host: "localhost", port: 6333 }); - - - client.listFullSnapshots(); - - ' - language: typescript - - code-samples: - - code: 'use qdrant_client::client::QdrantClient; - - - let client = QdrantClient::from_url("http://localhost:6334").build()?; - - - client.list_full_snapshots().await?; - - ' - language: rust - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ListFullSnapshotsAsync(); - - ' - language: csharp - - 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: - x-fern-examples: - - 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: 'use qdrant_client::client::QdrantClient; - - - let client = QdrantClient::from_url("http://localhost:6334").build()?; - - - client.create_full_snapshot().await?; - - ' - language: rust - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.CreateFullSnapshotAsync(); - - ' - language: csharp - - 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: - x-fern-examples: - - 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: 'use qdrant_client::client::QdrantClient; - - - let client = QdrantClient::from_url("http://localhost:6334").build()?; - - - client.delete_full_snapshot("{snapshot_name}").await?; - - ' - language: rust - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.DeleteFullSnapshotAsync("{snapshot_name}"); - - ' - 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-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