diff --git a/fern/apis/master/openapi-overrides.yml b/fern/apis/master/openapi-overrides.yml index a205c95..68e9dff 100644 --- a/fern/apis/master/openapi-overrides.yml +++ b/fern/apis/master/openapi-overrides.yml @@ -10,9 +10,6 @@ paths: /aliases: get: x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listAliasesAsync().get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc listAliases() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\taliases, err := client.ListAliases(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Aliases: \", aliases)\n}\n" language: go @@ -28,16 +25,16 @@ paths: ' language: csharp - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'from qdrant_client import QdrantClient - const client = new QdrantClient({ host: "localhost", port: 6333 }); + client = QdrantClient(url="http://localhost:6333") - client.getAliases(); + client.get_aliases() ' - language: typescript + language: python - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/aliases' \\\n --header 'api-key: '" language: curl @@ -53,16 +50,19 @@ paths: ' language: rust - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.get_aliases() + client.getAliases(); ' - language: python + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listAliasesAsync().get();\n" + language: java description: Retrieves a list of all existing aliases. summary: List all aliases tags: @@ -70,9 +70,6 @@ paths: /collections: get: x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listCollectionsAsync().get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc listCollections() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tcollections, err := client.ListCollections(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Collections: \", collections)\n}\n" language: go @@ -88,16 +85,16 @@ paths: ' language: csharp - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'from qdrant_client import QdrantClient - const client = new QdrantClient({ host: "localhost", port: 6333 }); + client = QdrantClient(url="http://localhost:6333") - client.getCollections(); + client.get_collections() ' - language: typescript + language: python - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/collections' \\\n --header 'api-key: '" language: curl @@ -113,16 +110,19 @@ paths: ' language: rust - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.get_collections() + client.getCollections(); ' - language: python + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listCollectionsAsync().get();\n" + language: java description: Returns a list of all existing collections. summary: List all collections tags: @@ -130,9 +130,6 @@ paths: /collections/aliases: post: x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.DeleteShardKey;\nimport io.qdrant.client.grpc.Collections.DeleteShardKeyRequest;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createAliasAsync(\"production_collection\", \"example_collection\").get();\n\nclient.deleteAliasAsync(\"production_collection\").get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc updateAlias() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.CreateAlias(context.Background(), \"production_collection\", \"example_collection\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteAlias(context.Background(), \"production_collection\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.RenameAlias(context.Background(), \"production_collection\", \"legacy_collection\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go @@ -151,8 +148,8 @@ paths: ' language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.updateCollectionAliases({\n actions: [\n {\n create_alias: {\n collection_name: \"example_collection\",\n alias_name: \"production_collection\",\n },\n },\n ],\n});\n\nclient.updateCollectionAliases({\n actions: [\n {\n delete_alias: {\n alias_name: \"production_collection\",\n },\n },\n ],\n});\n" - language: typescript + - code: "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: "# Create an alias\ncurl -X POST \\\n 'http://localhost:6333/collections/aliases' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"actions\": [\n {\n \"create_alias\": {\n \"collection_name\": \"{collection_name}\",\n \"alias_name\": \"{alias_name}\"\n }\n }\n ]\n}'\n\n# Delete an alias\ncurl -X POST \\\n 'http://localhost:6333/collections/aliases' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"actions\": [\n {\n \"delete_alias\": {\n \"alias_name\": \"{alias_name}\"\n }\n }\n ]\n}'\n\n# Rename an alias\ncurl -X POST \\\n 'http://localhost:6333/collections/aliases' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"actions\": [\n {\n \"rename_alias\": {\n \"old_alias_name\": \"{old_alias_name}\",\n \"new_alias_name\": \"{new_alias_name}\"\n }\n }\n ]\n}'\n" language: curl @@ -160,8 +157,11 @@ paths: - code: "use qdrant_client::qdrant::{CreateAliasBuilder, DeleteAlias};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .create_alias(CreateAliasBuilder::new(\n \"example_collection\",\n \"production_collection\",\n ))\n .await?;\n\nclient\n .delete_alias(DeleteAlias {\n alias_name: \"production_collection\".to_string(),\n })\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.update_collection_aliases(\n change_aliases_operations=[\n models.CreateAliasOperation(\n create_alias=models.CreateAlias(\n collection_name=\"example_collection\", alias_name=\"production_collection\"\n )\n )\n ]\n)\n\nclient.update_collection_aliases(\n change_aliases_operations=[\n models.DeleteAliasOperation(\n delete_alias=models.DeleteAlias(alias_name=\"production_collection\")\n ),\n ]\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.updateCollectionAliases({\n actions: [\n {\n create_alias: {\n collection_name: \"example_collection\",\n alias_name: \"production_collection\",\n },\n },\n ],\n});\n\nclient.updateCollectionAliases({\n actions: [\n {\n delete_alias: {\n alias_name: \"production_collection\",\n },\n },\n ],\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.DeleteShardKey;\nimport io.qdrant.client.grpc.Collections.DeleteShardKeyRequest;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createAliasAsync(\"production_collection\", \"example_collection\").get();\n\nclient.deleteAliasAsync(\"production_collection\").get();\n" + language: java description: Updates aliases for the specified collections. summary: Update collection aliases tags: @@ -169,9 +169,6 @@ paths: /collections/{collection_name}: delete: x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteCollectionAsync(\"{collection_name}\").get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteCollection(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go @@ -187,16 +184,16 @@ paths: ' language: csharp - code-samples: - - code: 'import { QdrantClient } from ''@qdrant/qdrant-js''; + - code: 'from qdrant_client import QdrantClient - const client = new QdrantClient({url: ''http://127.0.0.1:6333''}); + client = QdrantClient(url="http://localhost:6333") - client.deleteCollection("{collection_name}"); + client.delete_collection(collection_name="{collection_name}") ' - language: typescript + language: python - code-samples: - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: '" language: curl @@ -212,25 +209,25 @@ paths: ' language: rust - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from ''@qdrant/qdrant-js''; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({url: ''http://127.0.0.1:6333''}); - client.delete_collection(collection_name="{collection_name}") + client.deleteCollection("{collection_name}"); ' - language: python + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteCollectionAsync(\"{collection_name}\").get();\n" + language: java description: Drops the specified collection and all associated data in it. summary: Delete a collection tags: - Collections get: x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.getCollectionInfoAsync(\"{collection_name}\").get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc getCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tinfo, err := client.GetCollectionInfo(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Collection info: \", info)\n}\n" language: go @@ -246,16 +243,16 @@ paths: ' language: csharp - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'from qdrant_client import QdrantClient - const client = new QdrantClient({ host: "localhost", port: 6333 }); + client = QdrantClient(url="http://localhost:6333") - client.getCollection("{collection_name}"); + client.get_collection("{collection_name}") ' - language: typescript + language: python - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: '" language: curl @@ -271,25 +268,25 @@ paths: ' language: rust - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.get_collection("{collection_name}") + client.getCollection("{collection_name}"); ' - language: python + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.getCollectionInfoAsync(\"{collection_name}\").get();\n" + language: java description: Retrieves parameters from the specified collection. summary: Get collection details tags: - Collections patch: x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.OptimizersConfigDiff;\nimport io.qdrant.client.grpc.Collections.UpdateCollection;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.updateCollectionAsync(\n UpdateCollection.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setOptimizersConfig(\n OptimizersConfigDiff.newBuilder().setIndexingThreshold(10000).build())\n .build());\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc updateCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tthreshold := uint64(10000)\n\terr = client.UpdateCollection(context.Background(), &qdrant.UpdateCollection{\n\t\tCollectionName: \"{collection_name}\",\n\t\tOptimizersConfig: &qdrant.OptimizersConfigDiff{\n\t\t\tIndexingThreshold: &threshold,\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go @@ -297,8 +294,8 @@ paths: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateCollectionAsync(\n collectionName: \"{collection_name}\",\n optimizersConfig: new OptimizersConfigDiff { IndexingThreshold = 10000 }\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.updateCollection(\"{collection_name}\", {\n optimizers_config: {\n indexing_threshold: 10000,\n },\n});\n" - language: typescript + - code: "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: "curl -X PATCH \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"optimizers_config\": {\n \"indexing_threshold\": 10000\n }\n}'" language: curl @@ -306,17 +303,17 @@ paths: - code: "use qdrant_client::qdrant::{OptimizersConfigDiffBuilder, UpdateCollectionBuilder};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .update_collection(\n UpdateCollectionBuilder::new(\"{collection_name}\").optimizers_config(\n OptimizersConfigDiffBuilder::default().indexing_threshold(10_000),\n ),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.update_collection(\n collection_name=\"{collection_name}\",\n optimizer_config=models.OptimizersConfigDiff(indexing_threshold=10000),\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.updateCollection(\"{collection_name}\", {\n optimizers_config: {\n indexing_threshold: 10000,\n },\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.OptimizersConfigDiff;\nimport io.qdrant.client.grpc.Collections.UpdateCollection;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.updateCollectionAsync(\n UpdateCollection.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setOptimizersConfig(\n OptimizersConfigDiff.newBuilder().setIndexingThreshold(10000).build())\n .build());\n" + language: java description: Updates the parameters of the specified collection. summary: Update collection parameters tags: - Collections put: x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.Distance;\nimport io.qdrant.client.grpc.Collections.VectorParams;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createCollectionAsync(\"{collection_name}\",\n VectorParams.newBuilder().setDistance(Distance.Cosine).setSize(100).build()).get();\n\n// Or with sparse vectors\n\nclient.createCollectionAsync(\n CreateCollection.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setSparseVectorsConfig(\n Collections.SparseVectorConfig.newBuilder().putMap(\n \"splade-model-name\",\n Collections.SparseVectorParams.newBuilder()\n .setIndex(\n Collections.SparseIndexConfig\n .newBuilder()\n .setOnDisk(false)\n .build()\n ).build()\n ).build()\n ).build()\n).get();" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc createCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.CreateCollection(context.Background(), &qdrant.CreateCollection{\n\t\tCollectionName: \"{collection_name}\",\n\t\tVectorsConfig: qdrant.NewVectorsConfig(&qdrant.VectorParams{\n\t\t\tSize: 100,\n\t\t\tDistance: qdrant.Distance_Cosine,\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go @@ -324,8 +321,8 @@ paths: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.CreateCollectionAsync(\n\tcollectionName: \"{collection_name}\",\n\tvectorsConfig: new VectorParams { Size = 100, Distance = Distance.Cosine }\n);\n\n// Or with sparse vectors\n\nawait client.CreateCollectionAsync(\n\tcollectionName: \"{collection_name}\",\n\tsparseVectorsConfig: (\"splade-model-name\", new SparseVectorParams{\n Index = new SparseIndexConfig {\n OnDisk = false,\n }\n })\n);" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.createCollection(\"{collection_name}\", {\n vectors: { size: 100, distance: \"Cosine\" },\n});\n\n// or with sparse vectors\n\nclient.createCollection(\"{collection_name}\", {\n vectors: { size: 100, distance: \"Cosine\" },\n sparse_vectors: {\n \"splade-model-name\": {\n index: {\n on_disk: false\n }\n }\n }\n});" - language: typescript + - code: "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: "# Create a collection with default dense vector\ncurl -X PUT \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"vectors\": {\n \"size\": 384,\n \"distance\": \"Cosine\"\n }\n}'\n\n# Create a collection with named dense and sparse vectors\ncurl -X PUT \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"vectors\": {\n \"dense-vector-name\": {\n \"size\": 1536,\n \"distance\": \"Cosine\"\n }\n },\n \"sparse_vectors\": {\n \"sparse-vector-name\": {\n \"index\": {\n \"on_disk\": true\n }\n }\n }\n}'\n" language: curl @@ -333,8 +330,11 @@ paths: - code: "use qdrant_client::qdrant::{CreateCollectionBuilder, Distance, VectorParamsBuilder};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .create_collection(\n CreateCollectionBuilder::new(\"{collection_name}\")\n .vectors_config(VectorParamsBuilder::new(100, Distance::Cosine)),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.create_collection(\n collection_name=\"{collection_name}\",\n vectors_config=models.VectorParams(size=100, distance=models.Distance.COSINE),\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.createCollection(\"{collection_name}\", {\n vectors: { size: 100, distance: \"Cosine\" },\n});\n\n// or with sparse vectors\n\nclient.createCollection(\"{collection_name}\", {\n vectors: { size: 100, distance: \"Cosine\" },\n sparse_vectors: {\n \"splade-model-name\": {\n index: {\n on_disk: false\n }\n }\n }\n});" + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.Distance;\nimport io.qdrant.client.grpc.Collections.VectorParams;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createCollectionAsync(\"{collection_name}\",\n VectorParams.newBuilder().setDistance(Distance.Cosine).setSize(100).build()).get();\n\n// Or with sparse vectors\n\nclient.createCollectionAsync(\n CreateCollection.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setSparseVectorsConfig(\n Collections.SparseVectorConfig.newBuilder().putMap(\n \"splade-model-name\",\n Collections.SparseVectorParams.newBuilder()\n .setIndex(\n Collections.SparseIndexConfig\n .newBuilder()\n .setOnDisk(false)\n .build()\n ).build()\n ).build()\n ).build()\n).get();" + language: java description: Creates a new collection with the given parameters. summary: Create a collection tags: @@ -342,9 +342,6 @@ paths: /collections/{collection_name}/aliases: get: x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listCollectionAliasesAsync(\"{collection_name}\").get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc listCollectionAliases() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\taliases, err := client.ListCollectionAliases(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Collection aliases: \", aliases)\n}\n" language: go @@ -360,16 +357,16 @@ paths: ' language: csharp - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'from qdrant_client import QdrantClient - const client = new QdrantClient({ host: "localhost", port: 6333 }); + client = QdrantClient(url="http://localhost:6333") - client.getCollectionAliases("{collection_name}"); + client.get_collection_aliases("{collection_name}") ' - language: typescript + language: python - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/aliases' \\\n --header 'api-key: '" language: curl @@ -385,16 +382,19 @@ paths: ' language: rust - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.get_collection_aliases("{collection_name}") + client.getCollectionAliases("{collection_name}"); ' - language: python + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listCollectionAliasesAsync(\"{collection_name}\").get();\n" + language: java description: Retrieves a list of all aliases for the specified collection. summary: List collection aliases tags: @@ -402,22 +402,6 @@ paths: /collections/{collection_name}/exists: get: x-fern-examples: - - code-samples: - - code: 'import static io.qdrant.client.ConditionFactory.matchKeyword; - - - import io.qdrant.client.QdrantClient; - - import io.qdrant.client.QdrantGrpcClient; - - - QdrantClient client = new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build()); - - - client.collectionExistsAsync("{collection_name}").get(); - -' - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc collectionExists() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\texists, err := client.CollectionExists(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Collection exists: \", exists)\n}\n" language: go @@ -433,16 +417,14 @@ paths: ' language: csharp - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'from qdrant_client import QdrantClient - const client = new QdrantClient({ host: "localhost", port: 6333 }); - + client = QdrantClient(url="http://localhost:6333") - client.collectionExists("{collection_name}"); -' - language: typescript + client.collection_exists(collection_name="{collection_name}")' + language: python - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/exists' \\\n --header 'api-key: '" language: curl @@ -458,14 +440,32 @@ paths: ' language: rust - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.collection_exists(collection_name="{collection_name}")' - language: python + client.collectionExists("{collection_name}"); + +' + language: typescript + - code-samples: + - code: 'import static io.qdrant.client.ConditionFactory.matchKeyword; + + + import io.qdrant.client.QdrantClient; + + import io.qdrant.client.QdrantGrpcClient; + + + QdrantClient client = new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build()); + + + client.collectionExistsAsync("{collection_name}").get(); + +' + language: java description: Checks whether the specified collection exists. summary: Check collection existence tags: @@ -473,9 +473,6 @@ paths: /collections/{collection_name}/facet: post: x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\nimport io.qdrant.client.grpc.Points;\nimport io.qdrant.client.grpc.Filter;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .facetAsync(\n Points.FacetCounts.newBuilder()\n .setCollectionName(collection_name)\n .setKey(\"my-payload-key\")\n .setFilter(\n Filter.newBuilder()\n .addMust(matchKeyword(\"color\", \"red\"))\n .build())\n .build())\n .get();" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc facet() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tlimit := uint64(10)\n\tresults, err := client.Facet(context.Background(), &qdrant.FacetCounts{\n\t\tCollectionName: \"{collection_name}\",\n\t\tKey: \"my-payload-key\",\n\t\tLimit: &limit,\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go @@ -483,14 +480,17 @@ paths: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.FacetAsync(\n\t\"{collection_name}\",\n\tfilter: MatchKeyword(\"color\", \"red\"),\n\tkey: \"my-payload-key\",\n\tlimit: 10\n);" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.facet(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n key: \"my-payload-key\",\n limit: 10,\n});\n" - language: typescript + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.facet(\n collection_name=\"{collection_name}\",\n key=\"my-payload-key\",\n facet_filter=models.Filter(must=[models.Match(\"color\", \"red\")]),\n limit=10,\n)\n\n" + language: python - code-samples: - code: "use qdrant_client::qdrant::{Condition, FacetCountsBuilder, Filter};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .facet(\n FacetCountsBuilder::new(\"{collection_name}\", \"my-payload-key\")\n .limit(10)\n .filter(Filter::must(vec![Condition::matches(\n \"color\",\n \"red\".to_string(),\n )])),\n )\n .await?;" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.facet(\n collection_name=\"{collection_name}\",\n key=\"my-payload-key\",\n facet_filter=models.Filter(must=[models.Match(\"color\", \"red\")]),\n limit=10,\n)\n\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.facet(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n key: \"my-payload-key\",\n limit: 10,\n});\n" + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\nimport io.qdrant.client.grpc.Points;\nimport io.qdrant.client.grpc.Filter;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .facetAsync(\n Points.FacetCounts.newBuilder()\n .setCollectionName(collection_name)\n .setKey(\"my-payload-key\")\n .setFilter(\n Filter.newBuilder()\n .addMust(matchKeyword(\"color\", \"red\"))\n .build())\n .build())\n .get();" + language: java description: Retrieves facets for the specified payload field. summary: Payload field facets tags: @@ -498,9 +498,6 @@ paths: /collections/{collection_name}/index: put: x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.PayloadSchemaType;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createPayloadIndexAsync(\n \"{collection_name}\",\n \"{field_name}\",\n PayloadSchemaType.Keyword,\n null,\n true,\n null,\n null);\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc createFieldIndex() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.CreateFieldIndex(context.Background(), &qdrant.CreateFieldIndexCollection{\n\t\tCollectionName: \"{collection_name}\",\n\t\tFieldName: \"name_of_the_field_to_index\",\n\t\tFieldType: qdrant.FieldType_FieldTypeKeyword.Enum(),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go @@ -508,8 +505,8 @@ paths: - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.CreatePayloadIndexAsync(\n collectionName: \"{collection_name}\",\n fieldName: \"name_of_the_field_to_index\"\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.createPayloadIndex(\"{collection_name}\", {\n field_name: \"{field_name}\",\n field_schema: \"keyword\",\n});\n" - language: typescript + - code: "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: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/index' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"field_name\": \"field_name\",\n \"field_schema\": \"keyword\"\n}'" language: curl @@ -517,8 +514,11 @@ paths: - code: "use qdrant_client::qdrant::{CreateFieldIndexCollectionBuilder, FieldType};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .create_field_index(\n CreateFieldIndexCollectionBuilder::new(\n \"{collection_name}\",\n \"{field_name}\",\n FieldType::Keyword,\n ),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.create_payload_index(\n collection_name=\"{collection_name}\",\n field_name=\"name_of_the_field_to_index\",\n field_schema=\"keyword\",\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.createPayloadIndex(\"{collection_name}\", {\n field_name: \"{field_name}\",\n field_schema: \"keyword\",\n});\n" + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.PayloadSchemaType;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createPayloadIndexAsync(\n \"{collection_name}\",\n \"{field_name}\",\n PayloadSchemaType.Keyword,\n null,\n true,\n null,\n null);\n" + language: java description: Creates a payload index for a field in the specified collection. summary: Create payload index tags: @@ -526,9 +526,6 @@ paths: /collections/{collection_name}/index/{field_name}: delete: x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deletePayloadIndexAsync(\"{collection_name}\", \"{field_name}\", true, null, null).get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteFieldIndex() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.DeleteFieldIndex(context.Background(), &qdrant.DeleteFieldIndexCollection{\n\t\tCollectionName: \"{collection_name}\",\n\t\tFieldName: \"{field_name}\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go @@ -536,16 +533,16 @@ paths: - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.DeletePayloadIndexAsync(\n collectionName: \"{collection_name}\",\n fieldName: \"name_of_the_field_to_index\"\n);\n" language: csharp - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'from qdrant_client import QdrantClient - const client = new QdrantClient({ host: "localhost", port: 6333 }); + client = QdrantClient(url="http://localhost:6333") - client.deletePayloadIndex("{collection_name}", "{field_name}"); + client.delete_payload_index("{collection_name}", "{field_name}"); ' - language: typescript + language: python - code-samples: - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/index/field_name' \\\n --header 'api-key: '" language: curl @@ -553,16 +550,19 @@ paths: - code: "use qdrant_client::qdrant::DeleteFieldIndexCollectionBuilder;\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .delete_field_index(DeleteFieldIndexCollectionBuilder::new(\n \"{collection_name}\",\n \"{field_name}\",\n ))\n .await?;\n" language: rust - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.delete_payload_index("{collection_name}", "{field_name}"); + client.deletePayloadIndex("{collection_name}", "{field_name}"); ' - language: python + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deletePayloadIndexAsync(\"{collection_name}\", \"{field_name}\", true, null, null).get();\n" + language: java description: Deletes a payload index for a field in the specified collection. summary: Delete payload index tags: @@ -570,9 +570,6 @@ paths: /collections/{collection_name}/points: post: x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .retrieveAsync(\"{collection_name}\", List.of(id(0), id(30), id(100)), false, false, null)\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc getPoints() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tpoints, err := client.Get(context.Background(), &qdrant.GetPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tIds: []*qdrant.PointId{\n\t\t\tqdrant.NewIDNum(0), qdrant.NewID(\"3\"), qdrant.NewIDNum(100),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Points: \", points)\n}\n" language: go @@ -580,8 +577,8 @@ paths: - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RetrieveAsync(\n collectionName: \"{collection_name}\",\n ids: [0, 30, 100],\n withPayload: false,\n withVectors: false\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.retrieve(\"{collection_name}\", {\n ids: [0, 3, 100],\n});\n" - language: typescript + - code: "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: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"ids\": [\n 0,\n 3,\n 100\n ]\n}'" language: curl @@ -589,17 +586,17 @@ paths: - code: "use qdrant_client::qdrant::GetPointsBuilder;\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .get_points(GetPointsBuilder::new(\n \"{collection_name}\",\n vec![0.into(), 30.into(), 100.into()],\n ))\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.retrieve(\n collection_name=\"{collection_name}\",\n ids=[0, 3, 100],\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.retrieve(\"{collection_name}\", {\n ids: [0, 3, 100],\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .retrieveAsync(\"{collection_name}\", List.of(id(0), id(30), id(100)), false, false, null)\n .get();\n" + language: java description: Retrieves all details from multiple points. summary: Retrieve points tags: - Points put: x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.PointStruct;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .upsertAsync(\n \"{collection_name}\",\n List.of(\n PointStruct.newBuilder()\n .setId(id(1))\n .setVectors(\n namedVectors(\n Map.of(\n \"image\",\n vector(List.of(0.9f, 0.1f, 0.1f, 0.2f)),\n \"text\",\n vector(List.of(0.4f, 0.7f, 0.1f, 0.8f, 0.1f, 0.1f, 0.9f, 0.2f)))))\n .build(),\n PointStruct.newBuilder()\n .setId(id(2))\n .setVectors(\n namedVectors(\n Map.of(\n \"image\",\n List.of(0.2f, 0.1f, 0.3f, 0.9f),\n \"text\",\n List.of(0.5f, 0.2f, 0.7f, 0.4f, 0.7f, 0.2f, 0.3f, 0.9f))))\n .build()))\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc upsert() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresponse, err := client.Upsert(context.Background(), &qdrant.UpsertPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: []*qdrant.PointStruct{\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(1),\n\t\t\t\tVectors: qdrant.NewVectors(0.9, 0.1, 0.1),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\t\t\"color\": \"red\",\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(2),\n\t\t\t\tVectors: qdrant.NewVectors(0.1, 0.9, 0.1),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\t\t\"color\": \"green\",\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(3),\n\t\t\t\tVectors: qdrant.NewVectors(0.1, 0.1, 0.9),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\t\t\"color\": \"blue\",\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Upsert status: \", response.GetStatus())\n}\n" language: go @@ -607,8 +604,8 @@ paths: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.UpsertAsync(\n collectionName: \"{collection_name}\",\n points: new List\n {\n new()\n {\n Id = 1,\n Vectors = new[] { 0.9f, 0.1f, 0.1f },\n Payload = { [\"city\"] = \"red\" }\n },\n new()\n {\n Id = 2,\n Vectors = new[] { 0.1f, 0.9f, 0.1f },\n Payload = { [\"city\"] = \"green\" }\n },\n new()\n {\n Id = 3,\n Vectors = new[] { 0.1f, 0.1f, 0.9f },\n Payload = { [\"city\"] = \"blue\" }\n }\n }\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.upsert(\"{collection_name}\", {\n points: [\n {\n id: 1,\n payload: { color: \"red\" },\n vector: [0.9, 0.1, 0.1],\n },\n {\n id: 2,\n payload: { color: \"green\" },\n vector: [0.1, 0.9, 0.1],\n },\n {\n id: 3,\n payload: { color: \"blue\" },\n vector: [0.1, 0.1, 0.9],\n },\n ],\n});\n" - language: typescript + - code: "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: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"points\": [\n {\n \"id\": \"76874cce-1fb9-4e16-9b0b-f085ac06ed6f\",\n \"payload\": {\n \"color\": \"red\"\n },\n \"vector\": [\n 0.9,\n 0.1,\n 0.1\n ]\n },\n {\n \"id\": 1,\n \"payload\": {\n \"color\": \"green\"\n },\n \"vector\": [\n 0.1,\n 0.9,\n 0.1\n ]\n },\n {\n \"id\": 2,\n \"payload\": {\n \"color\": \"blue\"\n },\n \"vector\": [\n 0.1,\n 0.1,\n 0.9\n ]\n }\n ]\n}'" language: curl @@ -616,8 +613,11 @@ paths: - code: "use qdrant_client::qdrant::{PointStruct, UpsertPointsBuilder};\nuse qdrant_client::{Qdrant, Payload};\nuse serde_json::json;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .upsert_points(\n UpsertPointsBuilder::new(\n \"{collection_name}\",\n vec![\n PointStruct::new(\n 1,\n vec![0.9, 0.1, 0.1],\n Payload::try_from(json!(\n {\"color\": \"red\"}\n ))\n .unwrap(),\n ),\n PointStruct::new(\n 2,\n vec![0.1, 0.9, 0.1],\n Payload::try_from(json!(\n {\"color\": \"green\"}\n ))\n .unwrap(),\n ),\n PointStruct::new(\n 3,\n vec![0.1, 0.1, 0.9],\n Payload::try_from(json!(\n {\"color\": \"blue\"}\n ))\n .unwrap(),\n ),\n ],\n )\n .wait(true),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.upsert(\n collection_name=\"{collection_name}\",\n points=[\n models.PointStruct(\n id=1,\n payload={\n \"color\": \"red\",\n },\n vector=[0.9, 0.1, 0.1],\n ),\n models.PointStruct(\n id=2,\n payload={\n \"color\": \"green\",\n },\n vector=[0.1, 0.9, 0.1],\n ),\n models.PointStruct(\n id=3,\n payload={\n \"color\": \"blue\",\n },\n vector=[0.1, 0.1, 0.9],\n ),\n ],\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.upsert(\"{collection_name}\", {\n points: [\n {\n id: 1,\n payload: { color: \"red\" },\n vector: [0.9, 0.1, 0.1],\n },\n {\n id: 2,\n payload: { color: \"green\" },\n vector: [0.1, 0.9, 0.1],\n },\n {\n id: 3,\n payload: { color: \"blue\" },\n vector: [0.1, 0.1, 0.9],\n },\n ],\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.PointStruct;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .upsertAsync(\n \"{collection_name}\",\n List.of(\n PointStruct.newBuilder()\n .setId(id(1))\n .setVectors(\n namedVectors(\n Map.of(\n \"image\",\n vector(List.of(0.9f, 0.1f, 0.1f, 0.2f)),\n \"text\",\n vector(List.of(0.4f, 0.7f, 0.1f, 0.8f, 0.1f, 0.1f, 0.9f, 0.2f)))))\n .build(),\n PointStruct.newBuilder()\n .setId(id(2))\n .setVectors(\n namedVectors(\n Map.of(\n \"image\",\n List.of(0.2f, 0.1f, 0.3f, 0.9f),\n \"text\",\n List.of(0.5f, 0.2f, 0.7f, 0.4f, 0.7f, 0.2f, 0.3f, 0.9f))))\n .build()))\n .get();\n" + language: java description: Performs the insert + update action on specified points. Any point with an existing {id} will be overwritten. summary: Upsert points tags: @@ -625,9 +625,6 @@ paths: /collections/{collection_name}/points/batch: post: x-fern-examples: - - code-samples: - - code: "import java.util.List;\nimport java.util.Map;\n\nimport static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.ValueFactory.value;\nimport static io.qdrant.client.VectorsFactory.vectors;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.PointStruct;\nimport io.qdrant.client.grpc.Points.PointVectors;\nimport io.qdrant.client.grpc.Points.PointsIdsList;\nimport io.qdrant.client.grpc.Points.PointsSelector;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation.PointStructList;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation.SetPayload;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation.UpdateVectors;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .batchUpdateAsync(\n \"{collection_name}\",\n List.of(\n PointsUpdateOperation.newBuilder()\n .setUpsert(\n PointStructList.newBuilder()\n .addPoints(\n PointStruct.newBuilder()\n .setId(id(1))\n .setVectors(vectors(\n 1.0 f,\n 2.0 f,\n 3.0 f,\n 4.0 f))\n .build())\n .build())\n .build(),\n PointsUpdateOperation.newBuilder()\n .setUpdateVectors(\n UpdateVectors.newBuilder()\n .addPoints(\n PointVectors.newBuilder()\n .setId(id(1))\n .setVectors(vectors(\n 1.0 f,\n 2.0 f,\n 3.0 f,\n 4.0 f))\n .build())\n .build())\n .build(),\n PointsUpdateOperation.newBuilder()\n .setSetPayload(\n SetPayload.newBuilder()\n .setPointsSelector(\n PointsSelector.newBuilder()\n .setPoints(PointsIdsList\n .newBuilder()\n .addIds(id(1))\n .build())\n .build())\n .putAllPayload(\n Map.of(\"test_payload_2\",\n value(2),\n \"test_payload_3\",\n value(3)))\n .build())\n .build()))\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc batchUpdate() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.UpdateBatch(context.Background(), &qdrant.UpdateBatchPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tOperations: []*qdrant.PointsUpdateOperation{\n\t\t\tqdrant.NewPointsUpdateUpsert(&qdrant.PointsUpdateOperation_PointStructList{\n\t\t\t\tPoints: []*qdrant.PointStruct{{\n\t\t\t\t\tId: qdrant.NewIDNum(1),\n\t\t\t\t\tVectors: qdrant.NewVectors(1.0, 2.0, 3.0, 4.0),\n\t\t\t\t}},\n\t\t\t}),\n\t\t\tqdrant.NewPointsUpdateUpdateVectors(&qdrant.PointsUpdateOperation_UpdateVectors{\n\t\t\t\tPoints: []*qdrant.PointVectors{\n\t\t\t\t\t{\n\t\t\t\t\t\tId: qdrant.NewIDNum(1),\n\t\t\t\t\t\tVectors: qdrant.NewVectors(0.1, 0.2, 0.3, 0.4),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t\tqdrant.NewPointsUpdateSetPayload(&qdrant.PointsUpdateOperation_SetPayload{\n\t\t\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(1)),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\t\t\"test_payload_2\": 2,\n\t\t\t\t\t\"test_payload_3\": 3,\n\t\t\t\t}),\n\t\t\t}),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go @@ -635,8 +632,8 @@ paths: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateBatchAsync(\n \"{collection_name}\",\n [\n new()\n {\n Upsert = new()\n {\n Points =\n {\n new PointStruct { Id = 1, Vectors = new[] { 0.9f, 0.1f, 0.1f } },\n }\n }\n },\n new()\n {\n UpdateVectors = new()\n {\n Points =\n {\n new PointVectors { Id = 1, Vectors = new[] { 0.9f, 0.1f, 0.1f } },\n }\n }\n },\n new()\n {\n SetPayload = new()\n {\n PointsSelector = new PointsSelector { Points = new PointsIdsList { Ids = { 1 } } },\n Payload = { [\"test_payload_2\"] = 2, [\"test_payload_3\"] = 3 }\n }\n }\n ]\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.batchUpdate(\"{collection_name}\", {\n operations: [\n {\n upsert: {\n points: [\n {\n id: 1,\n vector: [1.0, 2.0, 3.0, 4.0],\n payload: {},\n },\n ],\n },\n },\n {\n update_vectors: {\n points: [\n {\n id: 1,\n vector: [1.0, 2.0, 3.0, 4.0],\n },\n ],\n },\n },\n {\n set_payload: {\n payload: {\n test_payload_2: 2,\n test_payload_3: 3,\n },\n points: [1],\n },\n },\n ],\n});\n" - language: typescript + - code: "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: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/batch' \\\n --header 'Content-Type: application/json' \\\n --header 'api-key: ' \\\n --data-raw '{\n \"operations\": [\n {\n \"upsert\": {\n \"points\": [\n {\n \"id\": 1,\n \"vector\": [\n 0.4,\n 0.3,\n 0.2,\n 0.1\n ]\n }\n ]\n }\n },\n {\n \"update_vectors\": {\n \"points\": [\n {\n \"id\": 1,\n \"vector\": [\n 0.11,\n 0.22,\n 0.33,\n 0.44\n ]\n }\n ]\n }\n },\n {\n \"set_payload\": {\n \"payload\": {\n \"test_payload_2\": 2,\n \"test_payload_3\": 3\n },\n \"points\": [\n 1\n ]\n }\n }\n ]\n}'" language: curl @@ -644,8 +641,11 @@ paths: - code: "use qdrant_client::qdrant::{\n points_selector::PointsSelectorOneOf,\n points_update_operation::{\n Operation, OverwritePayload, PointStructList, UpdateVectors,\n },\n PointStruct, PointVectors, PointsIdsList, PointsSelector, PointsUpdateOperation,\n UpdateBatchPointsBuilder,\n};\nuse qdrant_client::{Qdrant, Payload};\nuse serde_json::json;\nuse std::collections::HashMap;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .update_points_batch(\n UpdateBatchPointsBuilder::new(\n \"{collection_name}\",\n vec![\n PointsUpdateOperation {\n operation: Some(Operation::Upsert(PointStructList {\n points: vec![PointStruct::new(\n 1,\n vec![1.0, 2.0, 3.0, 4.0],\n Payload::try_from(json!({})).unwrap(),\n )],\n ..Default::default()\n })),\n },\n PointsUpdateOperation {\n operation: Some(Operation::UpdateVectors(UpdateVectors {\n points: vec![PointVectors {\n id: Some(1.into()),\n vectors: Some(vec![1.0, 2.0, 3.0, 4.0].into()),\n }],\n ..Default::default()\n })),\n },\n PointsUpdateOperation {\n operation: Some(Operation::OverwritePayload(OverwritePayload {\n points_selector: Some(PointsSelector {\n points_selector_one_of: Some(PointsSelectorOneOf::Points(\n PointsIdsList {\n ids: vec![1.into()],\n },\n )),\n }),\n payload: HashMap::from([(\"test_payload\".to_string(), 1.into())]),\n ..Default::default()\n })),\n },\n ],\n )\n .wait(true),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.batch_update_points(\n collection_name=\"{collection_name}\",\n update_operations=[\n models.UpsertOperation(\n upsert=models.PointsList(\n points=[\n models.PointStruct(\n id=1,\n vector=[1.0, 2.0, 3.0, 4.0],\n payload={},\n ),\n ]\n )\n ),\n models.UpdateVectorsOperation(\n update_vectors=models.UpdateVectors(\n points=[\n models.PointVectors(\n id=1,\n vector=[1.0, 2.0, 3.0, 4.0],\n )\n ]\n )\n ),\n models.SetPayloadOperation(\n set_payload=models.SetPayload(\n payload={\n \"test_payload_2\": 2,\n \"test_payload_3\": 3,\n },\n points=[1],\n )\n ),\n ],\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.batchUpdate(\"{collection_name}\", {\n operations: [\n {\n upsert: {\n points: [\n {\n id: 1,\n vector: [1.0, 2.0, 3.0, 4.0],\n payload: {},\n },\n ],\n },\n },\n {\n update_vectors: {\n points: [\n {\n id: 1,\n vector: [1.0, 2.0, 3.0, 4.0],\n },\n ],\n },\n },\n {\n set_payload: {\n payload: {\n test_payload_2: 2,\n test_payload_3: 3,\n },\n points: [1],\n },\n },\n ],\n});\n" + language: typescript + - code-samples: + - code: "import java.util.List;\nimport java.util.Map;\n\nimport static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.ValueFactory.value;\nimport static io.qdrant.client.VectorsFactory.vectors;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.PointStruct;\nimport io.qdrant.client.grpc.Points.PointVectors;\nimport io.qdrant.client.grpc.Points.PointsIdsList;\nimport io.qdrant.client.grpc.Points.PointsSelector;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation.PointStructList;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation.SetPayload;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation.UpdateVectors;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .batchUpdateAsync(\n \"{collection_name}\",\n List.of(\n PointsUpdateOperation.newBuilder()\n .setUpsert(\n PointStructList.newBuilder()\n .addPoints(\n PointStruct.newBuilder()\n .setId(id(1))\n .setVectors(vectors(\n 1.0 f,\n 2.0 f,\n 3.0 f,\n 4.0 f))\n .build())\n .build())\n .build(),\n PointsUpdateOperation.newBuilder()\n .setUpdateVectors(\n UpdateVectors.newBuilder()\n .addPoints(\n PointVectors.newBuilder()\n .setId(id(1))\n .setVectors(vectors(\n 1.0 f,\n 2.0 f,\n 3.0 f,\n 4.0 f))\n .build())\n .build())\n .build(),\n PointsUpdateOperation.newBuilder()\n .setSetPayload(\n SetPayload.newBuilder()\n .setPointsSelector(\n PointsSelector.newBuilder()\n .setPoints(PointsIdsList\n .newBuilder()\n .addIds(id(1))\n .build())\n .build())\n .putAllPayload(\n Map.of(\"test_payload_2\",\n value(2),\n \"test_payload_3\",\n value(3)))\n .build())\n .build()))\n .get();\n" + language: java description: Batch updates points, including their respective vectors and payloads. summary: Batch update points tags: @@ -653,9 +653,6 @@ paths: /collections/{collection_name}/points/count: post: x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Common.Filter;\n\nQdrantClient client = new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .countAsync(\n \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"color\", \"red\")).build(),\n true)\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc count() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tcount, err := client.Count(context.Background(), &qdrant.CountPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Count:\", count)\n}\n" language: go @@ -663,8 +660,8 @@ paths: - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.CountAsync(\n collectionName: \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"),\n exact: true\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.count(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n exact: true,\n});\n" - language: typescript + - code: "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: "# Count total number of points in a collection\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/count' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"exact\": true\n}'\n\n# Count points satisfying a filter condition\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/count' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n },\n \"exact\": true\n}'" language: curl @@ -672,8 +669,11 @@ paths: - code: "use qdrant_client::qdrant::{Condition, CountPointsBuilder, Filter};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .count(\n CountPointsBuilder::new(\"{collection_name}\")\n .filter(Filter::must([Condition::matches(\n \"color\",\n \"red\".to_string(),\n )]))\n .exact(true),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.count(\n collection_name=\"{collection_name}\",\n count_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n exact=True,\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.count(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n exact: true,\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Common.Filter;\n\nQdrantClient client = new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .countAsync(\n \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"color\", \"red\")).build(),\n true)\n .get();\n" + language: java description: Counts the number of points that match a specified filtering condition. summary: Count points tags: @@ -681,9 +681,6 @@ paths: /collections/{collection_name}/points/delete: post: x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Common.Filter;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteAsync(\"{collection_name}\", List.of(id(0), id(3), id(100)));\n\nclient\n .deleteAsync(\n \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"color\", \"red\")).build())\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc delete() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.Delete(context.Background(), &qdrant.DeletePoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: qdrant.NewPointsSelectorIDs([]*qdrant.PointId{\n\t\t\tqdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(100),\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.Delete(context.Background(), &qdrant.DeletePoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: qdrant.NewPointsSelectorFilter(&qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go @@ -702,8 +699,8 @@ paths: ' language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.delete(\"{collection_name}\", {\n points: [0, 3, 100],\n});\n\nclient.delete(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n});\n" - language: typescript + - code: "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: "# Delete points by IDs\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"points\": [\n 0,\n 3,\n 100\n ]\n}'\n\n# Delete points by filter \ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n }\n}'\n" language: curl @@ -711,8 +708,11 @@ paths: - code: "use qdrant_client::qdrant::{Condition, DeletePointsBuilder, Filter, PointsIdsList};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .delete_points(\n DeletePointsBuilder::new(\"{collection_name}\")\n .points(PointsIdsList {\n ids: vec![0.into(), 3.into(), 100.into()],\n })\n .wait(true),\n )\n .await?;\n\nclient\n .delete_points(\n DeletePointsBuilder::new(\"{collection_name}\")\n .points(Filter::must([Condition::matches(\n \"color\",\n \"red\".to_string(),\n )]))\n .wait(true),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete(\n collection_name=\"{collection_name}\",\n points_selector=models.PointIdsList(\n points=[0, 3, 100],\n ),\n)\n\nclient.delete(\n collection_name=\"{collection_name}\",\n points_selector=models.FilterSelector(\n filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"color\",\n match=models.MatchValue(value=\"red\"),\n ),\n ],\n )\n ),\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.delete(\"{collection_name}\", {\n points: [0, 3, 100],\n});\n\nclient.delete(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Common.Filter;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteAsync(\"{collection_name}\", List.of(id(0), id(3), id(100)));\n\nclient\n .deleteAsync(\n \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"color\", \"red\")).build())\n .get();\n" + language: java description: Deletes specified points from the collection. summary: Delete points tags: @@ -720,9 +720,6 @@ paths: /collections/{collection_name}/points/payload: post: x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.ValueFactory.value;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .setPayloadAsync(\n \"{collection_name}\",\n Map.of(\"property1\", value(\"string\"), \"property2\", value(\"string\")),\n List.of(id(0), id(3), id(10)),\n true,\n null,\n null)\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc setPayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresults, err := client.SetPayload(context.Background(), &qdrant.SetPayloadPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\"property1\": \"string\",\n\t\t\t\"property2\": \"string\",\n\t\t}),\n\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(10)),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go @@ -730,8 +727,8 @@ paths: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SetPayloadAsync(\n collectionName: \"{collection_name}\",\n payload: new Dictionary { { \"property1\", \"string\" }, { \"property2\", \"string\" } },\n ids: new ulong[] { 0, 3, 10 }\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.setPayload(\"{collection_name}\", {\n payload: {\n property1: \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n});\n" - language: typescript + - code: "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: "# Set payload by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"payload\": {\n \"property1\": \"some_value\",\n \"property2\": 32,\n \"property3\": true\n },\n \"points\": [\n 0,\n 3,\n 10\n ]\n}'\n\n# Set payload by filter\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n },\n \"payload\": {\n \"property1\": \"some_value\",\n \"property2\": 32,\n \"property3\": true\n }\n}'" language: curl @@ -739,17 +736,17 @@ paths: - code: "use qdrant_client::qdrant::{PointsIdsList, SetPayloadPointsBuilder};\nuse qdrant_client::{Qdrant, Payload};\nuse serde_json::json;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet payload: Payload = json!({\n \"property1\": \"string\",\n \"property2\": \"string\",\n})\n.try_into()\n.unwrap();\n\nclient\n .set_payload(\n SetPayloadPointsBuilder::new(\"{collection_name}\", payload)\n .points_selector(PointsIdsList {\n ids: vec![0.into(), 3.into(), 10.into()],\n })\n .wait(true),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.set_payload(\n collection_name=\"{collection_name}\",\n payload={\n \"property1\": \"string\",\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.setPayload(\"{collection_name}\", {\n payload: {\n property1: \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.ValueFactory.value;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .setPayloadAsync(\n \"{collection_name}\",\n Map.of(\"property1\", value(\"string\"), \"property2\", value(\"string\")),\n List.of(id(0), id(3), id(10)),\n true,\n null,\n null)\n .get();\n" + language: java description: Sets payload values for specified points. summary: Set payload tags: - Points put: x-fern-examples: - - code-samples: - - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.ValueFactory.value;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .overwritePayloadAsync(\n \"{collection_name}\",\n Map.of(\"property1\", value(\"string\"), \"property2\", value(\"string\")),\n List.of(id(0), id(3), id(10)),\n true,\n null,\n null)\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc overwritePayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.OverwritePayload(context.Background(), &qdrant.SetPayloadPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\"property1\": \"string\",\n\t\t\t\"property2\": \"string\",\n\t\t}),\n\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(10)),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go @@ -757,8 +754,8 @@ paths: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.OverwritePayloadAsync(\n collectionName: \"{collection_name}\",\n payload: new Dictionary { { \"property1\", \"string\" }, { \"property2\", \"string\" } },\n ids: new ulong[] { 0, 3, 10 }\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.overwritePayload(\"{collection_name}\", {\n payload: {\n property1: \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n});\n" - language: typescript + - code: "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: "# Overwrite payload by ID\ncurl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points/payload' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"payload\": {\n \"property1\": \"string\",\n \"property2\": \"string\"\n },\n \"points\": [\n 0,\n 3,\n 10\n ]\n}'\n\n# Overwrite payload by filter\ncurl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points/payload' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"payload\": {\n \"property1\": \"string\",\n \"property2\": \"string\"\n },\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n }\n}'" language: curl @@ -766,8 +763,11 @@ paths: - code: "use qdrant_client::qdrant::{\n points_selector::PointsSelectorOneOf, PointsIdsList, SetPayloadPointsBuilder,\n};\nuse qdrant_client::{Qdrant, Payload};\nuse serde_json::json;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet payload: Payload = json!({\n \"property1\": \"string\",\n \"property2\": \"string\",\n})\n.try_into()\n.unwrap();\n\nclient\n .overwrite_payload(\n SetPayloadPointsBuilder::new(\"{collection_name}\", payload)\n .points_selector(PointsSelectorOneOf::Points(PointsIdsList {\n ids: vec![0.into(), 3.into(), 10.into()],\n }))\n .wait(true),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.overwrite_payload(\n collection_name=\"{collection_name}\",\n payload={\n \"property1\": \"string\",\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.overwritePayload(\"{collection_name}\", {\n payload: {\n property1: \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n});\n" + language: typescript + - code-samples: + - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.ValueFactory.value;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .overwritePayloadAsync(\n \"{collection_name}\",\n Map.of(\"property1\", value(\"string\"), \"property2\", value(\"string\")),\n List.of(id(0), id(3), id(10)),\n true,\n null,\n null)\n .get();\n" + language: java description: Replaces the entire payload of a specified point with a new payload. summary: Overwrite payload tags: @@ -775,9 +775,6 @@ paths: /collections/{collection_name}/points/payload/clear: post: x-fern-examples: - - code-samples: - - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.clearPayloadAsync(\"{collection_name}\", List.of(id(0), id(3), id(100)), null, null, null)\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc clearPayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.ClearPayload(context.Background(), &qdrant.ClearPayloadPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewID(\"3\"), qdrant.NewIDNum(100)),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go @@ -793,8 +790,8 @@ paths: ' language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.clearPayload(\"{collection_name}\", {\n points: [0, 3, 100],\n});\n" - language: typescript + - code: "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: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload/clear' \\\n --header 'Content-Type: application/json' \\\n --header 'api-key: ' \\\n --data-raw '{\n \"points\": [\n 0,\n 3,\n 100\n ]\n}'" language: curl @@ -802,8 +799,11 @@ paths: - code: "use qdrant_client::qdrant::{ClearPayloadPointsBuilder, PointsIdsList};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .clear_payload(ClearPayloadPointsBuilder::new(\"{collection_name}\").points(\n PointsIdsList {\n ids: vec![0.into(), 3.into(), 100.into()],\n },\n ))\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.clear_payload(\n collection_name=\"{collection_name}\",\n points_selector=[0, 3, 100],\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.clearPayload(\"{collection_name}\", {\n points: [0, 3, 100],\n});\n" + language: typescript + - code-samples: + - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.clearPayloadAsync(\"{collection_name}\", List.of(id(0), id(3), id(100)), null, null, null)\n .get();\n" + language: java description: Removes the entire payload for specified points. summary: Clear payload tags: @@ -811,9 +811,6 @@ paths: /collections/{collection_name}/points/payload/delete: post: x-fern-examples: - - code-samples: - - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .deletePayloadAsync(\n \"{collection_name}\",\n List.of(\"color\", \"price\"),\n List.of(id(0), id(3), id(100)),\n true,\n null,\n null)\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deletePayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.DeletePayload(context.Background(), &qdrant.DeletePayloadPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(100)),\n\t\tKeys: []string{\"color\", \"price\"},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go @@ -829,8 +826,8 @@ paths: ' language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.deletePayload(\"{collection_name}\", {\n keys: [\"color\", \"price\"],\n points: [0, 3, 100],\n});\n" - language: typescript + - code: "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: "# Delete payload by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"keys\": [\n \"color\",\n \"price\"\n ],\n \"points\": [\n 0,\n 3,\n 100\n ]\n}'\n\n# Delete payload by filter\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"keys\": [\n \"color\",\n \"price\"\n ],\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n }\n}'" language: curl @@ -838,8 +835,11 @@ paths: - code: "use qdrant_client::qdrant::{DeletePayloadPointsBuilder, PointsIdsList};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .delete_payload(\n DeletePayloadPointsBuilder::new(\n \"{collection_name}\",\n vec![\"color\".to_string(), \"price\".to_string()],\n )\n .points_selector(PointsIdsList {\n ids: vec![0.into(), 3.into(), 100.into()],\n })\n .wait(true),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete_payload(\n collection_name=\"{collection_name}\",\n keys=[\"color\", \"price\"],\n points=[0, 3, 100],\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.deletePayload(\"{collection_name}\", {\n keys: [\"color\", \"price\"],\n points: [0, 3, 100],\n});\n" + language: typescript + - code-samples: + - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .deletePayloadAsync(\n \"{collection_name}\",\n List.of(\"color\", \"price\"),\n List.of(id(0), id(3), id(100)),\n true,\n null,\n null)\n .get();\n" + language: java description: Deletes a specified key payload for points. summary: Delete payload tags: @@ -847,9 +847,6 @@ paths: /collections/{collection_name}/points/query: post: x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.QueryFactory.fusion;\nimport static io.qdrant.client.QueryFactory.nearest;\nimport static io.qdrant.client.QueryFactory.recommend;\nimport static io.qdrant.client.VectorInputFactory.vectorInput;\n\nimport java.util.UUID;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\nimport io.qdrant.client.grpc.Points.Fusion;\nimport io.qdrant.client.grpc.Points.PrefetchQuery;\nimport io.qdrant.client.grpc.Points.QueryPoints;\nimport io.qdrant.client.grpc.Points.RecommendInput;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\n// Query nearest by ID\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setQuery(nearest(UUID.fromString(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")))\n .build())\n .get();\n\n// Recommend on the average of these vectors\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setQuery(\n recommend(\n RecommendInput.newBuilder()\n .addPositive(vectorInput(UUID.fromString(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")))\n .addPositive(vectorInput(0.11f, 0.35f, 0.6f))\n .addNegative(vectorInput(0.01f, 0.45f, 0.67f))\n .build()))\n .build())\n .get();\n\n// Fusion query\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .addPrefetch(\n PrefetchQuery.newBuilder()\n .setQuery(nearest(List.of(0.22f, 0.8f), List.of(1, 42)))\n .setUsing(\"sparse\")\n .setLimit(20)\n .build())\n .addPrefetch(\n PrefetchQuery.newBuilder()\n .setQuery(nearest(List.of(0.01f, 0.45f, 0.67f)))\n .setUsing(\"dense\")\n .setLimit(20)\n .build())\n .setQuery(fusion(Fusion.RRF))\n .build())\n .get();\n\n// 2-stage query\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .addPrefetch(\n PrefetchQuery.newBuilder()\n .setQuery(nearest(0.01f, 0.45f, 0.67f))\n .setLimit(100)\n .build())\n .setQuery(\n nearest(\n new float[][] {\n {0.1f, 0.2f},\n {0.2f, 0.1f},\n {0.8f, 0.9f}\n }))\n .setUsing(\"colbert\")\n .setLimit(10)\n .build())\n .get();\n\n// Random sampling (as of 1.11.0)\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setQuery(sample(Sample.Random))\n .build())\n .get();\n\n// Score boost depending on payload conditions (as of 1.14.0)\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .addPrefetch(\n PrefetchQuery.newBuilder()\n .setQuery(nearest(0.01f, 0.45f, 0.67f))\n .setLimit(100)\n .build())\n .setQuery(\n formula(\n Formula.newBuilder()\n .setExpression(\n sum(\n SumExpression.newBuilder()\n .addSum(variable(\"$score\"))\n .addSum(\n mult(\n MultExpression.newBuilder()\n .addMult(constant(0.5f))\n .addMult(\n condition(\n matchKeywords(\n \"tag\",\n List.of(\"h1\", \"h2\", \"h3\", \"h4\"))))\n .build()))\n .addSum(mult(MultExpression.newBuilder()\n .addMult(constant(0.25f))\n .addMult(\n condition(\n matchKeywords(\n \"tag\",\n List.of(\"p\", \"li\"))))\n .build()))\n .build()))\n .build()))\n .build())\n .get();\n\n// Score boost geographically closer points (as of 1.14.0)\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .addPrefetch(\n PrefetchQuery.newBuilder()\n .setQuery(nearest(0.01f, 0.45f, 0.67f))\n .setLimit(100)\n .build())\n .setQuery(\n formula(\n Formula.newBuilder()\n .setExpression(\n sum(\n SumExpression.newBuilder()\n .addSum(variable(\"$score\"))\n .addSum(\n expDecay(\n DecayParamsExpression.newBuilder()\n .setX(\n geoDistance(\n GeoDistance.newBuilder()\n .setOrigin(\n GeoPoint.newBuilder()\n .setLat(52.504043)\n .setLon(13.393236)\n .build())\n .setTo(\"geo.location\")\n .build()))\n .setScale(5000)\n .build()))\n .build()))\n .putDefaults(\n \"geo.location\",\n value(\n Map.of(\n \"lat\", value(48.137154),\n \"lon\", value(11.576124))))\n .build()))\n .build())\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc query() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Query nearest by ID\n\tpoints, err := client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQueryID(qdrant.NewID(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", points)\n\n\t// Recommend on the average of these vectors\n\tpoints, err = client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewID(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")),\n\t\t\t\tqdrant.NewVectorInput(0.11, 0.35, 0.6),\n\t\t\t},\n\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInput(0.01, 0.45, 0.67),\n\t\t\t},\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", points)\n\n\t// Fusion query\n\tpoints, err = client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPrefetch: []*qdrant.PrefetchQuery{\n\t\t\t{\n\t\t\t\tQuery: qdrant.NewQuerySparse([]uint32{1, 42}, []float32{0.22, 0.8}),\n\t\t\t\tUsing: qdrant.PtrOf(\"sparse\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\t\t\tUsing: qdrant.PtrOf(\"dense\"),\n\t\t\t},\n\t\t},\n\t\tQuery: qdrant.NewQueryFusion(qdrant.Fusion_RRF),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", points)\n\n\t// 2-stage query\n\tpoints, err = client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPrefetch: []*qdrant.PrefetchQuery{\n\t\t\t{\n\t\t\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\t\t},\n\t\t},\n\t\tQuery: qdrant.NewQueryMulti([][]float32{\n\t\t\t{0.1, 0.2},\n\t\t\t{0.2, 0.1},\n\t\t\t{0.8, 0.9},\n\t\t}),\n\t\tUsing: qdrant.PtrOf(\"colbert\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", points)\n\n\t// Random sampling (as of 1.11.0)\n\tpoints, err = client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQuerySample(qdrant.Sample_Random),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", points)\n\n\t// Score boost depending on payload conditions (as of 1.14.0)\n\tpoints, err = client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPrefetch: []*qdrant.PrefetchQuery{\n\t\t\t{\n\t\t\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\t\t},\n\t\t},\n\t\tQuery: qdrant.NewQueryFormula(&qdrant.Formula{\n\t\t\tExpression: qdrant.NewExpressionSum(&qdrant.SumExpression{\n\t\t\t\tSum: []*qdrant.Expression{\n\t\t\t\t\tqdrant.NewExpressionVariable(\"$score\"),\n\t\t\t\t\tqdrant.NewExpressionMult(&qdrant.MultExpression{\n\t\t\t\t\t\tMult: []*qdrant.Expression{\n\t\t\t\t\t\t\tqdrant.NewExpressionConstant(0.5),\n\t\t\t\t\t\t\tqdrant.NewExpressionCondition(qdrant.NewMatchKeywords(\"tag\", \"h1\", \"h2\", \"h3\", \"h4\")),\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t\tqdrant.NewExpressionMult(&qdrant.MultExpression{\n\t\t\t\t\t\tMult: []*qdrant.Expression{\n\t\t\t\t\t\t\tqdrant.NewExpressionConstant(0.25),\n\t\t\t\t\t\t\tqdrant.NewExpressionCondition(qdrant.NewMatchKeywords(\"tag\", \"p\", \"li\")),\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t})\n\n\t// Score boost geographically closer points (as of 1.14.0)\n\tclient.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPrefetch: []*qdrant.PrefetchQuery{\n\t\t\t{\n\t\t\t\tQuery: qdrant.NewQuery(0.2, 0.8),\n\t\t\t},\n\t\t},\n\t\tQuery: qdrant.NewQueryFormula(&qdrant.Formula{\n\t\t\tExpression: qdrant.NewExpressionSum(&qdrant.SumExpression{\n\t\t\t\tSum: []*qdrant.Expression{\n\t\t\t\t\tqdrant.NewExpressionVariable(\"$score\"),\n\t\t\t\t\tqdrant.NewExpressionExpDecay(&qdrant.DecayParamsExpression{\n\t\t\t\t\t\tX: qdrant.NewExpressionGeoDistance(&qdrant.GeoDistance{\n\t\t\t\t\t\t\tOrigin: &qdrant.GeoPoint{\n\t\t\t\t\t\t\t\tLat: 52.504043,\n\t\t\t\t\t\t\t\tLon: 13.393236,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tTo: \"geo.location\",\n\t\t\t\t\t\t}),\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t}),\n\t\t\tDefaults: qdrant.NewValueMap(map[string]any{\n\t\t\t\t\"geo.location\": map[string]any{\n\t\t\t\t\t\"lat\": 48.137154,\n\t\t\t\t\t\"lon\": 11.576124,\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t})\n}\n" language: go @@ -857,8 +854,8 @@ paths: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\n// Query nearest by ID\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tquery: Guid.Parse(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")\n);\n\n// Recommend on the average of these vectors\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tquery: new RecommendInput\n\t{\n\t\tPositive =\n\t\t{\n\t\t\tGuid.Parse(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"),\n\t\t\tnew float[] { 0.11f, 0.35f, 0.6f }\n\t\t},\n\t\tNegative = { new float[] { 0.01f, 0.45f, 0.67f } }\n\t}\n);\n\n// Fusion query\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tprefetch: new List\n\t{\n\t\tnew()\n\t\t{\n\t\t\tQuery = new (float, uint)[] { (0.22f, 1), (0.8f, 42), },\n\t\t\tUsing = \"sparse\",\n\t\t\tLimit = 20\n\t\t},\n\t\tnew()\n\t\t{\n\t\t\tQuery = new float[] { 0.01f, 0.45f, 0.67f },\n\t\t\tUsing = \"dense\",\n\t\t\tLimit = 20\n\t\t}\n\t},\n\tquery: Fusion.Rrf\n);\n\n// 2-stage query\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tprefetch: new List\n\t{\n\t\tnew() { Query = new float[] { 0.01f, 0.45f, 0.67f }, Limit = 100 }\n\t},\n\tquery: new float[][] { [0.1f, 0.2f], [0.2f, 0.1f], [0.8f, 0.9f] },\n\tusingVector: \"colbert\",\n\tlimit: 10\n);\n\n// Random sampling (as of 1.11.0)\nawait client.QueryAsync(\n collectionName: \"{collection_name}\",\n query: Sample.Random\n);\n\n// Score boost depending on payload conditions (as of 1.14.0)\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tprefetch:\n\t[\n\t\tnew PrefetchQuery { Query = new float[] { 0.01f, 0.45f, 0.67f }, Limit = 100 },\n\t],\n\tquery: new Formula\n\t{\n\t\tExpression = new SumExpression\n\t\t{\n\t\t\tSum =\n\t\t\t{\n\t\t\t\t\"$score\",\n\t\t\t\tnew MultExpression\n\t\t\t\t{\n\t\t\t\t\tMult = { 0.5f, Match(\"tag\", [\"h1\", \"h2\", \"h3\", \"h4\"]) },\n\t\t\t\t},\n\t\t\t\tnew MultExpression { Mult = { 0.25f, Match(\"tag\", [\"p\", \"li\"]) } },\n\t\t\t},\n\t\t},\n\t},\n\tlimit: 10\n);\n\n// Score boost geographically closer points (as of 1.14.0)\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tprefetch:\n\t[\n\t\tnew PrefetchQuery { Query = new float[] { 0.01f, 0.45f, 0.67f }, Limit = 100 },\n\t],\n\tquery: new Formula\n\t{\n\t\tExpression = new SumExpression\n\t\t{\n\t\t\tSum =\n\t\t\t{\n\t\t\t\t\"$score\",\n\t\t\t\tWithExpDecay(\n\t\t\t\t\tnew()\n\t\t\t\t\t{\n\t\t\t\t\t\tX = new GeoDistance\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tOrigin = new GeoPoint { Lat = 52.504043, Lon = 13.393236 },\n\t\t\t\t\t\t\tTo = \"geo.location\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\tScale = 5000,\n\t\t\t\t\t}\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t\tDefaults =\n\t\t{\n\t\t\t[\"geo.location\"] = new Dictionary\n\t\t\t{\n\t\t\t\t[\"lat\"] = 48.137154,\n\t\t\t\t[\"lon\"] = 11.576124,\n\t\t\t},\n\t\t},\n\t}\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n// Query nearest by ID\nlet _nearest = client.query(\"{collection_name\", {\n query: \"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\n});\n\n// Recommend on the average of these vectors\nlet _recommendations = client.query(\"{collection_name}\", {\n query: {\n recommend: {\n positive: [\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\", [0.11, 0.35, 0.6]],\n negative: [0.01, 0.45, 0.67]\n }\n }\n});\n\n// Fusion query\nlet _hybrid = client.query(\"{collection_name}\", {\n prefetch: [\n {\n query: {\n values: [0.22, 0.8],\n indices: [1, 42],\n },\n using: 'sparse',\n limit: 20,\n },\n {\n query: [0.01, 0.45, 0.67],\n using: 'dense',\n limit: 20,\n },\n ],\n query: {\n fusion: 'rrf',\n },\n});\n\n// 2-stage query\nlet _refined = client.query(\"{collection_name}\", {\n prefetch: {\n query: [1, 23, 45, 67],\n limit: 100,\n },\n query: [\n [0.1, 0.2],\n [0.2, 0.1],\n [0.8, 0.9],\n ],\n using: 'colbert',\n limit: 10,\n});\n\n// Random sampling (as of 1.11.0)\nlet _sampled = client.query(\"{collection_name}\", {\n query: { sample: \"random\" },\n});\n\n// Score boost depending on payload conditions (as of 1.14.0)\nconst tag_boosted = await client.query(\"{collection_name}\", {\n prefetch: {\n query: [0.2, 0.8, 0.1, 0.9],\n limit: 50\n },\n query: {\n formula: {\n sum: [\n \"$score\",\n {\n mult: [ 0.5, { key: \"tag\", match: { any: [\"h1\", \"h2\", \"h3\", \"h4\"] }} ]\n },\n {\n mult: [ 0.25, { key: \"tag\", match: { any: [\"p\", \"li\"] }} ]\n }\n ]\n }\n }\n});\n\n// Score boost geographically closer points (as of 1.14.0)\nconst distance_boosted = await client.query(\"{collection_name}\", {\n prefetch: {\n query: [0.2, 0.8, ...],\n limit: 50\n },\n query: {\n formula: {\n sum: [\n \"$score\",\n {\n gauss_decay: {\n x: {\n geo_distance: {\n origin: { lat: 52.504043, lon: 13.393236 }, // Berlin\n to: \"geo.location\"\n }\n },\n scale: 5000 // 5km\n }\n }\n ]\n },\n defaults: { \"geo.location\": { lat: 48.137154, lon: 11.576124 } } // Munich\n }\n});\n" - language: typescript + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\n# Query nearest by ID\nnearest = client.query_points(\n collection_name=\"{collection_name}\",\n query=\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\",\n)\n\n# Recommend on the average of these vectors\nrecommended = client.query_points(\n collection_name=\"{collection_name}\",\n query=models.RecommendQuery(recommend=models.RecommendInput(\n positive=[\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\", [0.11, 0.35, 0.6, ...]],\n negative=[[0.01, 0.45, 0.67, ...]]\n ))\n)\n\n# Fusion query\nhybrid = client.query_points(\n collection_name=\"{collection_name}\",\n prefetch=[\n models.Prefetch(\n query=models.SparseVector(indices=[1, 42], values=[0.22, 0.8]),\n using=\"sparse\",\n limit=20,\n ),\n models.Prefetch(\n query=[0.01, 0.45, 0.67, ...], # <-- dense vector\n using=\"dense\",\n limit=20,\n ),\n ],\n query=models.FusionQuery(fusion=models.Fusion.RRF),\n)\n\n# 2-stage query\nrefined = client.query_points(\n collection_name=\"{collection_name}\",\n prefetch=models.Prefetch(\n query=[0.01, 0.45, 0.67, ...], # <-- dense vector\n limit=100,\n ),\n query=[\n [0.1, 0.2, ...], # <─┐\n [0.2, 0.1, ...], # < ├─ multi-vector\n [0.8, 0.9, ...], # < ┘\n ],\n using=\"colbert\",\n limit=10,\n)\n\n# Random sampling (as of 1.11.0)\nsampled = client.query_points(\n collection_name=\"{collection_name}\",\n query=models.SampleQuery(sample=models.Sample.RANDOM)\n)\n\n# Score boost depending on payload conditions (as of 1.14.0)\ntag_boosted = client.query_points(\n collection_name=\"{collection_name}\",\n prefetch=models.Prefetch(\n query=[0.2, 0.8, ...], # <-- dense vector\n limit=50\n ),\n query=models.FormulaQuery(\n formula=models.SumExpression(sum=[\n \"$score\",\n models.MultExpression(mult=[0.5, models.FieldCondition(key=\"tag\", match=models.MatchAny(any=[\"h1\", \"h2\", \"h3\", \"h4\"]))]),\n models.MultExpression(mult=[0.25, models.FieldCondition(key=\"tag\", match=models.MatchAny(any=[\"p\", \"li\"]))])\n ]\n ))\n)\n\n# Score boost geographically closer points (as of 1.14.0)\ngeo_boosted = client.query_points(\n collection_name=\"{collection_name}\",\n prefetch=models.Prefetch(\n query=[0.2, 0.8, ...], # <-- dense vector\n limit=50\n ),\n query=models.FormulaQuery(\n formula=models.SumExpression(sum=[\n \"$score\",\n models.GaussDecayExpression(\n gauss_decay=models.DecayParamsExpression(\n x=models.GeoDistance(\n geo_distance=models.GeoDistanceParams(\n origin=models.GeoPoint(\n lat=52.504043,\n lon=13.393236\n ), # Berlin\n to=\"geo.location\"\n )\n ),\n scale=5000 # 5km\n )\n )\n ]),\n defaults={\"geo.location\": models.GeoPoint(lat=48.137154, lon=11.576124)} # Munich\n )\n)\n" + language: python - code-samples: - code: "# Query nearest by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"query\": \"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\n}'\n\n# Recommend on the average of these vectors\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"query\": {\n \"recommend\": {\n \"positive\": [\n [\n 0.11,\n 0.35,\n 0.6\n ]\n ],\n \"negative\": [\n \"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\",\n [\n 0.01,\n 0.45,\n 0.67\n ]\n ]\n }\n }\n}'\n\n# Fusion query\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"prefetch\": [\n {\n \"query\": {\n \"values\": [\n 0.22,\n 0.8\n ],\n \"indices\": [\n 1,\n 42\n ]\n },\n \"using\": \"sparse\",\n \"limit\": 20\n },\n {\n \"query\": [\n 0.01,\n 0.45,\n 0.67\n ],\n \"using\": \"dense\",\n \"limit\": 20\n }\n ],\n \"query\": {\n \"fusion\": \"rrf\"\n }\n}'\n\n# 2-stage query\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"prefetch\": {\n \"query\": [\n 1,\n 23,\n 45,\n 67\n ],\n \"limit\": 100\n },\n \"query\": [\n [\n 0.1,\n 0.2,\n 0.3\n ],\n [\n 0.2,\n 0.1,\n 0.35\n ],\n [\n 0.8,\n 0.9,\n 0.53\n ]\n ],\n \"using\": \"colbert\",\n \"limit\": 10\n}'\n\n# Random sampling (as of 1.11.0)\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"query\": {\n \"sample\": \"random\"\n }\n}'\n\n# Score boost depending on payload conditions (as of 1.14.0)\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"prefetch\": {\n \"query\": [0.2, 0.8, ...], // <-- dense vector\n \"limit\": 50\n }\n \"query\": {\n \"formula\": {\n \"sum\": [\n \"$score,\n { \"mult\": [ 0.5, { \"key\": \"tag\", \"match\": { \"any\": [\"h1\", \"h2\", \"h3\", \"h4\"] } } ] },\n { \"mult\": [ 0.25, { \"key\": \"tag\", \"match\": { \"any\": [\"p\", \"li\"] } } ] }\n ]\n }\n }\n}'\n\n# Score boost geographically closer points (as of 1.14.0)\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"prefetch\": { \"query\": [0.2, 0.8, ...], \"limit\": 50 },\n \"query\": {\n \"formula\": {\n \"sum\": [\n \"$score\",\n {\n \"gauss_decay\": {\n \"x\": {\n \"geo_distance\": {\n \"origin\": { \"lat\": 52.504043, \"lon\": 13.393236 } // Berlin\n \"to\": \"geo.location\"\n }\n },\n \"scale\": 5000 // 5km\n }\n }\n ]\n },\n \"defaults\": { \"geo.location\": {\"lat\": 48.137154, \"lon\": 11.576124} } // Munich\n }\n}'\n" language: curl @@ -866,8 +863,11 @@ paths: - code: "use qdrant_client::qdrant::{\n Condition, DecayParamsExpressionBuilder, Expression, FormulaBuilder, Fusion, GeoPoint,\n PointId, PrefetchQueryBuilder, Query, QueryPointsBuilder, RecommendInputBuilder,\n Sample,\n};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\n// Query nearest by ID\nlet _nearest = client.query(\n QueryPointsBuilder::new(\"{collection_name}\")\n .query(PointId::from(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"))\n).await?;\n\n// Recommend on the average of these vectors\nlet _recommendations = client.query(\n QueryPointsBuilder::new(\"{collection_name}\")\n .query(Query::new_recommend(\n RecommendInputBuilder::default()\n .add_positive(vec![0.1; 8])\n .add_negative(PointId::from(0))\n ))\n).await?;\n\n// Fusion query\nlet _hybrid = client.query(\n QueryPointsBuilder::new(\"{collection_name}\")\n .add_prefetch(PrefetchQueryBuilder::default()\n .query(vec![(1, 0.22), (42, 0.8)])\n .using(\"sparse\")\n .limit(20u64)\n )\n .add_prefetch(PrefetchQueryBuilder::default()\n .query(vec![0.01, 0.45, 0.67])\n .using(\"dense\")\n .limit(20u64)\n )\n .query(Fusion::Rrf)\n).await?;\n\n// 2-stage query\nlet _refined = client.query(\n QueryPointsBuilder::new(\"{collection_name}\")\n .add_prefetch(PrefetchQueryBuilder::default()\n .query(vec![0.01, 0.45, 0.67])\n .limit(100u64)\n )\n .query(vec![\n vec![0.1, 0.2],\n vec![0.2, 0.1],\n vec![0.8, 0.9],\n ])\n .using(\"colbert\")\n .limit(10u64)\n).await?;\n\n// Random sampling (as of 1.11.0)\nlet _sampled = client\n .query(\n QueryPointsBuilder::new(\"{collection_name}\")\n .query(Query::new_sample(Sample::Random))\n )\n .await?;\n\n// Score boost depending on payload conditions (as of 1.14.0)\nlet _tag_boosted = client.query(\n QueryPointsBuilder::new(\"{collection_name}\")\n .add_prefetch(PrefetchQueryBuilder::default()\n .query(vec![0.01, 0.45, 0.67])\n .limit(100u64)\n )\n .query(FormulaBuilder::new(Expression::sum_with([\n Expression::score(),\n Expression::mult_with([\n Expression::constant(0.5),\n Expression::condition(Condition::matches(\"tag\", [\"h1\", \"h2\", \"h3\", \"h4\"])),\n ]),\n Expression::mult_with([\n Expression::constant(0.25),\n Expression::condition(Condition::matches(\"tag\", [\"p\", \"li\"])),\n ]),\n ])))\n .limit(10)\n ).await?;\n\n// Score boost geographically closer points (as of 1.14.0)\nlet _geo_boosted = client.query(\n QueryPointsBuilder::new(\"{collection_name}\")\n .add_prefetch(\n PrefetchQueryBuilder::default()\n .query(vec![0.01, 0.45, 0.67])\n .limit(100u64),\n )\n .query(\n FormulaBuilder::new(Expression::sum_with([\n Expression::score(),\n Expression::exp_decay(\n DecayParamsExpressionBuilder::new(Expression::geo_distance_with(\n // Berlin\n GeoPoint { lat: 52.504043, lon: 13.393236 },\n \"geo.location\",\n ))\n .scale(5_000.0),\n ),\n ]))\n // Munich\n .add_default(\"geo.location\", GeoPoint { lat: 48.137154, lon: 11.576124 }),\n )\n .limit(10),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\n# Query nearest by ID\nnearest = client.query_points(\n collection_name=\"{collection_name}\",\n query=\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\",\n)\n\n# Recommend on the average of these vectors\nrecommended = client.query_points(\n collection_name=\"{collection_name}\",\n query=models.RecommendQuery(recommend=models.RecommendInput(\n positive=[\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\", [0.11, 0.35, 0.6, ...]],\n negative=[[0.01, 0.45, 0.67, ...]]\n ))\n)\n\n# Fusion query\nhybrid = client.query_points(\n collection_name=\"{collection_name}\",\n prefetch=[\n models.Prefetch(\n query=models.SparseVector(indices=[1, 42], values=[0.22, 0.8]),\n using=\"sparse\",\n limit=20,\n ),\n models.Prefetch(\n query=[0.01, 0.45, 0.67, ...], # <-- dense vector\n using=\"dense\",\n limit=20,\n ),\n ],\n query=models.FusionQuery(fusion=models.Fusion.RRF),\n)\n\n# 2-stage query\nrefined = client.query_points(\n collection_name=\"{collection_name}\",\n prefetch=models.Prefetch(\n query=[0.01, 0.45, 0.67, ...], # <-- dense vector\n limit=100,\n ),\n query=[\n [0.1, 0.2, ...], # <─┐\n [0.2, 0.1, ...], # < ├─ multi-vector\n [0.8, 0.9, ...], # < ┘\n ],\n using=\"colbert\",\n limit=10,\n)\n\n# Random sampling (as of 1.11.0)\nsampled = client.query_points(\n collection_name=\"{collection_name}\",\n query=models.SampleQuery(sample=models.Sample.RANDOM)\n)\n\n# Score boost depending on payload conditions (as of 1.14.0)\ntag_boosted = client.query_points(\n collection_name=\"{collection_name}\",\n prefetch=models.Prefetch(\n query=[0.2, 0.8, ...], # <-- dense vector\n limit=50\n ),\n query=models.FormulaQuery(\n formula=models.SumExpression(sum=[\n \"$score\",\n models.MultExpression(mult=[0.5, models.FieldCondition(key=\"tag\", match=models.MatchAny(any=[\"h1\", \"h2\", \"h3\", \"h4\"]))]),\n models.MultExpression(mult=[0.25, models.FieldCondition(key=\"tag\", match=models.MatchAny(any=[\"p\", \"li\"]))])\n ]\n ))\n)\n\n# Score boost geographically closer points (as of 1.14.0)\ngeo_boosted = client.query_points(\n collection_name=\"{collection_name}\",\n prefetch=models.Prefetch(\n query=[0.2, 0.8, ...], # <-- dense vector\n limit=50\n ),\n query=models.FormulaQuery(\n formula=models.SumExpression(sum=[\n \"$score\",\n models.GaussDecayExpression(\n gauss_decay=models.DecayParamsExpression(\n x=models.GeoDistance(\n geo_distance=models.GeoDistanceParams(\n origin=models.GeoPoint(\n lat=52.504043,\n lon=13.393236\n ), # Berlin\n to=\"geo.location\"\n )\n ),\n scale=5000 # 5km\n )\n )\n ]),\n defaults={\"geo.location\": models.GeoPoint(lat=48.137154, lon=11.576124)} # Munich\n )\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n// Query nearest by ID\nlet _nearest = client.query(\"{collection_name\", {\n query: \"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\n});\n\n// Recommend on the average of these vectors\nlet _recommendations = client.query(\"{collection_name}\", {\n query: {\n recommend: {\n positive: [\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\", [0.11, 0.35, 0.6]],\n negative: [0.01, 0.45, 0.67]\n }\n }\n});\n\n// Fusion query\nlet _hybrid = client.query(\"{collection_name}\", {\n prefetch: [\n {\n query: {\n values: [0.22, 0.8],\n indices: [1, 42],\n },\n using: 'sparse',\n limit: 20,\n },\n {\n query: [0.01, 0.45, 0.67],\n using: 'dense',\n limit: 20,\n },\n ],\n query: {\n fusion: 'rrf',\n },\n});\n\n// 2-stage query\nlet _refined = client.query(\"{collection_name}\", {\n prefetch: {\n query: [1, 23, 45, 67],\n limit: 100,\n },\n query: [\n [0.1, 0.2],\n [0.2, 0.1],\n [0.8, 0.9],\n ],\n using: 'colbert',\n limit: 10,\n});\n\n// Random sampling (as of 1.11.0)\nlet _sampled = client.query(\"{collection_name}\", {\n query: { sample: \"random\" },\n});\n\n// Score boost depending on payload conditions (as of 1.14.0)\nconst tag_boosted = await client.query(\"{collection_name}\", {\n prefetch: {\n query: [0.2, 0.8, 0.1, 0.9],\n limit: 50\n },\n query: {\n formula: {\n sum: [\n \"$score\",\n {\n mult: [ 0.5, { key: \"tag\", match: { any: [\"h1\", \"h2\", \"h3\", \"h4\"] }} ]\n },\n {\n mult: [ 0.25, { key: \"tag\", match: { any: [\"p\", \"li\"] }} ]\n }\n ]\n }\n }\n});\n\n// Score boost geographically closer points (as of 1.14.0)\nconst distance_boosted = await client.query(\"{collection_name}\", {\n prefetch: {\n query: [0.2, 0.8, ...],\n limit: 50\n },\n query: {\n formula: {\n sum: [\n \"$score\",\n {\n gauss_decay: {\n x: {\n geo_distance: {\n origin: { lat: 52.504043, lon: 13.393236 }, // Berlin\n to: \"geo.location\"\n }\n },\n scale: 5000 // 5km\n }\n }\n ]\n },\n defaults: { \"geo.location\": { lat: 48.137154, lon: 11.576124 } } // Munich\n }\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.QueryFactory.fusion;\nimport static io.qdrant.client.QueryFactory.nearest;\nimport static io.qdrant.client.QueryFactory.recommend;\nimport static io.qdrant.client.VectorInputFactory.vectorInput;\n\nimport java.util.UUID;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\nimport io.qdrant.client.grpc.Points.Fusion;\nimport io.qdrant.client.grpc.Points.PrefetchQuery;\nimport io.qdrant.client.grpc.Points.QueryPoints;\nimport io.qdrant.client.grpc.Points.RecommendInput;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\n// Query nearest by ID\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setQuery(nearest(UUID.fromString(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")))\n .build())\n .get();\n\n// Recommend on the average of these vectors\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setQuery(\n recommend(\n RecommendInput.newBuilder()\n .addPositive(vectorInput(UUID.fromString(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")))\n .addPositive(vectorInput(0.11f, 0.35f, 0.6f))\n .addNegative(vectorInput(0.01f, 0.45f, 0.67f))\n .build()))\n .build())\n .get();\n\n// Fusion query\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .addPrefetch(\n PrefetchQuery.newBuilder()\n .setQuery(nearest(List.of(0.22f, 0.8f), List.of(1, 42)))\n .setUsing(\"sparse\")\n .setLimit(20)\n .build())\n .addPrefetch(\n PrefetchQuery.newBuilder()\n .setQuery(nearest(List.of(0.01f, 0.45f, 0.67f)))\n .setUsing(\"dense\")\n .setLimit(20)\n .build())\n .setQuery(fusion(Fusion.RRF))\n .build())\n .get();\n\n// 2-stage query\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .addPrefetch(\n PrefetchQuery.newBuilder()\n .setQuery(nearest(0.01f, 0.45f, 0.67f))\n .setLimit(100)\n .build())\n .setQuery(\n nearest(\n new float[][] {\n {0.1f, 0.2f},\n {0.2f, 0.1f},\n {0.8f, 0.9f}\n }))\n .setUsing(\"colbert\")\n .setLimit(10)\n .build())\n .get();\n\n// Random sampling (as of 1.11.0)\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setQuery(sample(Sample.Random))\n .build())\n .get();\n\n// Score boost depending on payload conditions (as of 1.14.0)\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .addPrefetch(\n PrefetchQuery.newBuilder()\n .setQuery(nearest(0.01f, 0.45f, 0.67f))\n .setLimit(100)\n .build())\n .setQuery(\n formula(\n Formula.newBuilder()\n .setExpression(\n sum(\n SumExpression.newBuilder()\n .addSum(variable(\"$score\"))\n .addSum(\n mult(\n MultExpression.newBuilder()\n .addMult(constant(0.5f))\n .addMult(\n condition(\n matchKeywords(\n \"tag\",\n List.of(\"h1\", \"h2\", \"h3\", \"h4\"))))\n .build()))\n .addSum(mult(MultExpression.newBuilder()\n .addMult(constant(0.25f))\n .addMult(\n condition(\n matchKeywords(\n \"tag\",\n List.of(\"p\", \"li\"))))\n .build()))\n .build()))\n .build()))\n .build())\n .get();\n\n// Score boost geographically closer points (as of 1.14.0)\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .addPrefetch(\n PrefetchQuery.newBuilder()\n .setQuery(nearest(0.01f, 0.45f, 0.67f))\n .setLimit(100)\n .build())\n .setQuery(\n formula(\n Formula.newBuilder()\n .setExpression(\n sum(\n SumExpression.newBuilder()\n .addSum(variable(\"$score\"))\n .addSum(\n expDecay(\n DecayParamsExpression.newBuilder()\n .setX(\n geoDistance(\n GeoDistance.newBuilder()\n .setOrigin(\n GeoPoint.newBuilder()\n .setLat(52.504043)\n .setLon(13.393236)\n .build())\n .setTo(\"geo.location\")\n .build()))\n .setScale(5000)\n .build()))\n .build()))\n .putDefaults(\n \"geo.location\",\n value(\n Map.of(\n \"lat\", value(48.137154),\n \"lon\", value(11.576124))))\n .build()))\n .build())\n .get();\n" + language: java description: Universally query points. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries. summary: Query points tags: @@ -875,9 +875,6 @@ paths: /collections/{collection_name}/points/query/batch: post: x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.QueryFactory.nearest;\n\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\nimport io.qdrant.client.grpc.Points.QueryPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .queryBatchAsync(\n \"{collection_name}\",\n List.of(\n QueryPoints.newBuilder().setQuery(nearest(0.1f, 0.2f, 0.3f)).build(),\n QueryPoints.newBuilder().setQuery(nearest(0.4f, 0.5f, 0.6f)).build()))\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc queryBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresults, err := client.QueryBatch(context.Background(), &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\t\t},\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQuery(0.11, 0.35, 0.6),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go @@ -885,8 +882,8 @@ paths: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.QueryBatchAsync(\n\tcollectionName: \"{collection_name}\",\n\tqueries: new List\n\t{\n\t\tnew() { Query = new float[] { 0.1f, 0.2f, 0.3f }, },\n\t\tnew() { Query = new float[] { 0.4f, 0.5f, 0.6f }, }\n\t}\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.queryBatch(\"{collection_name\", {\n searches: [{\n query: [0.01, 0.45, 0.67]\n },\n {\n query: [0.11, 0.35, 0.6]\n }]\n});\n" - language: typescript + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nnearest = client.query_batch_points(\n collection_name=\"{collection_name}\",\n requests=[\n models.QueryRequest(\n query=[0.01, 0.45, 0.67, ...],\n ),\n models.QueryRequest(\n query=[0.11, 0.35, 0.6, ...],\n ),\n ]\n)" + language: python - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"query\": [\n 0.23,\n 0.325,\n 0.623\n ],\n \"limit\": 1\n },\n {\n \"query\": [\n 0.423,\n 0.23,\n 0.623\n ],\n \"limit\": 5,\n \"using\": \"image-vector\"\n }\n ]\n}'" language: curl @@ -894,8 +891,11 @@ paths: - code: "use qdrant_client::{Qdrant, QdrantError};\nuse qdrant_client::qdrant::{Query, QueryPointsBuilder, QueryBatchPointsBuilder};\n\nlet request = QueryBatchPointsBuilder::new(\"{collection_name}\", vec![\n QueryPointsBuilder::new(\"\")\n .query(Query::new_nearest(\n vec![0.1; 8],\n )).into(),\n QueryPointsBuilder::new(\"\")\n .query(Query::new_nearest(\n vec![0.3; 8],\n )).into(),\n]);\n\nlet response = client.query_batch(request).await?;" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nnearest = client.query_batch_points(\n collection_name=\"{collection_name}\",\n requests=[\n models.QueryRequest(\n query=[0.01, 0.45, 0.67, ...],\n ),\n models.QueryRequest(\n query=[0.11, 0.35, 0.6, ...],\n ),\n ]\n)" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.queryBatch(\"{collection_name\", {\n searches: [{\n query: [0.01, 0.45, 0.67]\n },\n {\n query: [0.11, 0.35, 0.6]\n }]\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.QueryFactory.nearest;\n\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\nimport io.qdrant.client.grpc.Points.QueryPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .queryBatchAsync(\n \"{collection_name}\",\n List.of(\n QueryPoints.newBuilder().setQuery(nearest(0.1f, 0.2f, 0.3f)).build(),\n QueryPoints.newBuilder().setQuery(nearest(0.4f, 0.5f, 0.6f)).build()))\n .get();\n" + language: java description: Universally query points in batch. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries. summary: Query points in batch tags: @@ -903,9 +903,6 @@ paths: /collections/{collection_name}/points/query/groups: post: x-fern-examples: - - code-samples: - - code: "import java.util.List;\n\nimport static io.qdrant.client.QueryFactory.nearest;\n\nimport io.qdrant.client.grpc.Points.QueryPointGroups;\nimport io.qdrant.client.grpc.Points.QueryPoints;\n\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .queryGroupsAsync(\n QueryPointGroups.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setGroupBy(\"document_id\")\n .setGroupSize(5)\n .setLimit(10)\n .setQuery(nearest(List.of(0.01f, 0.45f, 0.67f)))\n .build())\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc queryGroups() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tgroupSize := uint64(5)\n\tresults, err := client.QueryGroups(context.Background(), &qdrant.QueryPointGroups{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\tGroupBy: \"document_id\",\n\t\tGroupSize: &groupSize,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go @@ -913,8 +910,8 @@ paths: - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.QueryGroupsAsync(\n collectionName: \"{collection_name}\",\n groupBy: \"document_id\",\n groupSize: 5,\n limit: 10,\n query: new float[] {\n 0.01f, 0.45f, 0.67f\n }\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.queryGroups(\"{collection_name}\", {\n query: [0.01, 0.45, 0.67],\n group_by: \"document_id\",\n limit: 10,\n group_size: 5,\n});\n" - language: typescript + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.query_points_groups(\n collection_name=\"{collection_name}\",\n query=[0.01, 0.45, 0.67],\n group_by=\"document_id\",\n limit=10,\n group_size=5,\n)" + language: python - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query/groups' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"query\": [\n 0.324,\n 0.643,\n 0.423\n ],\n \"group_by\": \"document_id\",\n \"limit\": 1,\n \"group_size\": 5\n}'" language: curl @@ -922,18 +919,18 @@ paths: - code: "use qdrant_client::Qdrant;\nuse qdrant_client::qdrant::{Query, QueryPointGroupsBuilder};\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient.query_groups(\n QueryPointGroupsBuilder::new(\"{collection_name}\", \"document_id\")\n .query(Query::from(vec![0.01, 0.45, 0.67]))\n .limit(10u64)\n .group_size(5u64)\n).await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.query_points_groups(\n collection_name=\"{collection_name}\",\n query=[0.01, 0.45, 0.67],\n group_by=\"document_id\",\n limit=10,\n group_size=5,\n)" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.queryGroups(\"{collection_name}\", {\n query: [0.01, 0.45, 0.67],\n group_by: \"document_id\",\n limit: 10,\n group_size: 5,\n});\n" + language: typescript + - code-samples: + - code: "import java.util.List;\n\nimport static io.qdrant.client.QueryFactory.nearest;\n\nimport io.qdrant.client.grpc.Points.QueryPointGroups;\nimport io.qdrant.client.grpc.Points.QueryPoints;\n\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .queryGroupsAsync(\n QueryPointGroups.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setGroupBy(\"document_id\")\n .setGroupSize(5)\n .setLimit(10)\n .setQuery(nearest(List.of(0.01f, 0.45f, 0.67f)))\n .build())\n .get();\n" + language: java description: Universally query points and group results by a specified payload field. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries. summary: Query point groups tags: - Search /collections/{collection_name}/points/scroll: post: - x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\nimport static io.qdrant.client.WithPayloadSelectorFactory.enable;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Common.Filter;\nimport io.qdrant.client.grpc.Points.ScrollPoints;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .scrollAsync(\n ScrollPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"color\", \"red\")).build())\n .setLimit(1)\n .setWithPayload(enable(true))\n .build())\n .get();\n" - language: java + x-fern-examples: - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc scroll() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tlimit := uint32(1)\n\tresults, err := client.Scroll(context.Background(), &qdrant.ScrollPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t},\n\t\tLimit: &limit,\n\t\tWithPayload: qdrant.NewWithPayloadEnable(true),\n\t\tWithVectors: qdrant.NewWithVectorsEnable(false),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go @@ -941,8 +938,8 @@ paths: - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.ScrollAsync(\n collectionName: \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"),\n limit: 1,\n payloadSelector: true\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.scroll(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n limit: 1,\n with_payload: true,\n with_vector: false,\n});\n" - language: typescript + - code: "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: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/scroll' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"with_payload\": [\n \"city\",\n \"color\"\n ],\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n },\n \"limit\": 2,\n \"with_vector\": false\n}'" language: curl @@ -950,8 +947,11 @@ paths: - code: "use qdrant_client::qdrant::{Condition, Filter, ScrollPointsBuilder};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .scroll(\n ScrollPointsBuilder::new(\"{collection_name}\")\n .filter(Filter::must([Condition::matches(\n \"color\",\n \"red\".to_string(),\n )]))\n .limit(1)\n .with_payload(true)\n .with_vectors(false),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.scroll(\n collection_name=\"{collection_name}\",\n scroll_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n limit=1,\n with_payload=True,\n with_vectors=False,\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.scroll(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n limit: 1,\n with_payload: true,\n with_vector: false,\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\nimport static io.qdrant.client.WithPayloadSelectorFactory.enable;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Common.Filter;\nimport io.qdrant.client.grpc.Points.ScrollPoints;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .scrollAsync(\n ScrollPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"color\", \"red\")).build())\n .setLimit(1)\n .setWithPayload(enable(true))\n .build())\n .get();\n" + language: java description: 'Returns all points in a page-by-page manner. By default, all resulting points are sorted by {id}. @@ -967,9 +967,6 @@ paths: /collections/{collection_name}/points/search/matrix/offsets: post: x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\nimport io.qdrant.client.grpc.Common.Filter;\nimport io.qdrant.client.grpc.Points.SearchMatrixPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .searchMatrixOffsetsAsync(\n SearchMatrixPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setFilter(\n Filter.newBuilder()\n .addMust(matchKeyword(\"color\", \"red\"))\n .build()\n )\n .setSample(100)\n .setLimit(5)\n .build())\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc searchMatiOffsets() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsample := uint64(100)\n\tlimit := uint64(5)\n\tresults, err := client.SearchMatrixOffsets(context.Background(), &qdrant.SearchMatrixPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tSample: &sample,\n\t\tLimit: &limit,\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go @@ -977,14 +974,17 @@ paths: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchMatrixOffsetsAsync(\n \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"),\n sample: 100,\n limit: 5\n);" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.searchMatrixOffsets(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n sample: 100,\n limit: 5,\n});\n" - language: typescript + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.search_matrix_offsets(\n collection_name=\"{collection_name}\",\n sample=100,\n limit=5,\n query_filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"color\", match=models.MatchValue(value=\"red\")\n ),\n ]\n ),\n)" + language: python - code-samples: - code: "use qdrant_client::qdrant::{Condition, SearchMatrixPointsBuilder, Filter};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .search_matrix_offsets(\n SearchMatrixPointsBuilder::new(\"{collection_name}\")\n .filter(Filter::must(vec![Condition::matches(\n \"color\",\n \"red\".to_string(),\n )]))\n .sample(100)\n .limit(5),\n )\n .await?;" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.search_matrix_offsets(\n collection_name=\"{collection_name}\",\n sample=100,\n limit=5,\n query_filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"color\", match=models.MatchValue(value=\"red\")\n ),\n ]\n ),\n)" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.searchMatrixOffsets(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n sample: 100,\n limit: 5,\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\nimport io.qdrant.client.grpc.Common.Filter;\nimport io.qdrant.client.grpc.Points.SearchMatrixPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .searchMatrixOffsetsAsync(\n SearchMatrixPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setFilter(\n Filter.newBuilder()\n .addMust(matchKeyword(\"color\", \"red\"))\n .build()\n )\n .setSample(100)\n .setLimit(5)\n .build())\n .get();\n" + language: java description: Retrieves sparse matrix of pairwise distances between points sampled from the collection. Output is a form of row and column offsets and list of distances. summary: Distance matrix offsets tags: @@ -992,9 +992,6 @@ paths: /collections/{collection_name}/points/search/matrix/pairs: post: x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\nimport io.qdrant.client.grpc.Common.Filter;\nimport io.qdrant.client.grpc.Points.SearchMatrixPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .searchMatrixPairsAsync(\n SearchMatrixPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setFilter(\n Filter.newBuilder()\n .addMust(matchKeyword(\"color\", \"red\"))\n .build()\n )\n .setSample(100)\n .setLimit(5)\n .build())\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc searchMatixPairs() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsample := uint64(100)\n\tlimit := uint64(5)\n\tresults, err := client.SearchMatrixPairs(context.Background(), &qdrant.SearchMatrixPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tSample: &sample,\n\t\tLimit: &limit,\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go @@ -1002,14 +999,17 @@ paths: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchMatrixPairsAsync(\n \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"),\n sample: 100,\n limit: 5\n);" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.searchMatrixPairs(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n sample: 100,\n limit: 5,\n});" - language: typescript + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.search_matrix_pairs(\n collection_name=\"{collection_name}\",\n sample=100,\n limit=5,\n query_filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"color\", match=models.MatchValue(value=\"red\")\n ),\n ]\n ),\n)" + language: python - code-samples: - code: "use qdrant_client::qdrant::{Condition, SearchMatrixPointsBuilder, Filter};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .search_matrix_pairs(\n SearchMatrixPointsBuilder::new(\"{collection_name}\")\n .filter(Filter::must(vec![Condition::matches(\n \"color\",\n \"red\".to_string(),\n )]))\n .sample(100)\n .limit(5),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.search_matrix_pairs(\n collection_name=\"{collection_name}\",\n sample=100,\n limit=5,\n query_filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"color\", match=models.MatchValue(value=\"red\")\n ),\n ]\n ),\n)" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.searchMatrixPairs(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n sample: 100,\n limit: 5,\n});" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\nimport io.qdrant.client.grpc.Common.Filter;\nimport io.qdrant.client.grpc.Points.SearchMatrixPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .searchMatrixPairsAsync(\n SearchMatrixPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setFilter(\n Filter.newBuilder()\n .addMust(matchKeyword(\"color\", \"red\"))\n .build()\n )\n .setSample(100)\n .setLimit(5)\n .build())\n .get();\n" + language: java description: Retrieves sparse matrix of pairwise distances between points sampled from the collection. Output is a list of pairs of points and their distances. summary: Distance matrix pairs tags: @@ -1017,9 +1017,6 @@ paths: /collections/{collection_name}/points/vectors: put: x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .updateVectorsAsync(\n \"{collection_name}\",\n List.of(\n PointVectors.newBuilder()\n .setId(id(1))\n .setVectors(namedVectors(Map.of(\"image\", vector(List.of(0.1f, 0.2f, 0.3f, 0.4f)))))\n .build(),\n PointVectors.newBuilder()\n .setId(id(2))\n .setVectors(\n namedVectors(\n Map.of(\n \"text\", vector(List.of(0.9f, 0.8f, 0.7f, 0.6f, 0.5f, 0.4f, 0.3f, 0.2f)))))\n .build()))\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc updateVectors() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.UpdateVectors(context.Background(), &qdrant.UpdatePointVectors{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: []*qdrant.PointVectors{\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(1),\n\t\t\t\tVectors: qdrant.NewVectorsMap(map[string]*qdrant.Vector{\n\t\t\t\t\t\"image\": qdrant.NewVector(0.1, 0.2, 0.3, 0.4),\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(2),\n\t\t\t\tVectors: qdrant.NewVectorsMap(map[string]*qdrant.Vector{\n\t\t\t\t\t\"text\": qdrant.NewVector(0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2),\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go @@ -1027,8 +1024,8 @@ paths: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateVectorsAsync(\n collectionName: \"{collection_name}\",\n points: new List\n {\n new() { Id = 1, Vectors = (\"image\", new float[] { 0.1f, 0.2f, 0.3f, 0.4f }) },\n new()\n {\n Id = 2,\n Vectors = (\"text\", new float[] { 0.9f, 0.8f, 0.7f, 0.6f, 0.5f, 0.4f, 0.3f, 0.2f })\n }\n }\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.updateVectors(\"{collection_name}\", {\n points: [\n {\n id: 1,\n vector: {\n image: [0.1, 0.2, 0.3, 0.4],\n },\n },\n {\n id: 2,\n vector: {\n text: [0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n },\n ],\n});\n" - language: typescript + - code: "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: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points/vectors?wait=true' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"points\": [\n {\n \"id\": 1,\n \"vector\": [\n 0.0984,\n 0.1406,\n 0.8973\n ]\n },\n {\n \"id\": 2,\n \"vector\": {\n \"vector-name\": [\n 0.9,\n 0.8,\n 0.7,\n 0.6\n ]\n }\n }\n ]\n}'" language: curl @@ -1036,8 +1033,11 @@ paths: - code: "use qdrant_client::qdrant::{PointVectors, UpdatePointVectorsBuilder};\nuse qdrant_client::Qdrant;\nuse std::collections::HashMap;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .update_vectors(\n UpdatePointVectorsBuilder::new(\n \"{collection_name}\",\n vec![\n PointVectors {\n id: Some(1.into()),\n vectors: Some(\n HashMap::from([(\"image\".to_string(), vec![0.1, 0.2, 0.3, 0.4])])\n .into(),\n ),\n },\n PointVectors {\n id: Some(2.into()),\n vectors: Some(\n HashMap::from([(\n \"text\".to_string(),\n vec![0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n )])\n .into(),\n ),\n },\n ],\n )\n .wait(true),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.update_vectors(\n collection_name=\"{collection_name}\",\n points=[\n models.PointVectors(\n id=1,\n vector={\n \"image\": [0.1, 0.2, 0.3, 0.4],\n },\n ),\n models.PointVectors(\n id=2,\n vector={\n \"text\": [0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n ),\n ],\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.updateVectors(\"{collection_name}\", {\n points: [\n {\n id: 1,\n vector: {\n image: [0.1, 0.2, 0.3, 0.4],\n },\n },\n {\n id: 2,\n vector: {\n text: [0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n },\n ],\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .updateVectorsAsync(\n \"{collection_name}\",\n List.of(\n PointVectors.newBuilder()\n .setId(id(1))\n .setVectors(namedVectors(Map.of(\"image\", vector(List.of(0.1f, 0.2f, 0.3f, 0.4f)))))\n .build(),\n PointVectors.newBuilder()\n .setId(id(2))\n .setVectors(\n namedVectors(\n Map.of(\n \"text\", vector(List.of(0.9f, 0.8f, 0.7f, 0.6f, 0.5f, 0.4f, 0.3f, 0.2f)))))\n .build()))\n .get();\n" + language: java description: Updates specified vectors on points. All other unspecified vectors will stay intact. summary: Update vectors tags: @@ -1045,9 +1045,6 @@ paths: /collections/{collection_name}/points/vectors/delete: post: x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .deleteVectorsAsync(\n \"{collection_name}\", List.of(\"text\", \"image\"), List.of(id(0), id(3), id(10)))\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteVectors() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.DeleteVectors(context.Background(), &qdrant.DeletePointVectors{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(100)),\n\t\tVectors: &qdrant.VectorsSelector{\n\t\t\tNames: []string{\"text\", \"image\"},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go @@ -1063,8 +1060,8 @@ paths: ' language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.deleteVectors(\"{collection_name}\", {\n points: [0, 3, 10],\n vectors: [\"text\", \"image\"],\n});\n" - language: typescript + - code: "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: "# Delete vectors by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/vectors/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"points\": [\n 0,\n 3,\n 10\n ],\n \"vectors\": [\n \"text\",\n \"image\"\n ]\n}'\n\n# Delete vectors by filter\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/vectors/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n },\n \"vectors\": [\n \"text\",\n \"image\"\n ]\n}'" language: curl @@ -1072,8 +1069,11 @@ paths: - code: "use qdrant_client::qdrant::{DeletePointVectorsBuilder, PointsIdsList, VectorsSelector};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .delete_vectors(\n DeletePointVectorsBuilder::new(\"{collection_name}\")\n .points_selector(PointsIdsList {\n ids: vec![0.into(), 3.into(), 10.into()],\n })\n .vectors(VectorsSelector {\n names: vec![\"text\".into(), \"image\".into()],\n })\n .wait(true),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete_vectors(\n collection_name=\"{collection_name}\",\n points=[0, 3, 100],\n vectors=[\"text\", \"image\"],\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.deleteVectors(\"{collection_name}\", {\n points: [0, 3, 10],\n vectors: [\"text\", \"image\"],\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .deleteVectorsAsync(\n \"{collection_name}\", List.of(\"text\", \"image\"), List.of(id(0), id(3), id(10)))\n .get();\n" + language: java description: Deletes specified vectors from points. All other unspecified vectors will stay intact. summary: Delete vectors tags: @@ -1081,24 +1081,12 @@ paths: /collections/{collection_name}/shards: put: x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.CreateShardKey;\nimport io.qdrant.client.grpc.Collections.CreateShardKeyRequest;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createShardKeyAsync(CreateShardKeyRequest.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setRequest(CreateShardKey.newBuilder()\n .setShardKey(shardKey(\"{shard_key}\"))\n .build())\n .build()).get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc createShardKey() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.CreateShardKey(context.Background(), \"{collection_name}\", &qdrant.CreateShardKey{\n\t\tShardKey: qdrant.NewShardKey(\"{shard_key}\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.CreateShardKeyAsync(\n \"{collection_name}\",\n new CreateShardKey { ShardKey = new ShardKey { Keyword = \"{shard_key}\", } }\n);\n" language: csharp - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n});\n\nclient.createShardKey(\"{collection_name}\", {\n shard_key: \"{shard_key}\"\n});\n" - language: typescript - - code-samples: - - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/shards' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"shard_key\": \"{shard_key}\"\n}'" - language: curl - - code-samples: - - code: "use qdrant_client::qdrant::shard_key::Key;\nuse qdrant_client::qdrant::{CreateShardKeyBuilder, CreateShardKeyRequestBuilder};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .create_shard_key(\n CreateShardKeyRequestBuilder::new(\"{collection_name}\").request(\n CreateShardKeyBuilder::default()\n .shard_key(Key::Keyword(\"{shard_key}\".to_string())),\n ),\n )\n .await?;\n" - language: rust - code-samples: - code: 'from qdrant_client import QdrantClient @@ -1110,6 +1098,18 @@ paths: ' language: python + - code-samples: + - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/shards' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"shard_key\": \"{shard_key}\"\n}'" + language: curl + - code-samples: + - code: "use qdrant_client::qdrant::shard_key::Key;\nuse qdrant_client::qdrant::{CreateShardKeyBuilder, CreateShardKeyRequestBuilder};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .create_shard_key(\n CreateShardKeyRequestBuilder::new(\"{collection_name}\").request(\n CreateShardKeyBuilder::default()\n .shard_key(Key::Keyword(\"{shard_key}\".to_string())),\n ),\n )\n .await?;\n" + language: rust + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n});\n\nclient.createShardKey(\"{collection_name}\", {\n shard_key: \"{shard_key}\"\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.CreateShardKey;\nimport io.qdrant.client.grpc.Collections.CreateShardKeyRequest;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createShardKeyAsync(CreateShardKeyRequest.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setRequest(CreateShardKey.newBuilder()\n .setShardKey(shardKey(\"{shard_key}\"))\n .build())\n .build()).get();\n" + language: java description: Creates one or more shard keys for a specified collection. summary: Create a shard key tags: @@ -1117,24 +1117,12 @@ paths: /collections/{collection_name}/shards/delete: post: x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.DeleteShardKey;\nimport io.qdrant.client.grpc.Collections.DeleteShardKeyRequest;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteShardKeyAsync(DeleteShardKeyRequest.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setRequest(DeleteShardKey.newBuilder()\n .setShardKey(shardKey(\"{shard_key}\"))\n .build())\n .build()).get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteShardKey() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteShardKey(context.Background(), \"{collection_name}\", &qdrant.DeleteShardKey{\n\t\tShardKey: qdrant.NewShardKey(\"{shard_key}\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.DeleteShardKeyAsync(\n \"{collection_name}\",\n new DeleteShardKey { ShardKey = new ShardKey { Keyword = \"shard_key\", } }\n);\n" language: csharp - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n});\n\nclient.deleteShardKey(\"{collection_name}\", {\n shard_key: \"{shard_key}\"\n});\n" - language: typescript - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/shards/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"shard_key\": \"{shard_key}\"\n}'" - language: curl - - code-samples: - - code: "use qdrant_client::qdrant::shard_key::Key;\nuse qdrant_client::qdrant::DeleteShardKeyRequestBuilder;\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .delete_shard_key(\n DeleteShardKeyRequestBuilder::new(\"{collection_name}\")\n .key(Key::Keyword(\"{shard_key}\".to_string())),\n )\n .await?;\n" - language: rust - code-samples: - code: 'from qdrant_client import QdrantClient @@ -1146,6 +1134,18 @@ paths: ' language: python + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/shards/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"shard_key\": \"{shard_key}\"\n}'" + language: curl + - code-samples: + - code: "use qdrant_client::qdrant::shard_key::Key;\nuse qdrant_client::qdrant::DeleteShardKeyRequestBuilder;\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .delete_shard_key(\n DeleteShardKeyRequestBuilder::new(\"{collection_name}\")\n .key(Key::Keyword(\"{shard_key}\".to_string())),\n )\n .await?;\n" + language: rust + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n});\n\nclient.deleteShardKey(\"{collection_name}\", {\n shard_key: \"{shard_key}\"\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.DeleteShardKey;\nimport io.qdrant.client.grpc.Collections.DeleteShardKeyRequest;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteShardKeyAsync(DeleteShardKeyRequest.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setRequest(DeleteShardKey.newBuilder()\n .setShardKey(shardKey(\"{shard_key}\"))\n .build())\n .build()).get();\n" + language: java description: Deletes one or more shard keys for a specified collection. summary: Delete a shard key tags: @@ -1153,9 +1153,6 @@ paths: /collections/{collection_name}/snapshots: get: x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listSnapshotAsync(\"{collection_name}\").get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc listSnapshots() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsnapshots, err := client.ListSnapshots(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Snapshots: \", snapshots)\n}\n" language: go @@ -1171,16 +1168,16 @@ paths: ' language: csharp - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'from qdrant_client import QdrantClient - const client = new QdrantClient({ host: "localhost", port: 6333 }); + client = QdrantClient(url="http://localhost:6333") - client.listSnapshots("{collection_name}"); + client.list_snapshots(collection_name="{collection_name}") ' - language: typescript + language: python - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/snapshots' \\\n --header 'api-key: '" language: curl @@ -1196,25 +1193,25 @@ paths: ' language: rust - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.list_snapshots(collection_name="{collection_name}") + client.listSnapshots("{collection_name}"); ' - language: python + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listSnapshotAsync(\"{collection_name}\").get();\n" + language: java description: Retrieves a list of all snapshots for a specified collection. summary: List all snapshots (collection) tags: - Snapshots post: x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createSnapshotAsync(\"{collection_name}\").get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc createSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsnapshot, err := client.CreateSnapshot(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Snapshot created: \", snapshot.Name)\n}\n" language: go @@ -1230,16 +1227,16 @@ paths: ' language: csharp - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'from qdrant_client import QdrantClient - const client = new QdrantClient({ host: "localhost", port: 6333 }); + client = QdrantClient(url="http://localhost:6333") - client.createSnapshot("{collection_name}"); + client.create_snapshot(collection_name="{collection_name}") ' - language: typescript + language: python - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/snapshots' \\\n --header 'api-key: '" language: curl @@ -1255,16 +1252,19 @@ paths: ' language: rust - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.create_snapshot(collection_name="{collection_name}") + client.createSnapshot("{collection_name}"); ' - language: python + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createSnapshotAsync(\"{collection_name}\").get();\n" + language: java description: Creates a new snapshot for a specified collection. summary: Create a snapshot (collection) tags: @@ -1273,14 +1273,14 @@ paths: put: x-fern-examples: - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.recoverSnapshot(\"{collection_name}\", {\n location: \"http://example.com/path/to/snapshot.shapshot\",\n});\n" - language: typescript + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.recover_snapshot(\n \"{collection_name}\",\n \"http://example.com/path/to/snapshot.shapshot\",\n)\n" + language: python - code-samples: - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/snapshots/recover' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"location\": \"http://example.com/path/to/snapshot.shapshot\"\n}'" language: curl - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.recover_snapshot(\n \"{collection_name}\",\n \"http://example.com/path/to/snapshot.shapshot\",\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.recoverSnapshot(\"{collection_name}\", {\n location: \"http://example.com/path/to/snapshot.shapshot\",\n});\n" + language: typescript description: Recovers local collection data from a snapshot. This will overwrite any collection data stored on the node. If the collection does not exist, it will be created. summary: Recover from a snapshot (collection) tags: @@ -1298,9 +1298,6 @@ paths: /collections/{collection_name}/snapshots/{snapshot_name}: delete: x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteSnapshotAsync(\"{collection_name}\", \"{snapshot_name}\").get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteSnapshot(context.Background(), \"{collection_name}\", \"{snapshot_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go @@ -1315,6 +1312,15 @@ paths: ' language: csharp + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete_snapshot(\n collection_name=\"{collection_name}\", snapshot_name=\"{snapshot_name}\"\n)\n" + language: python + - code-samples: + - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/snapshots/snapshot_name' \\\n --header 'api-key: '" + language: curl + - code-samples: + - code: "use qdrant_client::qdrant::DeleteSnapshotRequestBuilder;\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .delete_snapshot(DeleteSnapshotRequestBuilder::new(\n \"{collection_name}\",\n \"{snapshot_name}\",\n ))\n .await?;\n" + language: rust - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -1327,14 +1333,8 @@ paths: ' language: typescript - code-samples: - - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/snapshots/snapshot_name' \\\n --header 'api-key: '" - language: curl - - code-samples: - - code: "use qdrant_client::qdrant::DeleteSnapshotRequestBuilder;\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .delete_snapshot(DeleteSnapshotRequestBuilder::new(\n \"{collection_name}\",\n \"{snapshot_name}\",\n ))\n .await?;\n" - language: rust - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete_snapshot(\n collection_name=\"{collection_name}\", snapshot_name=\"{snapshot_name}\"\n)\n" - language: python + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteSnapshotAsync(\"{collection_name}\", \"{snapshot_name}\").get();\n" + language: java description: Deletes the specified snapshot for a collection. summary: Delete a snapshot (collection) tags: @@ -1347,9 +1347,6 @@ paths: /snapshots: get: x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listFullSnapshotAsync().get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc listFullSnapshots() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsnapshots, err := client.ListFullSnapshots(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Full snapshots: \", snapshots)\n}\n" language: go @@ -1365,16 +1362,16 @@ paths: ' language: csharp - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'from qdrant_client import QdrantClient - const client = new QdrantClient({ host: "localhost", port: 6333 }); + client = QdrantClient(url="http://localhost:6333") - client.listFullSnapshots(); + client.list_full_snapshots() ' - language: typescript + language: python - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/snapshots' \\\n --header 'api-key: '" language: curl @@ -1390,25 +1387,25 @@ paths: ' language: rust - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.list_full_snapshots() + client.listFullSnapshots(); ' - language: python + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listFullSnapshotAsync().get();\n" + language: java description: Returns a list of all snapshots for the entire storage. summary: List all snapshots (storage) tags: - Snapshots post: x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createFullSnapshotAsync().get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc createFullSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsnapshot, err := client.CreateFullSnapshot(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Snapshot created: \", snapshot.Name)\n}\n" language: go @@ -1424,16 +1421,16 @@ paths: ' language: csharp - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'from qdrant_client import QdrantClient - const client = new QdrantClient({ host: "localhost", port: 6333 }); + client = QdrantClient(url="http://localhost:6333") - client.createFullSnapshot(); + client.create_full_snapshot() ' - language: typescript + language: python - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/snapshots' \\\n --header 'api-key: '" language: curl @@ -1449,16 +1446,19 @@ paths: ' language: rust - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.create_full_snapshot() + client.createFullSnapshot(); ' - language: python + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createFullSnapshotAsync().get();\n" + language: java description: Creates a new snapshot of the entire storage. summary: Create a snapshot (storage) tags: @@ -1466,9 +1466,6 @@ paths: /snapshots/{snapshot_name}: delete: x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteFullSnapshotAsync(\"{snapshot_name}\").get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteFullSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteFullSnapshot(context.Background(), \"{snapshot_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go @@ -1484,16 +1481,16 @@ paths: ' language: csharp - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'from qdrant_client import QdrantClient - const client = new QdrantClient({ host: "localhost", port: 6333 }); + client = QdrantClient(url="http://localhost:6333") - client.deleteFullSnapshot("{snapshot_name}"); + client.delete_full_snapshot(snapshot_name="{snapshot_name}") ' - language: typescript + language: python - code-samples: - code: "curl -X DELETE \\\n 'http://localhost:6333/snapshots/snapshot_name' \\\n --header 'api-key: '" language: curl @@ -1509,16 +1506,19 @@ paths: ' language: rust - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.delete_full_snapshot(snapshot_name="{snapshot_name}") + client.deleteFullSnapshot("{snapshot_name}"); ' - language: python + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteFullSnapshotAsync(\"{snapshot_name}\").get();\n" + language: java description: Deletes the specified snapshot of the entire storage. summary: Delete a snapshot (storage) tags: diff --git a/fern/apis/master/openapi.json b/fern/apis/master/openapi.json index 05e3775..3d7c5db 100644 --- a/fern/apis/master/openapi.json +++ b/fern/apis/master/openapi.json @@ -6558,6 +6558,12 @@ "nullable": true } ] + }, + "created_at": { + "description": "Time of the collection creation. Absent for collections created before Qdrant started recording it.", + "type": "string", + "format": "date-time", + "nullable": true } } }, @@ -6740,6 +6746,17 @@ } ] }, + "id_tracker": { + "description": "Configuration of the point id tracker", + "anyOf": [ + { + "$ref": "#/components/schemas/IdTrackerParams" + }, + { + "nullable": true + } + ] + }, "sparse_vectors": { "description": "Configuration of the sparse vector storage", "type": "object", @@ -6822,7 +6839,7 @@ ] }, "datatype": { - "description": "Defines which datatype should be used to represent vectors in the storage. Choosing different datatypes allows to optimize memory usage and performance vs accuracy.\n\n- For `float32` datatype - vectors are stored as single-precision floating point numbers, 4 bytes. - For `float16` datatype - vectors are stored as half-precision floating point numbers, 2 bytes. - For `uint8` datatype - vectors are stored as unsigned 8-bit integers, 1 byte. It expects vector elements to be in range `[0, 255]`. - For `turbo4` datatype - vectors are quantized to 4 bits per element using the TurboQuant algorithm.", + "description": "Defines which datatype should be used to represent vectors in the storage. Choosing different datatypes allows to optimize memory usage and performance vs accuracy.\n\n- For `float32` datatype - vectors are stored as single-precision floating point numbers, 4 bytes. - For `float16` datatype - vectors are stored as half-precision floating point numbers, 2 bytes. - For `uint8` datatype - vectors are stored as unsigned 8-bit integers, 1 byte. It expects vector elements to be in range `[0, 255]`. - For `turbo4` datatype - vectors are quantized to 4 bits per element using the TurboQuant algorithm. - For `turbo8` datatype - vectors are quantized to 8 bits per element using the TurboQuant algorithm. - For `turbo16` datatype - vectors are quantized to 16 bits per element using the TurboQuant algorithm.", "anyOf": [ { "$ref": "#/components/schemas/Datatype" @@ -6858,7 +6875,7 @@ "type": "object", "properties": { "m": { - "description": "Number of edges per node in the index graph. Larger the value - more accurate the search, more space required.", + "description": "Number of edges per node in the index graph. Larger the value - more accurate the search, more space required. Set to 0 to disable the main HNSW graph. Additional payload-aware links may still be built when the effective payload M is positive (see payload_m). This setting alone does not guarantee exact search.", "type": "integer", "format": "uint", "minimum": 0, @@ -6903,7 +6920,7 @@ ] }, "payload_m": { - "description": "Custom M param for additional payload-aware HNSW links. If not set, default M will be used.", + "description": "Number of additional payload-aware links per node. If unset, the value of m is used. An effective value of 0 disables these additional links. A positive value allows them for indexed payload fields with HNSW enabled, even when m is 0.", "type": "integer", "format": "uint", "minimum": 0, @@ -7163,7 +7180,8 @@ "bits1", "bits1_5", "bits2", - "bits4" + "bits4", + "bits8" ] }, "Datatype": { @@ -7172,7 +7190,9 @@ "float32", "uint8", "float16", - "turbo4" + "turbo4", + "turbo8", + "turbo16" ] }, "MultiVectorConfig": { @@ -7216,6 +7236,23 @@ } } }, + "IdTrackerParams": { + "description": "Params of the point id tracker", + "type": "object", + "properties": { + "memory": { + "description": "Memory placement of the point id mapping in indexed segments: `cold` keeps it on disk and reads it on demand, `cached` keeps it on disk but primes the page cache with it on load, `pinned` keeps it in RAM. Default: `pinned`.", + "anyOf": [ + { + "$ref": "#/components/schemas/Memory" + }, + { + "nullable": true + } + ] + } + } + }, "SparseVectorParams": { "description": "Params of single sparse vector data storage", "type": "object", @@ -7303,7 +7340,7 @@ ], "properties": { "m": { - "description": "Number of edges per node in the index graph. Larger the value - more accurate the search, more space required.", + "description": "Number of edges per node in the index graph. Larger the value - more accurate the search, more space required. Set to 0 to disable the main HNSW graph. Additional payload-aware links may still be built when the effective payload M is positive (see payload_m). This setting alone does not guarantee exact search.", "type": "integer", "format": "uint", "minimum": 0 @@ -7345,7 +7382,7 @@ ] }, "payload_m": { - "description": "Custom M param for hnsw graph built for payload index. If not set, default M will be used.", + "description": "Number of additional payload-aware links per node. If unset, the value of m is used. An effective value of 0 disables these additional links. A positive value allows them for indexed payload fields with HNSW enabled, even when m is 0.", "type": "integer", "format": "uint", "minimum": 0, @@ -7387,7 +7424,7 @@ "minimum": 0 }, "max_segment_size": { - "description": "Do not create segments larger this size (in kilobytes). Large segments might require disproportionately long indexation times, therefore it makes sense to limit the size of segments.\n\nIf indexing speed is more important - make this parameter lower. If search speed is more important - make this parameter higher. Note: 1Kb = 1 vector of size 256 If not set, will be automatically selected considering the number of available CPUs.", + "description": "Do not create segments larger than this size (in kilobytes). Large segments might require disproportionately long indexation times, therefore it makes sense to limit the size of segments.\n\nIf indexing speed is more important - make this parameter lower. If search speed is more important - make this parameter higher. Note: 1Kb = 1 vector of size 256 If not set, will be automatically selected considering the number of available CPUs.", "default": null, "type": "integer", "format": "uint", @@ -7769,6 +7806,11 @@ "description": "If true, enable prefix matching (`match: { \"prefix\": ... }`) on this field. Default: false.", "type": "boolean", "nullable": true + }, + "nested": { + "description": "Index every object of this array as a separate entry, e.g. `offers` for the field `offers[].price`. The field must be inside the array's elements. `is_empty` on the field matches a point when one of its elements lacks the field, and never a point without elements. Default: disabled.", + "type": "string", + "nullable": true } } }, @@ -7823,6 +7865,11 @@ "description": "Enable HNSW graph building for this payload field. If true, builds additional HNSW links (Need payload_m > 0). Default: true.", "type": "boolean", "nullable": true + }, + "nested": { + "description": "Index every object of this array as a separate entry, e.g. `offers` for the field `offers[].price`. The field must be inside the array's elements. `is_empty` on the field matches a point when one of its elements lacks the field, and never a point without elements. Default: disabled.", + "type": "string", + "nullable": true } } }, @@ -7867,6 +7914,11 @@ "description": "Enable HNSW graph building for this payload field. If true, builds additional HNSW links (Need payload_m > 0). Default: true.", "type": "boolean", "nullable": true + }, + "nested": { + "description": "Index every object of this array as a separate entry, e.g. `offers` for the field `offers[].price`. The field must be inside the array's elements. `is_empty` on the field matches a point when one of its elements lacks the field, and never a point without elements. Default: disabled.", + "type": "string", + "nullable": true } } }, @@ -7906,6 +7958,11 @@ "description": "Enable HNSW graph building for this payload field. If true, builds additional HNSW links (Need payload_m > 0). Default: true.", "type": "boolean", "nullable": true + }, + "nested": { + "description": "Index every object of this array as a separate entry, e.g. `offers` for the field `offers[].price`. The field must be inside the array's elements. `is_empty` on the field matches a point when one of its elements lacks the field, and never a point without elements. Default: disabled.", + "type": "string", + "nullable": true } } }, @@ -7999,6 +8056,22 @@ "description": "Enable HNSW graph building for this payload field. If true, builds additional HNSW links (Need payload_m > 0). Default: true.", "type": "boolean", "nullable": true + }, + "scoring": { + "description": "Enable ranking points by BM25 over this field; `true` for the defaults. Changing it rebuilds the index. Default: disabled.", + "anyOf": [ + { + "$ref": "#/components/schemas/TextScoringInterface" + }, + { + "nullable": true + } + ] + }, + "nested": { + "description": "Index every object of this array as a separate entry, e.g. `offers` for the field `offers[].title`. The field must be inside the array's elements. Every query on the field, not only nested filters, treats each element as its own document: a condition matches a point when a single element matches it, and BM25 scores elements separately. `is_empty` on the field matches a point when one of its elements lacks the field, and never a point without elements. Default: disabled.", + "type": "string", + "nullable": true } } }, @@ -8014,7 +8087,8 @@ "prefix", "whitespace", "word", - "multilingual" + "multilingual", + "code" ] }, "StopwordsInterface": { @@ -8160,6 +8234,36 @@ "none" ] }, + "TextScoringInterface": { + "description": "BM25 scoring for a text index: `true` for the default parameters, `false` to disable it, or the parameters themselves.", + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/components/schemas/TextScoringParams" + } + ] + }, + "TextScoringParams": { + "description": "Parameters of ranking over a text index. The index records the length of each document, which BM25 normalizes by. `k1` and `b` are set per query.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/TextScoringType" + } + } + }, + "TextScoringType": { + "description": "How a text index ranks documents.", + "type": "string", + "enum": [ + "bm25" + ] + }, "BoolIndexParams": { "type": "object", "required": [ @@ -8190,6 +8294,11 @@ "description": "Enable HNSW graph building for this payload field. If true, builds additional HNSW links (Need payload_m > 0). Default: true.", "type": "boolean", "nullable": true + }, + "nested": { + "description": "Index every object of this array as a separate entry, e.g. `offers` for the field `offers[].price`. The field must be inside the array's elements. `is_empty` on the field matches a point when one of its elements lacks the field, and never a point without elements. Default: disabled.", + "type": "string", + "nullable": true } } }, @@ -8234,6 +8343,11 @@ "description": "Enable HNSW graph building for this payload field. If true, builds additional HNSW links (Need payload_m > 0). Default: true.", "type": "boolean", "nullable": true + }, + "nested": { + "description": "Index every object of this array as a separate entry, e.g. `offers` for the field `offers[].price`. The field must be inside the array's elements. `is_empty` on the field matches a point when one of its elements lacks the field, and never a point without elements. Default: disabled.", + "type": "string", + "nullable": true } } }, @@ -8278,6 +8392,11 @@ "description": "Enable HNSW graph building for this payload field. If true, builds additional HNSW links (Need payload_m > 0). Default: true.", "type": "boolean", "nullable": true + }, + "nested": { + "description": "Index every object of this array as a separate entry, e.g. `offers` for the field `offers[].price`. The field must be inside the array's elements. `is_empty` on the field matches a point when one of its elements lacks the field, and never a point without elements. Default: disabled.", + "type": "string", + "nullable": true } } }, @@ -9037,6 +9156,9 @@ { "$ref": "#/components/schemas/MatchPrefix" }, + { + "$ref": "#/components/schemas/MatchSubstring" + }, { "$ref": "#/components/schemas/MatchAny" }, @@ -9119,6 +9241,18 @@ } } }, + "MatchSubstring": { + "description": "Match keyword values that contain the given string.\n\nByte-wise (hence, for valid UTF-8, character-wise) and case-sensitive, consistent with exact keyword and prefix matching. Served by a keyword index with the `prefix` option, through a scan of its key dictionary; without one, falls back to reading the payload.", + "type": "object", + "required": [ + "substring" + ], + "properties": { + "substring": { + "type": "string" + } + } + }, "MatchAny": { "description": "Exact match on any of the given values", "type": "object", @@ -9629,7 +9763,7 @@ "$ref": "#/components/schemas/VectorsConfig" }, "shard_number": { - "description": "For auto sharding: Number of shards in collection. - Default is 1 for standalone, otherwise equal to the number of nodes - Minimum is 1\n\nFor custom sharding: Number of shards in collection per shard group. - Default is 1, meaning that each shard key will be mapped to a single shard - Minimum is 1", + "description": "For auto sharding: Number of shards in collection. - If not specified, selected automatically - Minimum is 1\n\nFor custom sharding: Number of shards in collection per shard group. - Default is 1, meaning that each shard key will be mapped to a single shard - Minimum is 1", "default": null, "type": "integer", "format": "uint32", @@ -9683,6 +9817,18 @@ } ] }, + "id_tracker": { + "description": "Configuration of the point id tracker", + "default": null, + "anyOf": [ + { + "$ref": "#/components/schemas/IdTrackerParams" + }, + { + "nullable": true + } + ] + }, "hnsw_config": { "description": "Custom params for HNSW index. If none - values from service configuration file are used.", "anyOf": [ @@ -9812,7 +9958,7 @@ "nullable": true }, "max_segment_size": { - "description": "Do not create segments larger this size (in kilobytes). Large segments might require disproportionately long indexation times, therefore it makes sense to limit the size of segments.\n\nIf indexation speed have more priority for your - make this parameter lower. If search speed is more important - make this parameter higher. Note: 1Kb = 1 vector of size 256", + "description": "Do not create segments larger than this size (in kilobytes). Large segments might require disproportionately long indexation times, therefore it makes sense to limit the size of segments.\n\nIf indexation speed have more priority for your - make this parameter lower. If search speed is more important - make this parameter higher. Note: 1Kb = 1 vector of size 256", "type": "integer", "format": "uint", "minimum": 1, @@ -10284,6 +10430,17 @@ "nullable": true } ] + }, + "id_tracker": { + "description": "Update params of the point id tracker. If none - it is left unchanged.", + "anyOf": [ + { + "$ref": "#/components/schemas/IdTrackerParams" + }, + { + "nullable": true + } + ] } } }, @@ -11560,7 +11717,7 @@ ] }, "comment": { - "description": "A human-readable report of the transfer progress. Available only on the source peer.", + "description": "A human-readable report of the transfer progress. Available only on the source peer, and on the target peer during snapshot recovery.", "type": "string", "nullable": true } @@ -11875,18 +12032,33 @@ "default": false, "type": "boolean" }, + "compact_logstore_tracker": { + "description": "In non-appendable segments built by the optimizer, store the tracker of an append-only payload storage in the compacted format: read into RAM whole on open instead of one lookup per value. Only has an effect together with [`Self::append_only_storages`]. Gates creation only: both formats are always readable.", + "default": false, + "type": "boolean" + }, "transfer_raw_points": { "description": "Transfer points as storage-native bytes (raw points), for every collection rather than only those whose vector storage would lose precision in a decode-encode round-trip (TurboQuant).\n\nRead on the sending side only, where the transfer batch is prepared: nodes accept raw points regardless.", - "default": false, + "default": true, "type": "boolean" }, "transfer_raw_payloads": { "description": "Send the payload of a raw point as the byte blob it is stored as, so the sending node does not parse it and neither node builds a protobuf value tree for it. The receiving node still parses the blob, once, when the operation is applied. Only has an effect on points transferred raw, see [`Self::transfer_raw_points`].\n\nRead on the sending side only: nodes accept raw payloads regardless.", + "default": true, + "type": "boolean" + }, + "persist_proxy_segments": { + "description": "Persist proxy segment changes on disk. Prevents pinning the WAL while proxy segments are open. Replays the persisted changes on startup to guarantee data consistency. Required for serverless deployments where storage and compute is separated.", "default": false, "type": "boolean" }, + "combined_vector_storage": { + "description": "When `hnsw_config.inline_storage` enabled, use the `GraphInline` vector storage (aka inline-storage without standalone vector storage) for new segments.\n\nExisting `GraphInline` segments are always readable, regardless of this flag.", + "default": true, + "type": "boolean" + }, "serverless_compatible": { - "description": "Serverless-compatible deployment mode. Automatically enables [`Self::write_segment_manifest`], [`Self::append_only_mutations`], [`Self::compact_bitmask`] and [`Self::append_only_storages`].\n\nNote that this will only be applied when passed into [`init_feature_flags`].", + "description": "Serverless-compatible deployment mode. Implies [`Self::write_segment_manifest`], [`Self::append_only_mutations`], [`Self::compact_bitmask`], [`Self::append_only_storages`], [`Self::compact_logstore_tracker`] and [`Self::persist_proxy_segments`].\n\nNote that this will only be applied when passed into [`init_feature_flags`].", "default": false, "type": "boolean" } @@ -12036,6 +12208,7 @@ "dir", "log_api", "max_log_files", + "output", "rotation", "trust_forwarded_headers" ], @@ -12057,6 +12230,9 @@ "log_api": { "type": "boolean" }, + "output": { + "type": "string" + }, "dir_size_bytes": { "type": "integer", "format": "uint", @@ -12150,7 +12326,7 @@ "resharding": { "type": "array", "items": { - "$ref": "#/components/schemas/ReshardingInfo" + "$ref": "#/components/schemas/ReshardingTelemetry" }, "nullable": true }, @@ -12616,6 +12792,17 @@ }, "payload_storage_type": { "$ref": "#/components/schemas/PayloadStorageType" + }, + "id_tracker_memory": { + "description": "Memory placement of the id tracker in non-appendable segments. Unset means the deployment default: `cold` in serverless-compatible mode, `pinned` otherwise.", + "anyOf": [ + { + "$ref": "#/components/schemas/Memory" + }, + { + "nullable": true + } + ] } } }, @@ -12704,7 +12891,7 @@ ] }, { - "description": "Same as `ChunkedMmap`, but vectors are forced to be locked in RAM In this way we avoid cold requests to disk, but risk to run out of memory\n\nDesigned as a replacement for `Memory`, which doesn't depend on RocksDB", + "description": "Same as `ChunkedMmap`, but vectors are forced to be locked in RAM In this way we avoid cold requests to disk, but risk to run out of memory", "type": "string", "enum": [ "InRamChunkedMmap" @@ -12718,10 +12905,10 @@ ] }, { - "description": "Placeholder storage: contains no data, all vectors reported as deleted. Used for newly created named vectors on immutable segments. No files on disk, reconstructed from config on load.", + "description": "Vectors are inlined in the HNSW links file, not in a dedicated storage. Not appendable.", "type": "string", "enum": [ - "Empty" + "GraphInline" ] } ] @@ -12776,7 +12963,9 @@ "float32", "float16", "uint8", - "turbo4" + "turbo4", + "turbo8", + "turbo16" ] }, "SparseVectorDataConfig": { @@ -12880,13 +13069,6 @@ "enum": [ "mmap" ] - }, - { - "description": "Placeholder storage: contains no data, all vectors reported as deleted. Used for newly created sparse named vectors on immutable segments.", - "type": "string", - "enum": [ - "empty" - ] } ] }, @@ -12959,6 +13141,9 @@ "filtered_large_cardinality": { "$ref": "#/components/schemas/OperationDurationStatistics" }, + "filtered_acorn": { + "$ref": "#/components/schemas/OperationDurationStatistics" + }, "filtered_exact": { "$ref": "#/components/schemas/OperationDurationStatistics" }, @@ -13256,6 +13441,57 @@ } } }, + "ReshardingTelemetry": { + "type": "object", + "required": [ + "direction", + "peer_id", + "shard_id", + "stage", + "uuid" + ], + "properties": { + "stage": { + "$ref": "#/components/schemas/ReshardingStage" + }, + "direction": { + "$ref": "#/components/schemas/ReshardingDirection" + }, + "shard_id": { + "type": "integer", + "format": "uint32", + "minimum": 0 + }, + "peer_id": { + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "shard_key": { + "anyOf": [ + { + "$ref": "#/components/schemas/ShardKey" + }, + { + "nullable": true + } + ] + }, + "uuid": { + "type": "string", + "format": "uuid" + } + } + }, + "ReshardingStage": { + "description": "Resharding stages", + "type": "string", + "enum": [ + "migrating_points", + "read_hash_ring_committed", + "write_hash_ring_committed" + ] + }, "ShardCleanStatusTelemetry": { "oneOf": [ { @@ -14738,7 +14974,7 @@ ] }, "using": { - "description": "Define which vector name to use for querying. If missing, the default vector is used.", + "description": "Define which vector name to use for querying. If missing, the default vector is used. For a `text` query, the payload field whose text index to search.", "type": "string", "nullable": true }, @@ -14853,7 +15089,7 @@ ] }, "using": { - "description": "Define which vector name to use for querying. If missing, the default vector is used.", + "description": "Define which vector name to use for querying. If missing, the default vector is used. For a `text` query, the payload field whose text index to search.", "type": "string", "nullable": true }, @@ -14983,6 +15219,9 @@ }, { "$ref": "#/components/schemas/RelevanceFeedbackQuery" + }, + { + "$ref": "#/components/schemas/TextQuery" } ] }, @@ -15730,6 +15969,91 @@ } } }, + "TextQuery": { + "description": "Rank by BM25 over the text index of the payload field named by `using`, which must have `scoring` set. A point scores when it holds any of the query's terms: required or excluded terms belong in the request's `filter`.", + "type": "object", + "required": [ + "text" + ], + "properties": { + "text": { + "$ref": "#/components/schemas/TextInterface" + } + } + }, + "TextInterface": { + "description": "The text to search for, or the text with scorer parameters.", + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/TextQueryInput" + } + ] + }, + "TextQueryInput": { + "type": "object", + "required": [ + "query" + ], + "properties": { + "query": { + "description": "Text to search for, tokenized by the field's text index.", + "type": "string" + }, + "scoring": { + "description": "Parameters of the scorer, keyed by its name. They must match the `scoring` type of the field's text index. If absent, the scorer runs with its defaults.", + "anyOf": [ + { + "$ref": "#/components/schemas/TextQueryScoring" + }, + { + "nullable": true + } + ] + } + } + }, + "TextQueryScoring": { + "description": "Parameters of one scorer, keyed by its name.", + "anyOf": [ + { + "$ref": "#/components/schemas/Bm25Scoring" + } + ] + }, + "Bm25Scoring": { + "type": "object", + "required": [ + "bm25" + ], + "properties": { + "bm25": { + "$ref": "#/components/schemas/Bm25Params" + } + } + }, + "Bm25Params": { + "type": "object", + "properties": { + "k": { + "description": "Term frequency saturation. Default is 1.2.", + "type": "number", + "format": "float", + "minimum": 0, + "nullable": true + }, + "b": { + "description": "Document length normalization, from 0 (none) to 1 (full). Default is 0.75.", + "type": "number", + "format": "float", + "maximum": 1, + "minimum": 0, + "nullable": true + } + } + }, "SearchParams": { "description": "Additional parameters of the search", "type": "object", @@ -15774,7 +16098,7 @@ ] }, "idf": { - "description": "Which population sparse vector IDF statistics are computed over. By default (or with explicit `\"global\"`) statistics are collection-wide. Only applicable to sparse vectors with the IDF modifier enabled.", + "description": "Which population IDF statistics are computed over. By default (or with explicit `\"global\"`) statistics are collection-wide. Only applicable to sparse vectors with the IDF modifier enabled, and to BM25 over a text index.", "anyOf": [ { "$ref": "#/components/schemas/IdfParams" @@ -15829,7 +16153,7 @@ } }, "IdfParams": { - "description": "Population over which sparse vector IDF statistics are computed for scoring \u2014 the *IDF corpus*.\n\n- `\"global\"` \u2014 collection-wide statistics, same as omitting the parameter. - `{ \"corpus\": }` \u2014 document count and per-term document frequencies are computed over the points matching the corpus filter only. The corpus is independent of the retrieval filter and is usually broader than it.", + "description": "Population over which IDF statistics are computed for scoring \u2014 the *IDF corpus*.\n\n- `\"global\"` \u2014 collection-wide statistics, same as omitting the parameter. - `{ \"corpus\": }` \u2014 document count and per-term document frequencies (and, for BM25 over a text index, the average document length) are computed over the points matching the corpus filter only. The corpus is independent of the retrieval filter and is usually broader than it.", "anyOf": [ { "$ref": "#/components/schemas/IdfScope" @@ -15962,7 +16286,7 @@ ] }, "using": { - "description": "Define which vector name to use for querying. If missing, the default vector is used.", + "description": "Define which vector name to use for querying. If missing, the default vector is used. For a `text` query, the payload field whose text index to search.", "type": "string", "nullable": true }, @@ -16950,7 +17274,7 @@ ] }, "datatype": { - "description": "Element storage type (Float32, Float16, Uint8, Turbo4)", + "description": "Element storage type (Float32, Float16, Uint8, Turbo4, Turbo8, Turbo16)", "anyOf": [ { "$ref": "#/components/schemas/VectorStorageDatatype" diff --git a/fern/apis/v1.19.x/openapi-overrides.yml b/fern/apis/v1.19.x/openapi-overrides.yml index f635c3f..19e81bb 100644 --- a/fern/apis/v1.19.x/openapi-overrides.yml +++ b/fern/apis/v1.19.x/openapi-overrides.yml @@ -17,11 +17,6 @@ paths: tags: - Aliases x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.listAliasesAsync().get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc listAliases() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -42,16 +37,16 @@ paths: ' language: csharp - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'from qdrant_client import QdrantClient - const client = new QdrantClient({ host: "localhost", port: 6333 }); + client = QdrantClient(url="http://localhost:6333") - client.getAliases(); + client.get_aliases() ' - language: typescript + language: python - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/aliases' \\\n --header\ \ 'api-key: '" @@ -68,16 +63,21 @@ paths: ' language: rust - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.get_aliases() + client.getAliases(); ' - language: python + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.listAliasesAsync().get();\n" + language: java /cluster: get: description: Returns information about the cluster's current state and composition. @@ -105,11 +105,6 @@ paths: tags: - Collections x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.listCollectionsAsync().get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc listCollections() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -130,16 +125,16 @@ paths: ' language: csharp - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'from qdrant_client import QdrantClient - const client = new QdrantClient({ host: "localhost", port: 6333 }); + client = QdrantClient(url="http://localhost:6333") - client.getCollections(); + client.get_collections() ' - language: typescript + language: python - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/collections' \\\n --header\ \ 'api-key: '" @@ -156,16 +151,21 @@ paths: ' language: rust - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.get_collections() + client.getCollections(); ' - language: python + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.listCollectionsAsync().get();\n" + language: java /collections/aliases: post: description: Updates aliases for the specified collections. @@ -173,15 +173,6 @@ paths: tags: - Aliases x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport\ - \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Collections.DeleteShardKey;\nimport io.qdrant.client.grpc.Collections.DeleteShardKeyRequest;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.createAliasAsync(\"production_collection\"\ - , \"example_collection\").get();\n\nclient.deleteAliasAsync(\"production_collection\"\ - ).get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc updateAlias() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -209,14 +200,15 @@ paths: ' language: csharp - 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: "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: "# Create an alias\ncurl -X POST \\\n 'http://localhost:6333/collections/aliases'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -243,15 +235,23 @@ paths: \ alias_name: \"production_collection\".to_string(),\n })\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.update_collection_aliases(\n change_aliases_operations=[\n\ - \ models.CreateAliasOperation(\n create_alias=models.CreateAlias(\n\ - \ collection_name=\"example_collection\", alias_name=\"\ - production_collection\"\n )\n )\n ]\n)\n\nclient.update_collection_aliases(\n\ - \ change_aliases_operations=[\n models.DeleteAliasOperation(\n\ - \ delete_alias=models.DeleteAlias(alias_name=\"production_collection\"\ - )\n ),\n ]\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.updateCollectionAliases({\n actions: [\n {\n create_alias:\ + \ {\n collection_name: \"example_collection\",\n alias_name:\ + \ \"production_collection\",\n },\n },\n ],\n});\n\nclient.updateCollectionAliases({\n\ + \ actions: [\n {\n delete_alias: {\n alias_name: \"production_collection\"\ + ,\n },\n },\n ],\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport\ + \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Collections.DeleteShardKey;\nimport io.qdrant.client.grpc.Collections.DeleteShardKeyRequest;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.createAliasAsync(\"production_collection\"\ + , \"example_collection\").get();\n\nclient.deleteAliasAsync(\"production_collection\"\ + ).get();\n" + language: java /collections/{collection_name}: delete: description: Drops the specified collection and all associated data in it. @@ -259,12 +259,6 @@ paths: tags: - Collections x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.deleteCollectionAsync(\"\ - {collection_name}\").get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc deleteCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -284,16 +278,16 @@ paths: ' language: csharp - code-samples: - - code: 'import { QdrantClient } from ''@qdrant/qdrant-js''; + - code: 'from qdrant_client import QdrantClient - const client = new QdrantClient({url: ''http://127.0.0.1:6333''}); + client = QdrantClient(url="http://localhost:6333") - client.deleteCollection("{collection_name}"); + client.delete_collection(collection_name="{collection_name}") ' - language: typescript + language: python - code-samples: - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name'\ \ \\\n --header 'api-key: '" @@ -310,28 +304,28 @@ paths: ' language: rust - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from ''@qdrant/qdrant-js''; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({url: ''http://127.0.0.1:6333''}); - client.delete_collection(collection_name="{collection_name}") + client.deleteCollection("{collection_name}"); ' - language: python + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.deleteCollectionAsync(\"\ + {collection_name}\").get();\n" + language: java get: description: Retrieves parameters from the specified collection. summary: Get collection details tags: - Collections x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.getCollectionInfoAsync(\"\ - {collection_name}\").get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc getCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -352,16 +346,16 @@ paths: ' language: csharp - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'from qdrant_client import QdrantClient - const client = new QdrantClient({ host: "localhost", port: 6333 }); + client = QdrantClient(url="http://localhost:6333") - client.getCollection("{collection_name}"); + client.get_collection("{collection_name}") ' - language: typescript + language: python - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name'\ \ \\\n --header 'api-key: '" @@ -378,33 +372,28 @@ paths: ' language: rust - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.get_collection("{collection_name}") + client.getCollection("{collection_name}"); ' - language: python + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.getCollectionInfoAsync(\"\ + {collection_name}\").get();\n" + language: java patch: description: Updates the parameters of the specified collection. summary: Update collection parameters tags: - Collections x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport\ - \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Collections.OptimizersConfigDiff;\nimport\ - \ io.qdrant.client.grpc.Collections.UpdateCollection;\n\nQdrantClient\ - \ client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.updateCollectionAsync(\n\ - \ UpdateCollection.newBuilder()\n .setCollectionName(\"{collection_name}\"\ - )\n .setOptimizersConfig(\n OptimizersConfigDiff.newBuilder().setIndexingThreshold(10000).build())\n\ - \ .build());\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc updateCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -422,11 +411,11 @@ paths: \ { IndexingThreshold = 10000 }\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.updateCollection(\"{collection_name}\", {\n optimizers_config:\ - \ {\n indexing_threshold: 10000,\n },\n});\n" - language: typescript + - 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: "curl -X PATCH \\\n 'http://localhost:6333/collections/collection_name'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -441,32 +430,28 @@ paths: \ ),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.update_collection(\n collection_name=\"\ - {collection_name}\",\n optimizer_config=models.OptimizersConfigDiff(indexing_threshold=10000),\n\ - )\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.updateCollection(\"{collection_name}\", {\n optimizers_config:\ + \ {\n indexing_threshold: 10000,\n },\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport\ + \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Collections.OptimizersConfigDiff;\nimport\ + \ io.qdrant.client.grpc.Collections.UpdateCollection;\n\nQdrantClient\ + \ client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.updateCollectionAsync(\n\ + \ UpdateCollection.newBuilder()\n .setCollectionName(\"{collection_name}\"\ + )\n .setOptimizersConfig(\n OptimizersConfigDiff.newBuilder().setIndexingThreshold(10000).build())\n\ + \ .build());\n" + language: java put: description: Creates a new collection with the given parameters. summary: Create a collection tags: - Collections x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Collections.Distance;\nimport io.qdrant.client.grpc.Collections.VectorParams;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.createCollectionAsync(\"\ - {collection_name}\",\n VectorParams.newBuilder().setDistance(Distance.Cosine).setSize(100).build()).get();\n\ - \n// Or with sparse vectors\n\nclient.createCollectionAsync(\n CreateCollection.newBuilder()\n\ - \ .setCollectionName(\"{collection_name}\")\n .setSparseVectorsConfig(\n\ - \ Collections.SparseVectorConfig.newBuilder().putMap(\n \ - \ \"splade-model-name\",\n Collections.SparseVectorParams.newBuilder()\n\ - \ .setIndex(\n Collections.SparseIndexConfig\n\ - \ .newBuilder()\n \ - \ .setOnDisk(false)\n .build()\n \ - \ ).build()\n ).build()\n ).build()\n).get();" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc createCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -488,14 +473,11 @@ paths: \ OnDisk = false,\n }\n })\n);" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.createCollection(\"{collection_name}\", {\n vectors: { size: 100,\ - \ distance: \"Cosine\" },\n});\n\n// or with sparse vectors\n\nclient.createCollection(\"\ - {collection_name}\", {\n vectors: { size: 100, distance: \"Cosine\" },\n\ - \ sparse_vectors: {\n \"splade-model-name\": {\n index: {\n \ - \ on_disk: false\n }\n }\n }\n});" - language: typescript + - code: "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: "# Create a collection with default dense vector\ncurl -X PUT \\\n\ \ 'http://localhost:6333/collections/collection_name' \\\n --header\ @@ -517,26 +499,38 @@ paths: \ Distance::Cosine)),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.create_collection(\n collection_name=\"\ - {collection_name}\",\n vectors_config=models.VectorParams(size=100,\ - \ distance=models.Distance.COSINE),\n)\n" - language: python - /collections/{collection_name}/aliases: - get: - description: Retrieves a list of all aliases for the specified collection. - summary: List collection aliases - tags: - - Aliases - x-fern-examples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.createCollection(\"{collection_name}\", {\n vectors: { size: 100,\ + \ distance: \"Cosine\" },\n});\n\n// or with sparse vectors\n\nclient.createCollection(\"\ + {collection_name}\", {\n vectors: { size: 100, distance: \"Cosine\" },\n\ + \ sparse_vectors: {\n \"splade-model-name\": {\n index: {\n \ + \ on_disk: false\n }\n }\n }\n});" + language: typescript - code-samples: - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.listCollectionAliasesAsync(\"\ - {collection_name}\").get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \nimport io.qdrant.client.grpc.Collections.Distance;\nimport io.qdrant.client.grpc.Collections.VectorParams;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.createCollectionAsync(\"\ + {collection_name}\",\n VectorParams.newBuilder().setDistance(Distance.Cosine).setSize(100).build()).get();\n\ + \n// Or with sparse vectors\n\nclient.createCollectionAsync(\n CreateCollection.newBuilder()\n\ + \ .setCollectionName(\"{collection_name}\")\n .setSparseVectorsConfig(\n\ + \ Collections.SparseVectorConfig.newBuilder().putMap(\n \ + \ \"splade-model-name\",\n Collections.SparseVectorParams.newBuilder()\n\ + \ .setIndex(\n Collections.SparseIndexConfig\n\ + \ .newBuilder()\n \ + \ .setOnDisk(false)\n .build()\n \ + \ ).build()\n ).build()\n ).build()\n).get();" + language: java + /collections/{collection_name}/aliases: + get: + description: Retrieves a list of all aliases for the specified collection. + summary: List collection aliases + tags: + - Aliases + x-fern-examples: + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc listCollectionAliases() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ \tpanic(err)\n\t}\n\n\taliases, err := client.ListCollectionAliases(context.Background(),\ @@ -555,16 +549,16 @@ paths: ' language: csharp - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'from qdrant_client import QdrantClient - const client = new QdrantClient({ host: "localhost", port: 6333 }); + client = QdrantClient(url="http://localhost:6333") - client.getCollectionAliases("{collection_name}"); + client.get_collection_aliases("{collection_name}") ' - language: typescript + language: python - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/aliases'\ \ \\\n --header 'api-key: '" @@ -581,16 +575,22 @@ paths: ' language: rust - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.get_collection_aliases("{collection_name}") + client.getCollectionAliases("{collection_name}"); ' - language: python + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.listCollectionAliasesAsync(\"\ + {collection_name}\").get();\n" + language: java /collections/{collection_name}/cluster: get: description: Retrieves cluster details for a specified collection. @@ -609,23 +609,6 @@ paths: tags: - Collections x-fern-examples: - - code-samples: - - code: 'import static io.qdrant.client.ConditionFactory.matchKeyword; - - - import io.qdrant.client.QdrantClient; - - import io.qdrant.client.QdrantGrpcClient; - - - QdrantClient client = new QdrantClient(QdrantGrpcClient.newBuilder("localhost", - 6334, false).build()); - - - client.collectionExistsAsync("{collection_name}").get(); - - ' - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc collectionExists() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -646,16 +629,14 @@ paths: ' language: csharp - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - + - code: 'from qdrant_client import QdrantClient - const client = new QdrantClient({ host: "localhost", port: 6333 }); + client = QdrantClient(url="http://localhost:6333") - client.collectionExists("{collection_name}"); - ' - language: typescript + client.collection_exists(collection_name="{collection_name}")' + language: python - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/exists'\ \ \\\n --header 'api-key: '" @@ -672,14 +653,33 @@ paths: ' language: rust - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.collection_exists(collection_name="{collection_name}")' - language: python + client.collectionExists("{collection_name}"); + + ' + language: typescript + - code-samples: + - code: 'import static io.qdrant.client.ConditionFactory.matchKeyword; + + + import io.qdrant.client.QdrantClient; + + import io.qdrant.client.QdrantGrpcClient; + + + QdrantClient client = new QdrantClient(QdrantGrpcClient.newBuilder("localhost", + 6334, false).build()); + + + client.collectionExistsAsync("{collection_name}").get(); + + ' + language: java /collections/{collection_name}/facet: post: description: Retrieves facets for the specified payload field. @@ -687,18 +687,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport static io.qdrant.client.ConditionFactory.matchKeyword;\nimport\ - \ io.qdrant.client.grpc.Points;\nimport io.qdrant.client.grpc.Filter;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .facetAsync(\n \ - \ Points.FacetCounts.newBuilder()\n .setCollectionName(collection_name)\n\ - \ .setKey(\"my-payload-key\")\n .setFilter(\n \ - \ Filter.newBuilder()\n .addMust(matchKeyword(\"\ - color\", \"red\"))\n .build())\n .build())\n\ - \ .get();" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc facet() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -718,14 +706,11 @@ paths: key: \"my-payload-key\",\n\tlimit: 10\n);" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.facet(\"{collection_name}\", {\n filter: {\n must: [\n\ - \ {\n key: \"color\",\n match:\ - \ {\n value: \"red\",\n },\n \ - \ },\n ],\n },\n key: \"my-payload-key\",\n limit:\ - \ 10,\n});\n" - language: typescript + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.facet(\n collection_name=\"{collection_name}\"\ + ,\n key=\"my-payload-key\",\n facet_filter=models.Filter(must=[models.Match(\"\ + color\", \"red\")]),\n limit=10,\n)\n\n" + language: python - code-samples: - code: "use qdrant_client::qdrant::{Condition, FacetCountsBuilder, Filter};\n\ use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ @@ -736,11 +721,26 @@ paths: \ )])),\n )\n .await?;" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.facet(\n collection_name=\"{collection_name}\"\ - ,\n key=\"my-payload-key\",\n facet_filter=models.Filter(must=[models.Match(\"\ - color\", \"red\")]),\n limit=10,\n)\n\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.facet(\"{collection_name}\", {\n filter: {\n must: [\n\ + \ {\n key: \"color\",\n match:\ + \ {\n value: \"red\",\n },\n \ + \ },\n ],\n },\n key: \"my-payload-key\",\n limit:\ + \ 10,\n});\n" + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport static io.qdrant.client.ConditionFactory.matchKeyword;\nimport\ + \ io.qdrant.client.grpc.Points;\nimport io.qdrant.client.grpc.Filter;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .facetAsync(\n \ + \ Points.FacetCounts.newBuilder()\n .setCollectionName(collection_name)\n\ + \ .setKey(\"my-payload-key\")\n .setFilter(\n \ + \ Filter.newBuilder()\n .addMust(matchKeyword(\"\ + color\", \"red\"))\n .build())\n .build())\n\ + \ .get();" + language: java /collections/{collection_name}/index: put: description: Creates a payload index for a field in the specified collection. @@ -748,15 +748,6 @@ paths: tags: - Indexes x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Collections.PayloadSchemaType;\n\nQdrantClient\ - \ client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.createPayloadIndexAsync(\n\ - \ \"{collection_name}\",\n \"{field_name}\"\ - ,\n PayloadSchemaType.Keyword,\n null,\n\ - \ true,\n null,\n null);\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc createFieldIndex() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -773,11 +764,11 @@ paths: {collection_name}\",\n fieldName: \"name_of_the_field_to_index\"\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.createPayloadIndex(\"{collection_name}\", {\n field_name: \"{field_name}\"\ - ,\n field_schema: \"keyword\",\n});\n" - language: typescript + - 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: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/index'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -792,11 +783,20 @@ paths: \ FieldType::Keyword,\n ),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.create_payload_index(\n collection_name=\"\ - {collection_name}\",\n field_name=\"name_of_the_field_to_index\",\n\ - \ field_schema=\"keyword\",\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.createPayloadIndex(\"{collection_name}\", {\n field_name: \"{field_name}\"\ + ,\n field_schema: \"keyword\",\n});\n" + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Collections.PayloadSchemaType;\n\nQdrantClient\ + \ client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.createPayloadIndexAsync(\n\ + \ \"{collection_name}\",\n \"{field_name}\"\ + ,\n PayloadSchemaType.Keyword,\n null,\n\ + \ true,\n null,\n null);\n" + language: java /collections/{collection_name}/index/{field_name}: delete: description: Deletes a payload index for a field in the specified collection. @@ -804,12 +804,6 @@ paths: tags: - Indexes x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.deletePayloadIndexAsync(\"\ - {collection_name}\", \"{field_name}\", true, null, null).get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc deleteFieldIndex() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -825,16 +819,16 @@ paths: {collection_name}\",\n fieldName: \"name_of_the_field_to_index\"\n);\n" language: csharp - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'from qdrant_client import QdrantClient - const client = new QdrantClient({ host: "localhost", port: 6333 }); + client = QdrantClient(url="http://localhost:6333") - client.deletePayloadIndex("{collection_name}", "{field_name}"); + client.delete_payload_index("{collection_name}", "{field_name}"); ' - language: typescript + language: python - code-samples: - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/index/field_name'\ \ \\\n --header 'api-key: '" @@ -847,16 +841,22 @@ paths: \ .await?;\n" language: rust - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.delete_payload_index("{collection_name}", "{field_name}"); + client.deletePayloadIndex("{collection_name}", "{field_name}"); ' - language: python + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.deletePayloadIndexAsync(\"\ + {collection_name}\", \"{field_name}\", true, null, null).get();\n" + language: java /collections/{collection_name}/points: post: description: Retrieves all details from multiple points. @@ -864,13 +864,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .retrieveAsync(\"{collection_name}\"\ - , List.of(id(0), id(30), id(100)), false, false, null)\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc getPoints() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -888,10 +881,10 @@ paths: );\n" language: csharp - 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: "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: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -905,10 +898,17 @@ paths: ,\n vec![0.into(), 30.into(), 100.into()],\n ))\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.retrieve(\n collection_name=\"{collection_name}\"\ - ,\n ids=[0, 3, 100],\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.retrieve(\"{collection_name}\", {\n ids: [0, 3, 100],\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .retrieveAsync(\"{collection_name}\"\ + , List.of(id(0), id(30), id(100)), false, false, null)\n .get();\n" + language: java put: description: Performs the insert + update action on specified points. Any point with an existing {id} will be overwritten. @@ -916,27 +916,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ - \ io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\ - \nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\n\ - import io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.PointStruct;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .upsertAsync(\n \ - \ \"{collection_name}\",\n List.of(\n PointStruct.newBuilder()\n\ - \ .setId(id(1))\n .setVectors(\n \ - \ namedVectors(\n Map.of(\n \ - \ \"image\",\n vector(List.of(0.9f,\ - \ 0.1f, 0.1f, 0.2f)),\n \"text\",\n \ - \ vector(List.of(0.4f, 0.7f, 0.1f, 0.8f, 0.1f, 0.1f,\ - \ 0.9f, 0.2f)))))\n .build(),\n PointStruct.newBuilder()\n\ - \ .setId(id(2))\n .setVectors(\n \ - \ namedVectors(\n Map.of(\n \ - \ \"image\",\n List.of(0.2f,\ - \ 0.1f, 0.3f, 0.9f),\n \"text\",\n \ - \ List.of(0.5f, 0.2f, 0.7f, 0.4f, 0.7f, 0.2f, 0.3f,\ - \ 0.9f))))\n .build()))\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc upsert() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -967,15 +946,17 @@ paths: ] = \"blue\" }\n }\n }\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "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: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -1010,17 +991,36 @@ paths: \ .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.upsert(\n collection_name=\"{collection_name}\"\ - ,\n points=[\n models.PointStruct(\n id=1,\n \ - \ payload={\n \"color\": \"red\",\n },\n\ - \ vector=[0.9, 0.1, 0.1],\n ),\n models.PointStruct(\n\ - \ id=2,\n payload={\n \"color\":\ - \ \"green\",\n },\n vector=[0.1, 0.9, 0.1],\n \ - \ ),\n models.PointStruct(\n id=3,\n \ - \ payload={\n \"color\": \"blue\",\n },\n \ - \ vector=[0.1, 0.1, 0.9],\n ),\n ],\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.upsert(\"{collection_name}\", {\n points: [\n {\n id:\ + \ 1,\n payload: { color: \"red\" },\n vector: [0.9, 0.1, 0.1],\n\ + \ },\n {\n id: 2,\n payload: { color: \"green\" },\n \ + \ vector: [0.1, 0.9, 0.1],\n },\n {\n id: 3,\n payload:\ + \ { color: \"blue\" },\n vector: [0.1, 0.1, 0.9],\n },\n ],\n\ + });\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ + \ io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\ + \nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\n\ + import io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.PointStruct;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .upsertAsync(\n \ + \ \"{collection_name}\",\n List.of(\n PointStruct.newBuilder()\n\ + \ .setId(id(1))\n .setVectors(\n \ + \ namedVectors(\n Map.of(\n \ + \ \"image\",\n vector(List.of(0.9f,\ + \ 0.1f, 0.1f, 0.2f)),\n \"text\",\n \ + \ vector(List.of(0.4f, 0.7f, 0.1f, 0.8f, 0.1f, 0.1f,\ + \ 0.9f, 0.2f)))))\n .build(),\n PointStruct.newBuilder()\n\ + \ .setId(id(2))\n .setVectors(\n \ + \ namedVectors(\n Map.of(\n \ + \ \"image\",\n List.of(0.2f,\ + \ 0.1f, 0.3f, 0.9f),\n \"text\",\n \ + \ List.of(0.5f, 0.2f, 0.7f, 0.4f, 0.7f, 0.2f, 0.3f,\ + \ 0.9f))))\n .build()))\n .get();\n" + language: java /collections/{collection_name}/points/batch: post: description: Batch updates points, including their respective vectors and payloads. @@ -1028,41 +1028,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "import java.util.List;\nimport java.util.Map;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ - import static io.qdrant.client.ValueFactory.value;\nimport static io.qdrant.client.VectorsFactory.vectors;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Points.PointStruct;\nimport io.qdrant.client.grpc.Points.PointVectors;\n\ - import io.qdrant.client.grpc.Points.PointsIdsList;\nimport io.qdrant.client.grpc.Points.PointsSelector;\n\ - import io.qdrant.client.grpc.Points.PointsUpdateOperation;\nimport io.qdrant.client.grpc.Points.PointsUpdateOperation.PointStructList;\n\ - import io.qdrant.client.grpc.Points.PointsUpdateOperation.SetPayload;\n\ - import io.qdrant.client.grpc.Points.PointsUpdateOperation.UpdateVectors;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .batchUpdateAsync(\n\ - \ \"{collection_name}\",\n List.of(\n PointsUpdateOperation.newBuilder()\n\ - \ .setUpsert(\n PointStructList.newBuilder()\n\ - \ .addPoints(\n PointStruct.newBuilder()\n\ - \ .setId(id(1))\n .setVectors(vectors(\n\ - \ 1.0 f,\n 2.0 f,\n \ - \ 3.0 f,\n 4.0 f))\n \ - \ .build())\n .build())\n .build(),\n\ - \ PointsUpdateOperation.newBuilder()\n .setUpdateVectors(\n\ - \ UpdateVectors.newBuilder()\n .addPoints(\n\ - \ PointVectors.newBuilder()\n .setId(id(1))\n\ - \ .setVectors(vectors(\n 1.0\ - \ f,\n 2.0 f,\n 3.0 f,\n\ - \ 4.0 f))\n .build())\n \ - \ .build())\n .build(),\n PointsUpdateOperation.newBuilder()\n\ - \ .setSetPayload(\n SetPayload.newBuilder()\n\ - \ .setPointsSelector(\n PointsSelector.newBuilder()\n\ - \ .setPoints(PointsIdsList\n \ - \ .newBuilder()\n .addIds(id(1))\n \ - \ .build())\n .build())\n \ - \ .putAllPayload(\n Map.of(\"test_payload_2\",\n\ - \ value(2),\n \"test_payload_3\"\ - ,\n value(3)))\n .build())\n \ - \ .build()))\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc batchUpdate() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -1098,21 +1063,23 @@ paths: ] = 2, [\"test_payload_3\"] = 3 }\n }\n }\n ]\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "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: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/batch'\ \ \\\n --header 'Content-Type: application/json' \\\n --header 'api-key:\ @@ -1162,23 +1129,56 @@ paths: \ .wait(true),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.batch_update_points(\n collection_name=\"\ - {collection_name}\",\n update_operations=[\n models.UpsertOperation(\n\ - \ upsert=models.PointsList(\n points=[\n \ - \ models.PointStruct(\n id=1,\n\ - \ vector=[1.0, 2.0, 3.0, 4.0],\n \ - \ payload={},\n ),\n ]\n \ - \ )\n ),\n models.UpdateVectorsOperation(\n \ - \ update_vectors=models.UpdateVectors(\n points=[\n\ - \ models.PointVectors(\n id=1,\n\ - \ vector=[1.0, 2.0, 3.0, 4.0],\n \ - \ )\n ]\n )\n ),\n models.SetPayloadOperation(\n\ - \ set_payload=models.SetPayload(\n payload={\n\ - \ \"test_payload_2\": 2,\n \"test_payload_3\"\ - : 3,\n },\n points=[1],\n )\n\ - \ ),\n ],\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.batchUpdate(\"{collection_name}\", {\n operations: [\n \ + \ {\n upsert: {\n points: [\n \ + \ {\n id: 1,\n vector:\ + \ [1.0, 2.0, 3.0, 4.0],\n payload: {},\n \ + \ },\n ],\n },\n },\n \ + \ {\n update_vectors: {\n points: [\n \ + \ {\n id: 1,\n \ + \ vector: [1.0, 2.0, 3.0, 4.0],\n },\n \ + \ ],\n },\n },\n {\n set_payload:\ + \ {\n payload: {\n test_payload_2: 2,\n\ + \ test_payload_3: 3,\n },\n \ + \ points: [1],\n },\n },\n ],\n});\n" + language: typescript + - code-samples: + - code: "import java.util.List;\nimport java.util.Map;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ + import static io.qdrant.client.ValueFactory.value;\nimport static io.qdrant.client.VectorsFactory.vectors;\n\ + \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: description: Counts the number of points that match a specified filtering condition. @@ -1186,14 +1186,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ - import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Common.Filter;\n\nQdrantClient client =\ - \ new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\ - \nclient\n .countAsync(\n \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"\ - color\", \"red\")).build(),\n true)\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc count() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -1211,13 +1203,12 @@ paths: , \"red\"),\n exact: true\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "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: "# Count total number of points in a collection\ncurl -X POST \\\n\ \ 'http://localhost:6333/collections/collection_name/points/count' \\\ @@ -1239,12 +1230,21 @@ paths: \ )]))\n .exact(true),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.count(\n collection_name=\"{collection_name}\"\ - ,\n count_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"\ - color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n\ - \ exact=True,\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.count(\"{collection_name}\", {\n filter: {\n must: [\n\ + \ {\n key: \"color\",\n match:\ + \ {\n value: \"red\",\n },\n \ + \ },\n ],\n },\n exact: true,\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ + import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Common.Filter;\n\nQdrantClient client =\ + \ new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\ + \nclient\n .countAsync(\n \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"\ + color\", \"red\")).build(),\n true)\n .get();\n" + language: java /collections/{collection_name}/points/delete: post: description: Deletes specified points from the collection. @@ -1252,17 +1252,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ - \ io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport java.util.List;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Common.Filter;\n\nQdrantClient client =\ - \ new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\"\ - , 6334, false).build());\n\nclient.deleteAsync(\"{collection_name}\",\ - \ List.of(id(0), id(3), id(100)));\n\nclient\n .deleteAsync(\n \ - \ \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"\ - color\", \"red\")).build())\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc delete() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -1293,14 +1282,15 @@ paths: ' language: csharp - 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: "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: "# Delete points by IDs\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/delete'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -1325,15 +1315,25 @@ paths: \ .wait(true),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.delete(\n collection_name=\"{collection_name}\"\ - ,\n points_selector=models.PointIdsList(\n points=[0, 3, 100],\n\ - \ ),\n)\n\nclient.delete(\n collection_name=\"{collection_name}\"\ - ,\n points_selector=models.FilterSelector(\n filter=models.Filter(\n\ - \ must=[\n models.FieldCondition(\n \ - \ key=\"color\",\n match=models.MatchValue(value=\"\ - red\"),\n ),\n ],\n )\n ),\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.delete(\"{collection_name}\", {\n points: [0, 3, 100],\n});\n\n\ + client.delete(\"{collection_name}\", {\n filter: {\n must: [\n\ + \ {\n key: \"color\",\n match:\ + \ {\n value: \"red\",\n },\n \ + \ },\n ],\n },\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ + \ io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport java.util.List;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Common.Filter;\n\nQdrantClient client =\ + \ new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\"\ + , 6334, false).build());\n\nclient.deleteAsync(\"{collection_name}\",\ + \ List.of(id(0), id(3), id(100)));\n\nclient\n .deleteAsync(\n \ + \ \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"\ + color\", \"red\")).build())\n .get();\n" + language: java /collections/{collection_name}/points/discover: {} /collections/{collection_name}/points/discover/batch: {} /collections/{collection_name}/points/payload: @@ -1343,16 +1343,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ - \ io.qdrant.client.ValueFactory.value;\n\nimport java.util.List;\nimport\ - \ java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .setPayloadAsync(\n\ - \ \"{collection_name}\",\n Map.of(\"property1\", value(\"\ - string\"), \"property2\", value(\"string\")),\n List.of(id(0),\ - \ id(3), id(10)),\n true,\n null,\n null)\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc setPayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -1373,12 +1363,12 @@ paths: \ } },\n ids: new ulong[] { 0, 3, 10 }\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.setPayload(\"{collection_name}\", {\n payload: {\n property1:\ - \ \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n\ - });\n" - language: typescript + - 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: "# Set payload by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -1405,28 +1395,28 @@ paths: \ )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.set_payload(\n collection_name=\"\ - {collection_name}\",\n payload={\n \"property1\": \"string\"\ - ,\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n\ - )\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.setPayload(\"{collection_name}\", {\n payload: {\n property1:\ + \ \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n\ + });\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ + \ io.qdrant.client.ValueFactory.value;\n\nimport java.util.List;\nimport\ + \ java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .setPayloadAsync(\n\ + \ \"{collection_name}\",\n Map.of(\"property1\", value(\"\ + string\"), \"property2\", value(\"string\")),\n List.of(id(0),\ + \ id(3), id(10)),\n true,\n null,\n null)\n .get();\n" + language: java put: description: Replaces the entire payload of a specified point with a new payload. summary: Overwrite payload tags: - Points x-fern-examples: - - code-samples: - - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ - import static io.qdrant.client.ValueFactory.value;\n\nimport io.qdrant.client.QdrantClient;\n\ - import io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new\ - \ QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\"\ - , 6334, false).build());\n\nclient\n .overwritePayloadAsync(\n \ - \ \"{collection_name}\",\n Map.of(\"property1\", value(\"string\"\ - ), \"property2\", value(\"string\")),\n List.of(id(0), id(3), id(10)),\n\ - \ true,\n null,\n null)\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc overwritePayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -1446,12 +1436,12 @@ paths: \ } },\n ids: new ulong[] { 0, 3, 10 }\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.overwritePayload(\"{collection_name}\", {\n payload: {\n property1:\ - \ \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n\ - });\n" - language: typescript + - 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: "# Overwrite payload by ID\ncurl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points/payload'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -1477,12 +1467,22 @@ paths: \ }))\n .wait(true),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.overwrite_payload(\n collection_name=\"\ - {collection_name}\",\n payload={\n \"property1\": \"string\"\ - ,\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n\ - )\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.overwritePayload(\"{collection_name}\", {\n payload: {\n property1:\ + \ \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n\ + });\n" + language: typescript + - code-samples: + - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ + import static io.qdrant.client.ValueFactory.value;\n\nimport io.qdrant.client.QdrantClient;\n\ + 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: description: Removes the entire payload for specified points. @@ -1490,13 +1490,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.clearPayloadAsync(\"{collection_name}\"\ - , List.of(id(0), id(3), id(100)), null, null, null)\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc clearPayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -1519,11 +1512,10 @@ paths: ' language: csharp - 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: "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: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload/clear'\ \ \\\n --header 'Content-Type: application/json' \\\n --header 'api-key:\ @@ -1538,10 +1530,18 @@ paths: \ vec![0.into(), 3.into(), 100.into()],\n },\n ))\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.clear_payload(\n collection_name=\"\ - {collection_name}\",\n points_selector=[0, 3, 100],\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.clearPayload(\"{collection_name}\", {\n points: [0, 3, 100],\n\ + });\n" + language: typescript + - code-samples: + - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.clearPayloadAsync(\"{collection_name}\"\ + , List.of(id(0), id(3), id(100)), null, null, null)\n .get();\n" + language: java /collections/{collection_name}/points/payload/delete: post: description: Deletes a specified key payload for points. @@ -1549,15 +1549,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .deletePayloadAsync(\n\ - \ \"{collection_name}\",\n List.of(\"color\", \"price\"\ - ),\n List.of(id(0), id(3), id(100)),\n true,\n null,\n\ - \ null)\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc deletePayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -1581,11 +1572,11 @@ paths: ' language: csharp - 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: "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: "# Delete payload by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload/delete'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -1608,11 +1599,20 @@ paths: \ .wait(true),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.delete_payload(\n collection_name=\"\ - {collection_name}\",\n keys=[\"color\", \"price\"],\n points=[0,\ - \ 3, 100],\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.deletePayload(\"{collection_name}\", {\n keys: [\"color\", \"\ + price\"],\n points: [0, 3, 100],\n});\n" + language: typescript + - code-samples: + - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .deletePayloadAsync(\n\ + \ \"{collection_name}\",\n List.of(\"color\", \"price\"\ + ),\n List.of(id(0), id(3), id(100)),\n true,\n null,\n\ + \ null)\n .get();\n" + language: java /collections/{collection_name}/points/query: post: description: Universally query points. This endpoint covers all capabilities @@ -1622,104 +1622,6 @@ paths: tags: - Search x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.QueryFactory.fusion;\nimport static\ - \ io.qdrant.client.QueryFactory.nearest;\nimport static io.qdrant.client.QueryFactory.recommend;\n\ - import static io.qdrant.client.VectorInputFactory.vectorInput;\n\nimport\ - \ java.util.UUID;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - import io.qdrant.client.grpc.Points.Fusion;\nimport io.qdrant.client.grpc.Points.PrefetchQuery;\n\ - import io.qdrant.client.grpc.Points.QueryPoints;\nimport io.qdrant.client.grpc.Points.RecommendInput;\n\ - \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\n// Query nearest by ID\nclient\n\ - \ .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"\ - {collection_name}\")\n .setQuery(nearest(UUID.fromString(\"\ - 43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")))\n .build())\n \ - \ .get();\n\n// Recommend on the average of these vectors\nclient\n \ - \ .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"\ - {collection_name}\")\n .setQuery(\n recommend(\n\ - \ RecommendInput.newBuilder()\n \ - \ .addPositive(vectorInput(UUID.fromString(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\ - )))\n .addPositive(vectorInput(0.11f, 0.35f, 0.6f))\n\ - \ .addNegative(vectorInput(0.01f, 0.45f, 0.67f))\n\ - \ .build()))\n .build())\n .get();\n\ - \n// Fusion query\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n\ - \ .setCollectionName(\"{collection_name}\")\n .addPrefetch(\n\ - \ PrefetchQuery.newBuilder()\n .setQuery(nearest(List.of(0.22f,\ - \ 0.8f), List.of(1, 42)))\n .setUsing(\"sparse\")\n\ - \ .setLimit(20)\n .build())\n \ - \ .addPrefetch(\n PrefetchQuery.newBuilder()\n\ - \ .setQuery(nearest(List.of(0.01f, 0.45f, 0.67f)))\n\ - \ .setUsing(\"dense\")\n .setLimit(20)\n\ - \ .build())\n .setQuery(fusion(Fusion.RRF))\n\ - \ .build())\n .get();\n\n// 2-stage query\nclient\n .queryAsync(\n\ - \ QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\"\ - )\n .addPrefetch(\n PrefetchQuery.newBuilder()\n\ - \ .setQuery(nearest(0.01f, 0.45f, 0.67f))\n \ - \ .setLimit(100)\n .build())\n \ - \ .setQuery(\n nearest(\n new float[][]\ - \ {\n {0.1f, 0.2f},\n {0.2f,\ - \ 0.1f},\n {0.8f, 0.9f}\n }))\n\ - \ .setUsing(\"colbert\")\n .setLimit(10)\n \ - \ .build())\n .get();\n\n// Random sampling (as of 1.11.0)\n\ - client\n .queryAsync(\n QueryPoints.newBuilder()\n \ - \ .setCollectionName(\"{collection_name}\")\n .setQuery(sample(Sample.Random))\n\ - \ .build())\n .get();\n\n// Score boost depending on payload\ - \ conditions (as of 1.14.0)\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n\ - \ .setCollectionName(\"{collection_name}\")\n .addPrefetch(\n\ - \ PrefetchQuery.newBuilder()\n .setQuery(nearest(0.01f,\ - \ 0.45f, 0.67f))\n .setLimit(100)\n \ - \ .build())\n .setQuery(\n formula(\n \ - \ Formula.newBuilder()\n .setExpression(\n\ - \ sum(\n SumExpression.newBuilder()\n\ - \ .addSum(variable(\"$score\"))\n \ - \ .addSum(\n \ - \ mult(\n MultExpression.newBuilder()\n\ - \ .addMult(constant(0.5f))\n\ - \ .addMult(\n \ - \ condition(\n \ - \ matchKeywords(\n \ - \ \"tag\",\n \ - \ List.of(\"h1\",\ - \ \"h2\", \"h3\", \"h4\"))))\n \ - \ .build()))\n .addSum(mult(MultExpression.newBuilder()\n\ - \ .addMult(constant(0.25f))\n \ - \ .addMult(\n \ - \ condition(\n \ - \ matchKeywords(\n \"\ - tag\",\n List.of(\"p\"\ - , \"li\"))))\n .build()))\n \ - \ .build()))\n .build()))\n\ - \ .build())\n .get();\n\n// Score boost geographically closer\ - \ points (as of 1.14.0)\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n\ - \ .setCollectionName(\"{collection_name}\")\n .addPrefetch(\n\ - \ PrefetchQuery.newBuilder()\n .setQuery(nearest(0.01f,\ - \ 0.45f, 0.67f))\n .setLimit(100)\n \ - \ .build())\n .setQuery(\n formula(\n \ - \ Formula.newBuilder()\n .setExpression(\n\ - \ sum(\n SumExpression.newBuilder()\n\ - \ .addSum(variable(\"$score\"))\n \ - \ .addSum(\n \ - \ expDecay(\n \ - \ DecayParamsExpression.newBuilder()\n \ - \ .setX(\n \ - \ geoDistance(\n \ - \ GeoDistance.newBuilder()\n \ - \ .setOrigin(\n \ - \ GeoPoint.newBuilder()\n \ - \ .setLat(52.504043)\n\ - \ .setLon(13.393236)\n\ - \ .build())\n\ - \ .setTo(\"\ - geo.location\")\n \ - \ .build()))\n .setScale(5000)\n\ - \ .build()))\n \ - \ .build()))\n .putDefaults(\n\ - \ \"geo.location\",\n \ - \ value(\n Map.of(\n \ - \ \"lat\", value(48.137154),\n \ - \ \"lon\", value(11.576124))))\n \ - \ .build()))\n .build())\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc query() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -1827,44 +1729,52 @@ paths: \t\t\t\t[\"lon\"] = 11.576124,\n\t\t\t},\n\t\t},\n\t}\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - // Query nearest by ID\nlet _nearest = client.query(\"{collection_name\"\ - , {\n query: \"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\n});\n\n// Recommend\ - \ on the average of these vectors\nlet _recommendations = client.query(\"\ - {collection_name}\", {\n query: {\n recommend: {\n \ - \ positive: [\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\", [0.11, 0.35,\ - \ 0.6]],\n negative: [0.01, 0.45, 0.67]\n }\n }\n\ - });\n\n// Fusion query\nlet _hybrid = client.query(\"{collection_name}\"\ - , {\n prefetch: [\n {\n query: {\n \ - \ values: [0.22, 0.8],\n indices: [1, 42],\n \ - \ },\n using: 'sparse',\n limit: 20,\n \ - \ },\n {\n query: [0.01, 0.45, 0.67],\n using:\ - \ 'dense',\n limit: 20,\n },\n ],\n query: {\n\ - \ fusion: 'rrf',\n },\n});\n\n// 2-stage query\nlet _refined\ - \ = client.query(\"{collection_name}\", {\n prefetch: {\n query:\ - \ [1, 23, 45, 67],\n limit: 100,\n },\n query: [\n \ - \ [0.1, 0.2],\n [0.2, 0.1],\n [0.8, 0.9],\n ],\n \ - \ using: 'colbert',\n limit: 10,\n});\n\n// Random sampling (as of\ - \ 1.11.0)\nlet _sampled = client.query(\"{collection_name}\", {\n query:\ - \ { sample: \"random\" },\n});\n\n// Score boost depending on payload\ - \ conditions (as of 1.14.0)\nconst tag_boosted = await client.query(\"\ - {collection_name}\", {\n prefetch: {\n query: [0.2, 0.8, 0.1, 0.9],\n\ - \ limit: 50\n },\n query: {\n formula: {\n sum: [\n \ - \ \"$score\",\n {\n mult: [ 0.5, { key: \"tag\", match:\ - \ { any: [\"h1\", \"h2\", \"h3\", \"h4\"] }} ]\n },\n {\n\ - \ mult: [ 0.25, { key: \"tag\", match: { any: [\"p\", \"li\"\ - ] }} ]\n }\n ]\n }\n }\n});\n\n// Score boost geographically\ - \ closer points (as of 1.14.0)\nconst distance_boosted = await client.query(\"\ - {collection_name}\", {\n prefetch: {\n query: [0.2, 0.8, ...],\n \ - \ limit: 50\n },\n query: {\n formula: {\n sum: [\n \ - \ \"$score\",\n {\n gauss_decay: {\n x: {\n\ - \ geo_distance: {\n origin: { lat: 52.504043,\ - \ lon: 13.393236 }, // Berlin\n to: \"geo.location\"\n\ - \ }\n },\n scale: 5000 // 5km\n \ - \ }\n }\n ]\n },\n defaults: { \"geo.location\"\ - : { lat: 48.137154, lon: 11.576124 } } // Munich\n }\n});\n" - language: typescript + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\n# Query nearest by ID\nnearest = client.query_points(\n\ + \ collection_name=\"{collection_name}\",\n query=\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\ + ,\n)\n\n# Recommend on the average of these vectors\nrecommended = client.query_points(\n\ + \ collection_name=\"{collection_name}\",\n query=models.RecommendQuery(recommend=models.RecommendInput(\n\ + \ positive=[\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\", [0.11, 0.35,\ + \ 0.6, ...]],\n negative=[[0.01, 0.45, 0.67, ...]]\n ))\n)\n\ + \n# Fusion query\nhybrid = client.query_points(\n collection_name=\"\ + {collection_name}\",\n prefetch=[\n models.Prefetch(\n \ + \ query=models.SparseVector(indices=[1, 42], values=[0.22, 0.8]),\n\ + \ using=\"sparse\",\n limit=20,\n ),\n \ + \ models.Prefetch(\n query=[0.01, 0.45, 0.67, ...], #\ + \ <-- dense vector\n using=\"dense\",\n limit=20,\n\ + \ ),\n ],\n query=models.FusionQuery(fusion=models.Fusion.RRF),\n\ + )\n\n# 2-stage query\nrefined = client.query_points(\n collection_name=\"\ + {collection_name}\",\n prefetch=models.Prefetch(\n query=[0.01,\ + \ 0.45, 0.67, ...], # <-- dense vector\n limit=100,\n ),\n\ + \ query=[\n [0.1, 0.2, ...], # <\u2500\u2510\n [0.2,\ + \ 0.1, ...], # < \u251C\u2500 multi-vector\n [0.8, 0.9, ...],\ + \ # < \u2518\n ],\n using=\"colbert\",\n limit=10,\n)\n\n# Random\ + \ sampling (as of 1.11.0)\nsampled = client.query_points(\n collection_name=\"\ + {collection_name}\",\n query=models.SampleQuery(sample=models.Sample.RANDOM)\n\ + )\n\n# Score boost depending on payload conditions (as of 1.14.0)\ntag_boosted\ + \ = client.query_points(\n collection_name=\"{collection_name}\",\n\ + \ prefetch=models.Prefetch(\n query=[0.2, 0.8, ...], # <--\ + \ dense vector\n limit=50\n ),\n query=models.FormulaQuery(\n\ + \ formula=models.SumExpression(sum=[\n \"$score\",\n\ + \ models.MultExpression(mult=[0.5, models.FieldCondition(key=\"\ + tag\", match=models.MatchAny(any=[\"h1\", \"h2\", \"h3\", \"h4\"]))]),\n\ + \ models.MultExpression(mult=[0.25, models.FieldCondition(key=\"\ + tag\", match=models.MatchAny(any=[\"p\", \"li\"]))])\n ]\n ))\n\ + )\n\n# Score boost geographically closer points (as of 1.14.0)\ngeo_boosted\ + \ = client.query_points(\n collection_name=\"{collection_name}\",\n\ + \ prefetch=models.Prefetch(\n query=[0.2, 0.8, ...], # <--\ + \ dense vector\n limit=50\n ),\n query=models.FormulaQuery(\n\ + \ formula=models.SumExpression(sum=[\n \"$score\",\n\ + \ models.GaussDecayExpression(\n gauss_decay=models.DecayParamsExpression(\n\ + \ x=models.GeoDistance(\n geo_distance=models.GeoDistanceParams(\n\ + \ origin=models.GeoPoint(\n \ + \ lat=52.504043,\n lon=13.393236\n\ + \ ), # Berlin\n \ + \ to=\"geo.location\"\n )\n \ + \ ),\n scale=5000 # 5km\n )\n \ + \ )\n ]),\n defaults={\"geo.location\": models.GeoPoint(lat=48.137154,\ + \ lon=11.576124)} # Munich\n )\n)\n" + language: python - code-samples: - code: "# Query nearest by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -1976,52 +1886,142 @@ paths: \ .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\n# Query nearest by ID\nnearest = client.query_points(\n\ - \ collection_name=\"{collection_name}\",\n query=\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\ - ,\n)\n\n# Recommend on the average of these vectors\nrecommended = client.query_points(\n\ - \ collection_name=\"{collection_name}\",\n query=models.RecommendQuery(recommend=models.RecommendInput(\n\ - \ positive=[\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\", [0.11, 0.35,\ - \ 0.6, ...]],\n negative=[[0.01, 0.45, 0.67, ...]]\n ))\n)\n\ - \n# Fusion query\nhybrid = client.query_points(\n collection_name=\"\ - {collection_name}\",\n prefetch=[\n models.Prefetch(\n \ - \ query=models.SparseVector(indices=[1, 42], values=[0.22, 0.8]),\n\ - \ using=\"sparse\",\n limit=20,\n ),\n \ - \ models.Prefetch(\n query=[0.01, 0.45, 0.67, ...], #\ - \ <-- dense vector\n using=\"dense\",\n limit=20,\n\ - \ ),\n ],\n query=models.FusionQuery(fusion=models.Fusion.RRF),\n\ - )\n\n# 2-stage query\nrefined = client.query_points(\n collection_name=\"\ - {collection_name}\",\n prefetch=models.Prefetch(\n query=[0.01,\ - \ 0.45, 0.67, ...], # <-- dense vector\n limit=100,\n ),\n\ - \ query=[\n [0.1, 0.2, ...], # <\u2500\u2510\n [0.2,\ - \ 0.1, ...], # < \u251C\u2500 multi-vector\n [0.8, 0.9, ...],\ - \ # < \u2518\n ],\n using=\"colbert\",\n limit=10,\n)\n\n# Random\ - \ sampling (as of 1.11.0)\nsampled = client.query_points(\n collection_name=\"\ - {collection_name}\",\n query=models.SampleQuery(sample=models.Sample.RANDOM)\n\ - )\n\n# Score boost depending on payload conditions (as of 1.14.0)\ntag_boosted\ - \ = client.query_points(\n collection_name=\"{collection_name}\",\n\ - \ prefetch=models.Prefetch(\n query=[0.2, 0.8, ...], # <--\ - \ dense vector\n limit=50\n ),\n query=models.FormulaQuery(\n\ - \ formula=models.SumExpression(sum=[\n \"$score\",\n\ - \ models.MultExpression(mult=[0.5, models.FieldCondition(key=\"\ - tag\", match=models.MatchAny(any=[\"h1\", \"h2\", \"h3\", \"h4\"]))]),\n\ - \ models.MultExpression(mult=[0.25, models.FieldCondition(key=\"\ - tag\", match=models.MatchAny(any=[\"p\", \"li\"]))])\n ]\n ))\n\ - )\n\n# Score boost geographically closer points (as of 1.14.0)\ngeo_boosted\ - \ = client.query_points(\n collection_name=\"{collection_name}\",\n\ - \ prefetch=models.Prefetch(\n query=[0.2, 0.8, ...], # <--\ - \ dense vector\n limit=50\n ),\n query=models.FormulaQuery(\n\ - \ formula=models.SumExpression(sum=[\n \"$score\",\n\ - \ models.GaussDecayExpression(\n gauss_decay=models.DecayParamsExpression(\n\ - \ x=models.GeoDistance(\n geo_distance=models.GeoDistanceParams(\n\ - \ origin=models.GeoPoint(\n \ - \ lat=52.504043,\n lon=13.393236\n\ - \ ), # Berlin\n \ - \ to=\"geo.location\"\n )\n \ - \ ),\n scale=5000 # 5km\n )\n \ - \ )\n ]),\n defaults={\"geo.location\": models.GeoPoint(lat=48.137154,\ - \ lon=11.576124)} # Munich\n )\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + // Query nearest by ID\nlet _nearest = client.query(\"{collection_name\"\ + , {\n query: \"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\n});\n\n// Recommend\ + \ on the average of these vectors\nlet _recommendations = client.query(\"\ + {collection_name}\", {\n query: {\n recommend: {\n \ + \ positive: [\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\", [0.11, 0.35,\ + \ 0.6]],\n negative: [0.01, 0.45, 0.67]\n }\n }\n\ + });\n\n// Fusion query\nlet _hybrid = client.query(\"{collection_name}\"\ + , {\n prefetch: [\n {\n query: {\n \ + \ values: [0.22, 0.8],\n indices: [1, 42],\n \ + \ },\n using: 'sparse',\n limit: 20,\n \ + \ },\n {\n query: [0.01, 0.45, 0.67],\n using:\ + \ 'dense',\n limit: 20,\n },\n ],\n query: {\n\ + \ fusion: 'rrf',\n },\n});\n\n// 2-stage query\nlet _refined\ + \ = client.query(\"{collection_name}\", {\n prefetch: {\n query:\ + \ [1, 23, 45, 67],\n limit: 100,\n },\n query: [\n \ + \ [0.1, 0.2],\n [0.2, 0.1],\n [0.8, 0.9],\n ],\n \ + \ using: 'colbert',\n limit: 10,\n});\n\n// Random sampling (as of\ + \ 1.11.0)\nlet _sampled = client.query(\"{collection_name}\", {\n query:\ + \ { sample: \"random\" },\n});\n\n// Score boost depending on payload\ + \ conditions (as of 1.14.0)\nconst tag_boosted = await client.query(\"\ + {collection_name}\", {\n prefetch: {\n query: [0.2, 0.8, 0.1, 0.9],\n\ + \ limit: 50\n },\n query: {\n formula: {\n sum: [\n \ + \ \"$score\",\n {\n mult: [ 0.5, { key: \"tag\", match:\ + \ { any: [\"h1\", \"h2\", \"h3\", \"h4\"] }} ]\n },\n {\n\ + \ mult: [ 0.25, { key: \"tag\", match: { any: [\"p\", \"li\"\ + ] }} ]\n }\n ]\n }\n }\n});\n\n// Score boost geographically\ + \ closer points (as of 1.14.0)\nconst distance_boosted = await client.query(\"\ + {collection_name}\", {\n prefetch: {\n query: [0.2, 0.8, ...],\n \ + \ limit: 50\n },\n query: {\n formula: {\n sum: [\n \ + \ \"$score\",\n {\n gauss_decay: {\n x: {\n\ + \ geo_distance: {\n origin: { lat: 52.504043,\ + \ lon: 13.393236 }, // Berlin\n to: \"geo.location\"\n\ + \ }\n },\n scale: 5000 // 5km\n \ + \ }\n }\n ]\n },\n defaults: { \"geo.location\"\ + : { lat: 48.137154, lon: 11.576124 } } // Munich\n }\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.QueryFactory.fusion;\nimport static\ + \ io.qdrant.client.QueryFactory.nearest;\nimport static io.qdrant.client.QueryFactory.recommend;\n\ + import static io.qdrant.client.VectorInputFactory.vectorInput;\n\nimport\ + \ java.util.UUID;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + import io.qdrant.client.grpc.Points.Fusion;\nimport io.qdrant.client.grpc.Points.PrefetchQuery;\n\ + import io.qdrant.client.grpc.Points.QueryPoints;\nimport io.qdrant.client.grpc.Points.RecommendInput;\n\ + \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\n// Query nearest by ID\nclient\n\ + \ .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"\ + {collection_name}\")\n .setQuery(nearest(UUID.fromString(\"\ + 43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")))\n .build())\n \ + \ .get();\n\n// Recommend on the average of these vectors\nclient\n \ + \ .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"\ + {collection_name}\")\n .setQuery(\n recommend(\n\ + \ RecommendInput.newBuilder()\n \ + \ .addPositive(vectorInput(UUID.fromString(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\ + )))\n .addPositive(vectorInput(0.11f, 0.35f, 0.6f))\n\ + \ .addNegative(vectorInput(0.01f, 0.45f, 0.67f))\n\ + \ .build()))\n .build())\n .get();\n\ + \n// Fusion query\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n\ + \ .setCollectionName(\"{collection_name}\")\n .addPrefetch(\n\ + \ PrefetchQuery.newBuilder()\n .setQuery(nearest(List.of(0.22f,\ + \ 0.8f), List.of(1, 42)))\n .setUsing(\"sparse\")\n\ + \ .setLimit(20)\n .build())\n \ + \ .addPrefetch(\n PrefetchQuery.newBuilder()\n\ + \ .setQuery(nearest(List.of(0.01f, 0.45f, 0.67f)))\n\ + \ .setUsing(\"dense\")\n .setLimit(20)\n\ + \ .build())\n .setQuery(fusion(Fusion.RRF))\n\ + \ .build())\n .get();\n\n// 2-stage query\nclient\n .queryAsync(\n\ + \ QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\"\ + )\n .addPrefetch(\n PrefetchQuery.newBuilder()\n\ + \ .setQuery(nearest(0.01f, 0.45f, 0.67f))\n \ + \ .setLimit(100)\n .build())\n \ + \ .setQuery(\n nearest(\n new float[][]\ + \ {\n {0.1f, 0.2f},\n {0.2f,\ + \ 0.1f},\n {0.8f, 0.9f}\n }))\n\ + \ .setUsing(\"colbert\")\n .setLimit(10)\n \ + \ .build())\n .get();\n\n// Random sampling (as of 1.11.0)\n\ + client\n .queryAsync(\n QueryPoints.newBuilder()\n \ + \ .setCollectionName(\"{collection_name}\")\n .setQuery(sample(Sample.Random))\n\ + \ .build())\n .get();\n\n// Score boost depending on payload\ + \ conditions (as of 1.14.0)\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n\ + \ .setCollectionName(\"{collection_name}\")\n .addPrefetch(\n\ + \ PrefetchQuery.newBuilder()\n .setQuery(nearest(0.01f,\ + \ 0.45f, 0.67f))\n .setLimit(100)\n \ + \ .build())\n .setQuery(\n formula(\n \ + \ Formula.newBuilder()\n .setExpression(\n\ + \ sum(\n SumExpression.newBuilder()\n\ + \ .addSum(variable(\"$score\"))\n \ + \ .addSum(\n \ + \ mult(\n MultExpression.newBuilder()\n\ + \ .addMult(constant(0.5f))\n\ + \ .addMult(\n \ + \ condition(\n \ + \ matchKeywords(\n \ + \ \"tag\",\n \ + \ List.of(\"h1\",\ + \ \"h2\", \"h3\", \"h4\"))))\n \ + \ .build()))\n .addSum(mult(MultExpression.newBuilder()\n\ + \ .addMult(constant(0.25f))\n \ + \ .addMult(\n \ + \ condition(\n \ + \ matchKeywords(\n \"\ + tag\",\n List.of(\"p\"\ + , \"li\"))))\n .build()))\n \ + \ .build()))\n .build()))\n\ + \ .build())\n .get();\n\n// Score boost geographically closer\ + \ points (as of 1.14.0)\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n\ + \ .setCollectionName(\"{collection_name}\")\n .addPrefetch(\n\ + \ PrefetchQuery.newBuilder()\n .setQuery(nearest(0.01f,\ + \ 0.45f, 0.67f))\n .setLimit(100)\n \ + \ .build())\n .setQuery(\n formula(\n \ + \ Formula.newBuilder()\n .setExpression(\n\ + \ sum(\n SumExpression.newBuilder()\n\ + \ .addSum(variable(\"$score\"))\n \ + \ .addSum(\n \ + \ expDecay(\n \ + \ DecayParamsExpression.newBuilder()\n \ + \ .setX(\n \ + \ geoDistance(\n \ + \ GeoDistance.newBuilder()\n \ + \ .setOrigin(\n \ + \ GeoPoint.newBuilder()\n \ + \ .setLat(52.504043)\n\ + \ .setLon(13.393236)\n\ + \ .build())\n\ + \ .setTo(\"\ + geo.location\")\n \ + \ .build()))\n .setScale(5000)\n\ + \ .build()))\n \ + \ .build()))\n .putDefaults(\n\ + \ \"geo.location\",\n \ + \ value(\n Map.of(\n \ + \ \"lat\", value(48.137154),\n \ + \ \"lon\", value(11.576124))))\n \ + \ .build()))\n .build())\n .get();\n" + language: java /collections/{collection_name}/points/query/batch: post: description: Universally query points in batch. This endpoint covers all capabilities @@ -2031,16 +2031,6 @@ paths: tags: - Search x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.QueryFactory.nearest;\n\nimport java.util.List;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - import io.qdrant.client.grpc.Points.QueryPoints;\n\nQdrantClient client\ - \ =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334,\ - \ false).build());\n\nclient\n .queryBatchAsync(\n \"{collection_name}\"\ - ,\n List.of(\n QueryPoints.newBuilder().setQuery(nearest(0.1f,\ - \ 0.2f, 0.3f)).build(),\n QueryPoints.newBuilder().setQuery(nearest(0.4f,\ - \ 0.5f, 0.6f)).build()))\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc queryBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2062,12 +2052,12 @@ paths: \ { Query = new float[] { 0.4f, 0.5f, 0.6f }, }\n\t}\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.queryBatch(\"{collection_name\", {\n searches: [{\n query:\ - \ [0.01, 0.45, 0.67]\n },\n {\n query: [0.11, 0.35, 0.6]\n\ - \ }]\n});\n" - language: typescript + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nnearest = client.query_batch_points(\n \ + \ collection_name=\"{collection_name}\",\n requests=[\n models.QueryRequest(\n\ + \ query=[0.01, 0.45, 0.67, ...],\n ),\n models.QueryRequest(\n\ + \ query=[0.11, 0.35, 0.6, ...],\n ),\n ]\n)" + language: python - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query/batch'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -2087,12 +2077,22 @@ paths: \ client.query_batch(request).await?;" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nnearest = client.query_batch_points(\n \ - \ collection_name=\"{collection_name}\",\n requests=[\n models.QueryRequest(\n\ - \ query=[0.01, 0.45, 0.67, ...],\n ),\n models.QueryRequest(\n\ - \ query=[0.11, 0.35, 0.6, ...],\n ),\n ]\n)" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.queryBatch(\"{collection_name\", {\n searches: [{\n query:\ + \ [0.01, 0.45, 0.67]\n },\n {\n query: [0.11, 0.35, 0.6]\n\ + \ }]\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.QueryFactory.nearest;\n\nimport java.util.List;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + import io.qdrant.client.grpc.Points.QueryPoints;\n\nQdrantClient client\ + \ =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334,\ + \ false).build());\n\nclient\n .queryBatchAsync(\n \"{collection_name}\"\ + ,\n List.of(\n QueryPoints.newBuilder().setQuery(nearest(0.1f,\ + \ 0.2f, 0.3f)).build(),\n QueryPoints.newBuilder().setQuery(nearest(0.4f,\ + \ 0.5f, 0.6f)).build()))\n .get();\n" + language: java /collections/{collection_name}/points/query/groups: post: description: Universally query points and group results by a specified payload @@ -2102,16 +2102,6 @@ paths: tags: - Search x-fern-examples: - - code-samples: - - code: "import java.util.List;\n\nimport static io.qdrant.client.QueryFactory.nearest;\n\ - \nimport io.qdrant.client.grpc.Points.QueryPointGroups;\nimport io.qdrant.client.grpc.Points.QueryPoints;\n\ - \n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .queryGroupsAsync(\n\ - \ QueryPointGroups.newBuilder()\n .setCollectionName(\"\ - {collection_name}\")\n .setGroupBy(\"document_id\")\n \ - \ .setGroupSize(5)\n .setLimit(10)\n .setQuery(nearest(List.of(0.01f,\ - \ 0.45f, 0.67f)))\n .build())\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc queryGroups() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2130,12 +2120,11 @@ paths: \ new float[] {\n 0.01f, 0.45f, 0.67f\n }\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.queryGroups(\"{collection_name}\", {\n query: [0.01, 0.45, 0.67],\n\ - \ group_by: \"document_id\",\n limit: 10,\n group_size: 5,\n\ - });\n" - language: typescript + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.query_points_groups(\n collection_name=\"\ + {collection_name}\",\n query=[0.01, 0.45, 0.67],\n group_by=\"document_id\"\ + ,\n limit=10,\n group_size=5,\n)" + language: python - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query/groups'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -2151,11 +2140,22 @@ paths: \ .limit(10u64)\n .group_size(5u64)\n).await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.query_points_groups(\n collection_name=\"\ - {collection_name}\",\n query=[0.01, 0.45, 0.67],\n group_by=\"document_id\"\ - ,\n limit=10,\n group_size=5,\n)" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.queryGroups(\"{collection_name}\", {\n query: [0.01, 0.45, 0.67],\n\ + \ group_by: \"document_id\",\n limit: 10,\n group_size: 5,\n\ + });\n" + language: typescript + - code-samples: + - code: "import java.util.List;\n\nimport static io.qdrant.client.QueryFactory.nearest;\n\ + \nimport io.qdrant.client.grpc.Points.QueryPointGroups;\nimport io.qdrant.client.grpc.Points.QueryPoints;\n\ + \n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .queryGroupsAsync(\n\ + \ QueryPointGroups.newBuilder()\n .setCollectionName(\"\ + {collection_name}\")\n .setGroupBy(\"document_id\")\n \ + \ .setGroupSize(5)\n .setLimit(10)\n .setQuery(nearest(List.of(0.01f,\ + \ 0.45f, 0.67f)))\n .build())\n .get();\n" + language: java /collections/{collection_name}/points/recommend: {} /collections/{collection_name}/points/recommend/batch: {} /collections/{collection_name}/points/recommend/groups: {} @@ -2174,18 +2174,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\nimport\ - \ static io.qdrant.client.WithPayloadSelectorFactory.enable;\n\nimport\ - \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Common.Filter;\nimport io.qdrant.client.grpc.Points.ScrollPoints;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .scrollAsync(\n \ - \ ScrollPoints.newBuilder()\n .setCollectionName(\"{collection_name}\"\ - )\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"\ - color\", \"red\")).build())\n .setLimit(1)\n .setWithPayload(enable(true))\n\ - \ .build())\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc scroll() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2205,14 +2193,12 @@ paths: , \"red\"),\n limit: 1,\n payloadSelector: true\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "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: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/scroll'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -2232,12 +2218,26 @@ paths: \ .with_vectors(false),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.scroll(\n collection_name=\"{collection_name}\"\ - ,\n scroll_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"\ - color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n\ - \ limit=1,\n with_payload=True,\n with_vectors=False,\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.scroll(\"{collection_name}\", {\n filter: {\n must: [\n\ + \ {\n key: \"color\",\n match:\ + \ {\n value: \"red\",\n },\n \ + \ },\n ],\n },\n limit: 1,\n with_payload: true,\n\ + \ with_vector: false,\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\nimport\ + \ static io.qdrant.client.WithPayloadSelectorFactory.enable;\n\nimport\ + \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Common.Filter;\nimport io.qdrant.client.grpc.Points.ScrollPoints;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .scrollAsync(\n \ + \ ScrollPoints.newBuilder()\n .setCollectionName(\"{collection_name}\"\ + )\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"\ + color\", \"red\")).build())\n .setLimit(1)\n .setWithPayload(enable(true))\n\ + \ .build())\n .get();\n" + language: java /collections/{collection_name}/points/search: {} /collections/{collection_name}/points/search/batch: {} /collections/{collection_name}/points/search/groups: {} @@ -2250,18 +2250,6 @@ paths: tags: - Search x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ - import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - import io.qdrant.client.grpc.Common.Filter;\nimport io.qdrant.client.grpc.Points.SearchMatrixPoints;\n\ - \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .searchMatrixOffsetsAsync(\n\ - \ SearchMatrixPoints.newBuilder()\n .setCollectionName(\"\ - {collection_name}\")\n .setFilter(\n Filter.newBuilder()\n\ - \ .addMust(matchKeyword(\"color\", \"red\"))\n \ - \ .build()\n )\n .setSample(100)\n\ - \ .setLimit(5)\n .build())\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc searchMatiOffsets() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2281,14 +2269,13 @@ paths: ),\n sample: 100,\n limit: 5\n);" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.searchMatrixOffsets(\"{collection_name}\", {\n filter: {\n \ - \ must: [\n {\n key: \"color\",\n \ - \ match: {\n value: \"red\",\n \ - \ },\n },\n ],\n },\n sample: 100,\n \ - \ limit: 5,\n});\n" - language: typescript + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.search_matrix_offsets(\n collection_name=\"\ + {collection_name}\",\n sample=100,\n limit=5,\n query_filter=models.Filter(\n\ + \ must=[\n models.FieldCondition(\n key=\"\ + color\", match=models.MatchValue(value=\"red\")\n ),\n \ + \ ]\n ),\n)" + language: python - code-samples: - code: "use qdrant_client::qdrant::{Condition, SearchMatrixPointsBuilder,\ \ Filter};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"\ @@ -2299,33 +2286,34 @@ paths: \ .sample(100)\n .limit(5),\n )\n .await?;" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.search_matrix_offsets(\n collection_name=\"\ - {collection_name}\",\n sample=100,\n limit=5,\n query_filter=models.Filter(\n\ - \ must=[\n models.FieldCondition(\n key=\"\ - color\", match=models.MatchValue(value=\"red\")\n ),\n \ - \ ]\n ),\n)" - language: python - /collections/{collection_name}/points/search/matrix/pairs: - post: - description: Retrieves sparse matrix of pairwise distances between points sampled - from the collection. Output is a list of pairs of points and their distances. - summary: Distance matrix pairs - tags: - - Search - x-fern-examples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.searchMatrixOffsets(\"{collection_name}\", {\n filter: {\n \ + \ must: [\n {\n key: \"color\",\n \ + \ match: {\n value: \"red\",\n \ + \ },\n },\n ],\n },\n sample: 100,\n \ + \ limit: 5,\n});\n" + language: typescript - code-samples: - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ import io.qdrant.client.grpc.Common.Filter;\nimport io.qdrant.client.grpc.Points.SearchMatrixPoints;\n\ \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .searchMatrixPairsAsync(\n\ + localhost\", 6334, false).build());\n\nclient\n .searchMatrixOffsetsAsync(\n\ \ SearchMatrixPoints.newBuilder()\n .setCollectionName(\"\ {collection_name}\")\n .setFilter(\n Filter.newBuilder()\n\ \ .addMust(matchKeyword(\"color\", \"red\"))\n \ \ .build()\n )\n .setSample(100)\n\ \ .setLimit(5)\n .build())\n .get();\n" language: java + /collections/{collection_name}/points/search/matrix/pairs: + post: + description: Retrieves sparse matrix of pairwise distances between points sampled + from the collection. Output is a list of pairs of points and their distances. + summary: Distance matrix pairs + tags: + - Search + x-fern-examples: - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc searchMatixPairs() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2345,14 +2333,13 @@ paths: ),\n sample: 100,\n limit: 5\n);" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.searchMatrixPairs(\"{collection_name}\", {\n filter: {\n \ - \ must: [\n {\n key: \"color\",\n \ - \ match: {\n value: \"red\",\n \ - \ },\n },\n ],\n },\n sample: 100,\n limit:\ - \ 5,\n});" - language: typescript + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.search_matrix_pairs(\n collection_name=\"\ + {collection_name}\",\n sample=100,\n limit=5,\n query_filter=models.Filter(\n\ + \ must=[\n models.FieldCondition(\n key=\"\ + color\", match=models.MatchValue(value=\"red\")\n ),\n \ + \ ]\n ),\n)" + language: python - code-samples: - code: "use qdrant_client::qdrant::{Condition, SearchMatrixPointsBuilder,\ \ Filter};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"\ @@ -2363,13 +2350,26 @@ paths: \ .sample(100)\n .limit(5),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.search_matrix_pairs(\n collection_name=\"\ - {collection_name}\",\n sample=100,\n limit=5,\n query_filter=models.Filter(\n\ - \ must=[\n models.FieldCondition(\n key=\"\ - color\", match=models.MatchValue(value=\"red\")\n ),\n \ - \ ]\n ),\n)" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.searchMatrixPairs(\"{collection_name}\", {\n filter: {\n \ + \ must: [\n {\n key: \"color\",\n \ + \ match: {\n value: \"red\",\n \ + \ },\n },\n ],\n },\n sample: 100,\n limit:\ + \ 5,\n});" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ + import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + import io.qdrant.client.grpc.Common.Filter;\nimport io.qdrant.client.grpc.Points.SearchMatrixPoints;\n\ + \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .searchMatrixPairsAsync(\n\ + \ SearchMatrixPoints.newBuilder()\n .setCollectionName(\"\ + {collection_name}\")\n .setFilter(\n Filter.newBuilder()\n\ + \ .addMust(matchKeyword(\"color\", \"red\"))\n \ + \ .build()\n )\n .setSample(100)\n\ + \ .setLimit(5)\n .build())\n .get();\n" + language: java /collections/{collection_name}/points/vectors: put: description: Updates specified vectors on points. All other unspecified vectors @@ -2378,22 +2378,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ - \ io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\ - \nimport java.util.List;\nimport java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\n\ - import io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new\ - \ QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\"\ - , 6334, false).build());\n\nclient\n .updateVectorsAsync(\n \ - \ \"{collection_name}\",\n List.of(\n PointVectors.newBuilder()\n\ - \ .setId(id(1))\n .setVectors(namedVectors(Map.of(\"\ - image\", vector(List.of(0.1f, 0.2f, 0.3f, 0.4f)))))\n .build(),\n\ - \ PointVectors.newBuilder()\n .setId(id(2))\n\ - \ .setVectors(\n namedVectors(\n \ - \ Map.of(\n \"text\", vector(List.of(0.9f,\ - \ 0.8f, 0.7f, 0.6f, 0.5f, 0.4f, 0.3f, 0.2f)))))\n .build()))\n\ - \ .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc updateVectors() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2418,15 +2402,15 @@ paths: \ }\n }\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - 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: "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: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points/vectors?wait=true'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -2455,15 +2439,31 @@ paths: \ .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.update_vectors(\n collection_name=\"\ - {collection_name}\",\n points=[\n models.PointVectors(\n \ - \ id=1,\n vector={\n \"image\": [0.1,\ - \ 0.2, 0.3, 0.4],\n },\n ),\n models.PointVectors(\n\ - \ id=2,\n vector={\n \"text\": [0.9,\ - \ 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n ),\n \ - \ ],\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.updateVectors(\"{collection_name}\", {\n points: [\n \ + \ {\n id: 1,\n vector: {\n image:\ + \ [0.1, 0.2, 0.3, 0.4],\n },\n },\n {\n \ + \ id: 2,\n vector: {\n text: [0.9, 0.8,\ + \ 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n },\n ],\n\ + });\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ + \ io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\ + \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: description: Deletes specified vectors from points. All other unspecified vectors @@ -2472,14 +2472,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .deleteVectorsAsync(\n\ - \ \"{collection_name}\", List.of(\"text\", \"image\"), List.of(id(0),\ - \ id(3), id(10)))\n .get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc deleteVectors() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2504,11 +2496,11 @@ paths: ' language: csharp - 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: "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: "# Delete vectors by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/vectors/delete'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -2532,11 +2524,19 @@ paths: \ })\n .wait(true),\n )\n .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.delete_vectors(\n collection_name=\"\ - {collection_name}\",\n points=[0, 3, 100],\n vectors=[\"text\",\ - \ \"image\"],\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.deleteVectors(\"{collection_name}\", {\n points: [0, 3, 10],\n\ + \ vectors: [\"text\", \"image\"],\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \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}/points/{id}: get: description: Retrieves all details from a single point. @@ -2550,17 +2550,6 @@ paths: tags: - Distributed x-fern-examples: - - code-samples: - - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport\ - \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Collections.CreateShardKey;\nimport io.qdrant.client.grpc.Collections.CreateShardKeyRequest;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.createShardKeyAsync(CreateShardKeyRequest.newBuilder()\n\ - \ .setCollectionName(\"{collection_name}\")\n \ - \ .setRequest(CreateShardKey.newBuilder()\n \ - \ .setShardKey(shardKey(\"{shard_key}\"))\n \ - \ .build())\n .build()).get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc createShardKey() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2576,11 +2565,16 @@ paths: \ { Keyword = \"{shard_key}\", } }\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n\ - });\n\nclient.createShardKey(\"{collection_name}\", {\n shard_key:\ - \ \"{shard_key}\"\n});\n" - language: typescript + - code: 'from qdrant_client import QdrantClient + + + client = QdrantClient(url="http://localhost:6333") + + + client.create_shard_key("{collection_name}", "{shard_key}") + + ' + language: python - code-samples: - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/shards'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -2594,37 +2588,32 @@ paths: \ .create_shard_key(\n CreateShardKeyRequestBuilder::new(\"\ {collection_name}\").request(\n CreateShardKeyBuilder::default()\n\ \ .shard_key(Key::Keyword(\"{shard_key}\".to_string())),\n\ - \ ),\n )\n .await?;\n" - language: rust - - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.create_shard_key("{collection_name}", "{shard_key}") - - ' - language: python - /collections/{collection_name}/shards/delete: - post: - description: Deletes one or more shard keys for a specified collection. - summary: Delete a shard key - tags: - - Distributed - x-fern-examples: + \ ),\n )\n .await?;\n" + language: rust + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n\ + });\n\nclient.createShardKey(\"{collection_name}\", {\n shard_key:\ + \ \"{shard_key}\"\n});\n" + language: typescript - code-samples: - code: "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\ + \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.deleteShardKeyAsync(DeleteShardKeyRequest.newBuilder()\n\ + localhost\", 6334, false).build());\n\nclient.createShardKeyAsync(CreateShardKeyRequest.newBuilder()\n\ \ .setCollectionName(\"{collection_name}\")\n \ - \ .setRequest(DeleteShardKey.newBuilder()\n \ + \ .setRequest(CreateShardKey.newBuilder()\n \ \ .setShardKey(shardKey(\"{shard_key}\"))\n \ \ .build())\n .build()).get();\n" language: java + /collections/{collection_name}/shards/delete: + post: + description: Deletes one or more shard keys for a specified collection. + summary: Delete a shard key + tags: + - Distributed + x-fern-examples: - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc deleteShardKey() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2640,11 +2629,16 @@ paths: \ { Keyword = \"shard_key\", } }\n);\n" language: csharp - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n\ - });\n\nclient.deleteShardKey(\"{collection_name}\", {\n shard_key:\ - \ \"{shard_key}\"\n});\n" - language: typescript + - 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: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/shards/delete'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -2659,16 +2653,22 @@ paths: \ )\n .await?;\n" language: rust - code-samples: - - code: 'from qdrant_client import QdrantClient - - - client = QdrantClient(url="http://localhost:6333") - - - client.delete_shard_key("{collection_name}", "{shard_key}") - - ' - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n\ + });\n\nclient.deleteShardKey(\"{collection_name}\", {\n shard_key:\ + \ \"{shard_key}\"\n});\n" + language: typescript + - code-samples: + - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport\ + \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Collections.DeleteShardKey;\nimport io.qdrant.client.grpc.Collections.DeleteShardKeyRequest;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.deleteShardKeyAsync(DeleteShardKeyRequest.newBuilder()\n\ + \ .setCollectionName(\"{collection_name}\")\n \ + \ .setRequest(DeleteShardKey.newBuilder()\n \ + \ .setShardKey(shardKey(\"{shard_key}\"))\n \ + \ .build())\n .build()).get();\n" + language: java /collections/{collection_name}/shards/{shard_id}/snapshots: get: description: Returns a list of all snapshots for a shard from a collection. @@ -2713,12 +2713,6 @@ paths: tags: - Snapshots x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.listSnapshotAsync(\"{collection_name}\"\ - ).get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc listSnapshots() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2739,16 +2733,16 @@ paths: ' language: csharp - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'from qdrant_client import QdrantClient - const client = new QdrantClient({ host: "localhost", port: 6333 }); + client = QdrantClient(url="http://localhost:6333") - client.listSnapshots("{collection_name}"); + client.list_snapshots(collection_name="{collection_name}") ' - language: typescript + language: python - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/snapshots'\ \ \\\n --header 'api-key: '" @@ -2765,28 +2759,28 @@ paths: ' language: rust - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.list_snapshots(collection_name="{collection_name}") + client.listSnapshots("{collection_name}"); ' - language: python + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.listSnapshotAsync(\"{collection_name}\"\ + ).get();\n" + language: java post: description: Creates a new snapshot for a specified collection. summary: Create a snapshot (collection) tags: - Snapshots x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.createSnapshotAsync(\"{collection_name}\"\ - ).get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc createSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2807,16 +2801,16 @@ paths: ' language: csharp - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'from qdrant_client import QdrantClient - const client = new QdrantClient({ host: "localhost", port: 6333 }); + client = QdrantClient(url="http://localhost:6333") - client.createSnapshot("{collection_name}"); + client.create_snapshot(collection_name="{collection_name}") ' - language: typescript + language: python - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/snapshots'\ \ \\\n --header 'api-key: '" @@ -2833,16 +2827,22 @@ paths: ' language: rust - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.create_snapshot(collection_name="{collection_name}") + client.createSnapshot("{collection_name}"); ' - language: python + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.createSnapshotAsync(\"{collection_name}\"\ + ).get();\n" + language: java /collections/{collection_name}/snapshots/recover: put: description: Recovers local collection data from a snapshot. This will overwrite @@ -2853,11 +2853,10 @@ paths: - Snapshots 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: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.recover_snapshot(\n \"{collection_name}\"\ + ,\n \"http://example.com/path/to/snapshot.shapshot\",\n)\n" + language: python - code-samples: - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/snapshots/recover'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -2865,10 +2864,11 @@ paths: \n}'" language: curl - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.recover_snapshot(\n \"{collection_name}\"\ - ,\n \"http://example.com/path/to/snapshot.shapshot\",\n)\n" - language: python + - code: "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 /collections/{collection_name}/snapshots/upload: post: description: Recovers local collection data from an uploaded snapshot. This @@ -2889,12 +2889,6 @@ paths: tags: - Snapshots x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.deleteSnapshotAsync(\"{collection_name}\"\ - , \"{snapshot_name}\").get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc deleteSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2915,16 +2909,10 @@ paths: ' language: csharp - 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: "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: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/snapshots/snapshot_name'\ \ \\\n --header 'api-key: '" @@ -2937,10 +2925,22 @@ paths: \ .await?;\n" language: rust - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.delete_snapshot(\n collection_name=\"\ - {collection_name}\", snapshot_name=\"{snapshot_name}\"\n)\n" - language: python + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.deleteSnapshot("{collection_name}", "{snapshot_name}"); + + ' + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.deleteSnapshotAsync(\"{collection_name}\"\ + , \"{snapshot_name}\").get();\n" + language: java get: description: Downloads the specified snapshot file from a collection. summary: Download a snapshot (collection) @@ -2990,11 +2990,6 @@ paths: tags: - Snapshots x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.listFullSnapshotAsync().get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc listFullSnapshots() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -3015,16 +3010,16 @@ paths: ' language: csharp - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'from qdrant_client import QdrantClient - const client = new QdrantClient({ host: "localhost", port: 6333 }); + client = QdrantClient(url="http://localhost:6333") - client.listFullSnapshots(); + client.list_full_snapshots() ' - language: typescript + language: python - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/snapshots' \\\n --header\ \ 'api-key: '" @@ -3041,27 +3036,27 @@ paths: ' language: rust - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.list_full_snapshots() + client.listFullSnapshots(); ' - language: python + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.listFullSnapshotAsync().get();\n" + language: java post: description: Creates a new snapshot of the entire storage. summary: Create a snapshot (storage) tags: - Snapshots x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.createFullSnapshotAsync().get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc createFullSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -3082,16 +3077,16 @@ paths: ' language: csharp - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'from qdrant_client import QdrantClient - const client = new QdrantClient({ host: "localhost", port: 6333 }); + client = QdrantClient(url="http://localhost:6333") - client.createFullSnapshot(); + client.create_full_snapshot() ' - language: typescript + language: python - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/snapshots' \\\n --header\ \ 'api-key: '" @@ -3108,16 +3103,21 @@ paths: ' language: rust - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.create_full_snapshot() + client.createFullSnapshot(); ' - language: python + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.createFullSnapshotAsync().get();\n" + language: java /snapshots/{snapshot_name}: delete: description: Deletes the specified snapshot of the entire storage. @@ -3125,12 +3125,6 @@ paths: tags: - Snapshots x-fern-examples: - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.deleteFullSnapshotAsync(\"\ - {snapshot_name}\").get();\n" - language: java - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc deleteFullSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -3150,16 +3144,16 @@ paths: ' language: csharp - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'from qdrant_client import QdrantClient - const client = new QdrantClient({ host: "localhost", port: 6333 }); + client = QdrantClient(url="http://localhost:6333") - client.deleteFullSnapshot("{snapshot_name}"); + client.delete_full_snapshot(snapshot_name="{snapshot_name}") ' - language: typescript + language: python - code-samples: - code: "curl -X DELETE \\\n 'http://localhost:6333/snapshots/snapshot_name'\ \ \\\n --header 'api-key: '" @@ -3176,16 +3170,22 @@ paths: ' language: rust - code-samples: - - code: 'from qdrant_client import QdrantClient + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; - client = QdrantClient(url="http://localhost:6333") + const client = new QdrantClient({ host: "localhost", port: 6333 }); - client.delete_full_snapshot(snapshot_name="{snapshot_name}") + client.deleteFullSnapshot("{snapshot_name}"); ' - language: python + language: typescript + - code-samples: + - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.deleteFullSnapshotAsync(\"\ + {snapshot_name}\").get();\n" + language: java get: description: Downloads the specified snapshot of the entire storage as a file. summary: Download a snapshot (storage) diff --git a/fern/pages/api-summary.mdx b/fern/pages/api-summary.mdx index ca3b68c..88a4b63 100644 --- a/fern/pages/api-summary.mdx +++ b/fern/pages/api-summary.mdx @@ -4,7 +4,7 @@ Qdrant is a [vector database](https://qdrant.tech/documentation/overview/) and a 1. First, you should create a [collection](/api-reference/collections/create-collection) to store all your data. 2. Then upsert data [points](/api-reference/points/upsert-points) and enrich them with a custom [payload](/api-reference/points/set-payload). -3. With a full collection, run a [search](/api-reference/search/points) to find relevant results. +3. With a full collection, run a [search](/api-reference/search/query-points) to find relevant results. 4. Collections can be [snapshotted, downloaded and restored](/api-reference/snapshots/list-snapshots). 5. When ready, setup a [distributed system](/api-reference/distributed/create-shard-key) for production.