From 5373dff183984e42e885ee981a796644f4522d1e Mon Sep 17 00:00:00 2001 From: trean Date: Mon, 14 Jul 2025 14:59:57 +0200 Subject: [PATCH 1/2] new logo --- fern/assets/favicon.ico | Bin 15086 -> 15086 bytes fern/assets/logo-dark.svg | 162 +++++++++++--------------------------- fern/assets/logo.svg | 74 +++++++++++------ 3 files changed, 96 insertions(+), 140 deletions(-) diff --git a/fern/assets/favicon.ico b/fern/assets/favicon.ico index 9dd3c0ae589523103e1dc237d6d14259e72659ca..a9e7e524f3eeb70dc96b3f1c64ea7ed24dffd947 100644 GIT binary patch literal 15086 zcmeHOONbmr7_QkCRs@;&KnRGlJF{v~gv1xV$Ovk(k4eNw$Uy}$pbp>$hGe#M?kv1ssrwXOURG z+`oy@>P=IH^7lwzP30@l@Y47_nwwuSSt#!+ja3{qp$+dooUdk0S}|3q++l*3E{-!) z%2&3+-ltT()jaA>LbvCIaE5|pZxW6LycW_&kK`-Y1>vPx4tw7R`~ITp8kQ$6X>>YJ ze@TlroSht-dwqOtZdixgYuV&TEeBn`l=9+2=(k&^gP#xZj!xz)kLz%gl$BN()=Fx`NP}fj-rEP!CZOE`y8K!yA z{fjgU-*m0i+Yea>o9`hm`KGNu_#QOXSH%O}{y2WEZKwVJxBk%kD8|KRznx9LOZn;p zI$YH@{yc50qhXn;{egE5K4}~5nEJXNwtlfKz32~G?yEkdPYtqxEHCBeS7Cg7%f!4a zkAnTwA7ka-DEaHI|NUyTaW~Qh+4sz|Y~wYju8g8*y`65q)zcOm0`5i(4z|Y|+p0qq9G3`azd&u(RnmY5i?j ze*Kg0>2&*tf&Rh$uOB}H`>S(cFn$K($J~D|J--abPu%fyX|G@O9hdU{q2v25{{0)y zEBAEt)#rNMKQk^GHvh3_O1%FBZ42j-Py2CxAy4T3Ic4-qf5{gz&Oz3jX`CO6x%ta^ z79~%~KMVpdvHksg!D}A(EKlf1QgrFmSa}n8)ct(JzQgo~O@9od4XOiAdm>-GEm~s_ zgSepiA&6gCIdu$@BjYk*^g(sdCwBZQh*wZK?X-TRc5{&avYcZAxT(eu8B+w$uJ~b) zp8j&sRpB=tllqxL&@p~{*3ZxA8!=n-^*HF)<7}*r-$wDF>|XDW=-22o!7J3SMd=c! zp0d#PkJG%rgAG%^ztFV_x*wn{(=iecFWvhiRe#v~*wkqCsd)M%!%pk|j{3vi=aF`j zXEJS)Q@Qu2h4Mbtjtu0cAK==;>}uhY>e2^VJw_f9WhESwDL1J)sC75aW4 ziR3hC7-NQ>?;-so+rd1`OykdK>XVe$xQG;rJE)Z5T*LkM6w&_olkDKgXiu8ZNi2XjpiZf~)^PDzB;LeYiU zM%FFQLN3d*kn2K^Zyhgg()pHrrJP3A{QJ-hQ_X9Vd%q<*~9YQMw!2IK#0jHP9J zhsC#2@Qb@3cR`tl3oO&UqXOPW)VC zH<7R04;!1mV^ZFUN%0-up?NJkxvhUgVS3FPm{Zl)n$%jPAkHlaF_x zh4M>~8|xlBE%_YNVdGP+OKtos_8-U}*k2uEVflWHKkg~uUzVvjZeAJx(hs%IK}+7@&?o86LA}g>=u``eL!0>Dpg6Q~``c?E@MEn%T&qa4 z#GV~~X7*RsVDRG`FN1fC+R>7c)0jkt9yRI0V+k?=a80;t+UWf0w!rLPXauD2{-& z8*xbY&G0_({F!eUx(K-rd+|*D|3l>~A4>YRuRSB_F`w6ZJe9W~@LiZI6KF??ehl@q zKKef;J?hTLxs5#Uke0m12d_JQ^o#N(J>X&ZBlkUg&^ihnH-1hUzkJrYGV;|Ik?)Gb zOrgv`zDJKY_p&__!v1@fjb5Wa_gDthb-|33xGSl6*f z`84(6k7E(_-Ekm{nV@x$xJ&(T#Q6302a)l3&L8O6b37b68u_sWM64QD31K5mBkkBN e#LOBY-a%eXGoz^60USixY`n^DAkMph8T=o?U=`N@ literal 15086 zcmdU02T+w)7Jf<+cgKk)yPHXN;w~UXK~WSGbyZwqqJkhIim@RaeL21xDGr!-PY*qnSD&bO#9z()ADvsCii^CSRT0LXJ>U_W}l9h+DqvF zEw~#3D<0=0KPXT97cFt>Lo@75o`C;)05z@p2i|Rfp+Jh0>7AFOEsmm$MJ@7|0JDL= zsFu?26L9_nmO%)`Yz1@& z_5jZTfw!1y;ZOd3jLEBq*W2NyrL`h&G1bCf)FTr*v~7+K;P@r51h_BqRZex_k2)`{ ztM^9mF983Ko5CL)KL$L3AA#Qhg*unN7x*XDjbE|ugj81l?~FfqeF!)JDL@UNk+=Bn zNp2FAgMX-Ce~f<@{@}uW+!ELZ`~oz{`*BVZJ;_a^qPTSWVa_%3vfW72dJP2sj)2KK ztAB9)99RI{)`d6cVcvJrQt5a^0nHs;MH8%E(g^eW?66m|0 zlc0k+Qcu0}2Uj~F4tS{xZ|*CM%ll7Lq~|4aw=ALI#+Bq|{(#0>*7Fx_%W%`%Z|*C_@oBUxpnxX!DxzUVW#rVcoLn$}YUa=L6t@NRFfBq_ zKW~ZGI@o`;_EX0HR73ok_uW$|6u&Z;{2Xoy92~*hsUvK8$1)xGt8x~(bJ|k;xt~;L zCQ;7zOj_)Al}2WBkePa`IXCy z_bpNX53`amJ}=WyqY82|QO~2U{!Q+Xt7$b&ws}gcCtfF?zI({U>__N(M@46mvwYf8 z{KLooNW+X(>s^%Xgud@+R8Aw!Z&R>q5#?;lr;>QAABOiM@17%QjOBjV9v-u|wd&DQ z{FiFs&u!ue{?i8Dq+=2J!W{NAPr81P?q7_sAL)uY%ZEmFPLuIhUl+dz|8YHwY5S}K zx)pa)n1iMBg7W@_*A5-Yw|6hhYa!%nUI0B*b$HkOx$a|v&VjddE)(sq=Jm6Qu>SY7 z_6PqmmA>?@`E&n2iazr+FHvEgp_#v_Z2vMD-1WEq*EWB#{n6I{k1lNrfBmlC^v^#< z*uRGj?@NBYdF?Fh--Wa#_AmP5pDgsFJ1Ga~(#}yWi7kd6m=(%gS8 zd2j5GN4Fca%>5`OhAst1&HQulE;%fWqQ)JfZ@XVrvHfg|e-HcbWWwvZ3Yy&eB5m~A zjs6}?%vEd$zCOKT5pDI^N#1>V-UUzO7uQbmX-n~MX#FN~axpKZ8G~|YkN+mhhzz34 zs0FldPBhK_Dg%3l5{`=h4rVVdK2Yy>WI2^ zv%EzMol+>+C6U~_6bjGe^JuzuG^wNs)`!WzpJkoBmE+DjHH!b;w8Qk%-e`&sjTE?y zY6KUtU+Ju~MG*x#rqZFnUE2-*0nABQ|1g|WDNF>RT$i@xh~Uh7zt=c#-xwvA`6OSEC~UOK5X z=Iib4e2QN@mDYHCMRWRhW5 zb?GCb4m>_Qtgcgp`!PxgjSy^ZwwgJwUe*G%O8_05JCRnn_RpPWW2n}Dp1(fC4!lpG z+)J^nwp3_m$UPDiC5%-!^k3#C@>EV)N7v596gcD*9SmG8w6C`LLP_>3^r@34BW4Y< z;EkB%w^1*G12Af1hwP7lVL%4J{kI`K*e2%#Zh+q7=}lDxTs{G&0XG5e&+7Cj!}B>ni=Ss`h8~9C zw-TrZL>->sdOe`_{6 zwK+w-7;=hwvgfo8IR?_}XYHkFjiEHH4day0X&C{7fVy*9ILoDvKlqgR9M-^F$M<9| z9Wfvu=dcE252etLutqgNOvBE_?59L;o6%SO`~GbV^8BH>@*&#@h{T?zx-4-&g*w{t z-r+I69SxX{v5aj6*``1g{P0A8 zpF|v?c)ZohozS}k@`W=va`I()Odml00^mbk>H@Ob0FFQ=pm2^!jeLT9>=Wu^Vrt|w zkE_6+w8@98)_^q-1H1rK{rE}yaE_!G>RD5d0~I2UwavePCiE;NH?v1HuImfgIgHy#uLyPT(Pby( z*2fZcl+R~Fa+T%sz4Yu#iV(}0W`C0$jmyZn<85;9^bqo-@};`+{uKK;(_%sIM(WS! zuL|VlbF5A{d$J{q7Pwr)-ccHt=Xk1%iA=sse^HjYR7d?43(EAr^x=~SvnmX3eF-j?wDPeBYg6>YB=yVI9^KHIQp z#q5hTh=NSL`sTYOu!2Ohcf%Wq1<4@zQ znl%1(k{|7JQ8?Emm7gNW=QwyCp6Q}xJmY3SNUB3 zRq00%N85-v+G52xn$JjDG}wwJbZeRV=l&Pyc!5qwt%lDe0PFvHpGo#=_=wg7(xHHP z^j+^`3id!>{aQ=D>b0_T$ZR$fB6p8))C$Xqq$ljD{Ep&k2Pz#l{8wL*cBc!umtL{iQzkV|0G! z_lOH5lP2FM`$I<|mNCk*P~fC&clrHD_(T^BOQDUECQ^`tg0EafKI9fuXT($Sv0e1< z&Eb@d_O0_>BJQK?yHu7Z-itm>-vN2_!;CF-CX#)c^C=;CI<5QmYnnU2g4e4G@}K6V zwJnQ}$-THE5_u7el=E?G@;!?3#8mW2PO`mB(Vj8zNrou+B>B7SJ3k!YNh{q3UId4_ z-2naPQ7eq6L3p2r{opG=+}{eR=sV;%B>N6Mx?NZBM{`||>3T!(DaMB^)8Vof?2m7kIec5lFuHA3_5M?3(BTe$uJx6}_W3iu={jKbG zRm+3>hq`xo#(u1WKrcY0uGPs@_Y7s*0PHtq|EVs1s5i)$2e<;w-tUQ=@U2e)_JguN zRHbj=8P`K8FdO)@SWe$5zHJ0>d&>KP9^*b5cqhMvf*kha3=&DhFuu=roG_0V7CRkEZAKER|Weict9Ef zb$$vRHNm{WehB-*W4p7Ly8I*8*Y@uYuAR<(iQjsKjI&x-f!_tJ!@8scKCSYHvc|wF z*!_oPiLn&o*bD0@^M~#hao17)^|xKuW6m<+-&!Th@0C%8{Q!QzE$kC&d0%!Z_5=lf z~fVnZBL;5Eda5t2Fh=keo;8HJHfV?5+d{H=8^prJZu0>w)Vz; z_&my2YL&my_W}(u#Cpo<8qP4JQdvSQ{5ZW)|7OB(#5B}j9e=TW0Lque^LemHtV1VY z9oi4;e_ns7t$(3Bx7S7)|8YGE>HFz>aRy}}=IKR#P<6F zedR`VW*qIBlZM}JASR1_@Cfq~oB_!c&Vle;#Lq@{E~U8+t0`chFxSh}{1IX-$)Eb*MrvB - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fern/assets/logo.svg b/fern/assets/logo.svg index 82fb8b3..7c95d5e 100644 --- a/fern/assets/logo.svg +++ b/fern/assets/logo.svg @@ -1,27 +1,49 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From d9c7f7f014aec80f25e3250e54b2a140323a5f4d Mon Sep 17 00:00:00 2001 From: trean <7085263+trean@users.noreply.github.com> Date: Mon, 14 Jul 2025 13:02:00 +0000 Subject: [PATCH 2/2] Sync OpenAPI --- fern/apis/master/openapi-overrides.yml | 1140 ++++---- fern/apis/master/openapi.json | 59 +- fern/apis/v1.14.x/openapi-overrides.yml | 3142 +++++++++++------------ 3 files changed, 2196 insertions(+), 2145 deletions(-) diff --git a/fern/apis/master/openapi-overrides.yml b/fern/apis/master/openapi-overrides.yml index a993fd4..42cbb9e 100644 --- a/fern/apis/master/openapi-overrides.yml +++ b/fern/apis/master/openapi-overrides.yml @@ -10,17 +10,6 @@ paths: /aliases: get: x-fern-examples: - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ListAliasesAsync(); - -' - language: csharp - code-samples: - code: 'use qdrant_client::Qdrant; @@ -32,9 +21,6 @@ paths: ' language: rust - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/aliases' \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'from qdrant_client import QdrantClient @@ -47,11 +33,8 @@ paths: ' language: python - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listAliasesAsync().get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc listAliases() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\taliases, err := client.ListAliases(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Aliases: \", aliases)\n}\n" - language: go + - code: "curl -X GET \\\n 'http://localhost:6333/aliases' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -63,13 +46,12 @@ paths: ' language: typescript - description: Retrieves a list of all existing aliases. - summary: List all aliases - tags: - - Aliases - /collections: - get: - 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 listAliases() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\taliases, err := client.ListAliases(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Aliases: \", aliases)\n}\n" + language: go + - code-samples: + - code: "import 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: 'using Qdrant.Client; @@ -77,10 +59,17 @@ paths: var client = new QdrantClient("localhost", 6334); - await client.ListCollectionsAsync(); + await client.ListAliasesAsync(); ' language: csharp + description: Retrieves a list of all existing aliases. + summary: List all aliases + tags: + - Aliases + /collections: + get: + x-fern-examples: - code-samples: - code: 'use qdrant_client::Qdrant; @@ -92,9 +81,6 @@ paths: ' language: rust - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections' \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'from qdrant_client import QdrantClient @@ -107,11 +93,8 @@ paths: ' language: python - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listCollectionsAsync().get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc listCollections() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tcollections, err := client.ListCollections(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Collections: \", collections)\n}\n" - language: go + - code: "curl -X GET \\\n 'http://localhost:6333/collections' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -123,13 +106,12 @@ paths: ' language: typescript - description: Returns a list of all existing collections. - summary: List all collections - tags: - - Collections - /collections/aliases: - post: - x-fern-examples: + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc listCollections() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tcollections, err := client.ListCollections(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Collections: \", collections)\n}\n" + language: go + - code-samples: + - code: "import 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: 'using Qdrant.Client; @@ -137,38 +119,35 @@ paths: var client = new QdrantClient("localhost", 6334); - await client.CreateAliasAsync(aliasName: "production_collection", collectionName: "example_collection"); - - - await client.DeleteAliasAsync("production_collection"); + await client.ListCollectionsAsync(); ' language: csharp + description: Returns a list of all existing collections. + summary: List all collections + tags: + - Collections + /collections/aliases: + post: + x-fern-examples: - code-samples: - code: "use qdrant_client::qdrant::{CreateAliasBuilder, DeleteAlias};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .create_alias(CreateAliasBuilder::new(\n \"example_collection\",\n \"production_collection\",\n ))\n .await?;\n\nclient\n .delete_alias(DeleteAlias {\n alias_name: \"production_collection\".to_string(),\n })\n .await?;\n" language: rust - - code-samples: - - code: "# Create an alias\ncurl -X POST \\\n 'http://localhost:6333/collections/aliases' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"actions\": [\n {\n \"create_alias\": {\n \"collection_name\": \"{collection_name}\",\n \"alias_name\": \"{alias_name}\"\n }\n }\n ]\n}'\n\n# Delete an alias\ncurl -X POST \\\n 'http://localhost:6333/collections/aliases' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"actions\": [\n {\n \"delete_alias\": {\n \"alias_name\": \"{alias_name}\"\n }\n }\n ]\n}'\n\n# Rename an alias\ncurl -X POST \\\n 'http://localhost:6333/collections/aliases' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"actions\": [\n {\n \"rename_alias\": {\n \"old_alias_name\": \"{old_alias_name}\",\n \"new_alias_name\": \"{new_alias_name}\"\n }\n }\n ]\n}'\n" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.update_collection_aliases(\n change_aliases_operations=[\n models.CreateAliasOperation(\n create_alias=models.CreateAlias(\n collection_name=\"example_collection\", alias_name=\"production_collection\"\n )\n )\n ]\n)\n\nclient.update_collection_aliases(\n change_aliases_operations=[\n models.DeleteAliasOperation(\n delete_alias=models.DeleteAlias(alias_name=\"production_collection\")\n ),\n ]\n)\n" language: python - code-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: "# Create an alias\ncurl -X POST \\\n 'http://localhost:6333/collections/aliases' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"actions\": [\n {\n \"create_alias\": {\n \"collection_name\": \"{collection_name}\",\n \"alias_name\": \"{alias_name}\"\n }\n }\n ]\n}'\n\n# Delete an alias\ncurl -X POST \\\n 'http://localhost:6333/collections/aliases' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"actions\": [\n {\n \"delete_alias\": {\n \"alias_name\": \"{alias_name}\"\n }\n }\n ]\n}'\n\n# Rename an alias\ncurl -X POST \\\n 'http://localhost:6333/collections/aliases' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"actions\": [\n {\n \"rename_alias\": {\n \"old_alias_name\": \"{old_alias_name}\",\n \"new_alias_name\": \"{new_alias_name}\"\n }\n }\n ]\n}'\n" + language: curl + - code-samples: + - code: "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: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc updateAlias() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.CreateAlias(context.Background(), \"production_collection\", \"example_collection\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteAlias(context.Background(), \"production_collection\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.RenameAlias(context.Background(), \"production_collection\", \"legacy_collection\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.updateCollectionAliases({\n actions: [\n {\n create_alias: {\n collection_name: \"example_collection\",\n alias_name: \"production_collection\",\n },\n },\n ],\n});\n\nclient.updateCollectionAliases({\n actions: [\n {\n delete_alias: {\n alias_name: \"production_collection\",\n },\n },\n ],\n});\n" - language: typescript - description: Updates aliases for the specified collections. - summary: Update collection aliases - tags: - - Aliases - /collections/{collection_name}: - delete: - x-fern-examples: + - 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: 'using Qdrant.Client; @@ -176,10 +155,20 @@ paths: var client = new QdrantClient("localhost", 6334); - await client.DeleteCollectionAsync("{collection_name}"); + await client.CreateAliasAsync(aliasName: "production_collection", collectionName: "example_collection"); + + + await client.DeleteAliasAsync("production_collection"); ' language: csharp + description: Updates aliases for the specified collections. + summary: Update collection aliases + tags: + - Aliases + /collections/{collection_name}: + delete: + x-fern-examples: - code-samples: - code: 'use qdrant_client::Qdrant; @@ -191,9 +180,6 @@ paths: ' language: rust - - code-samples: - - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'from qdrant_client import QdrantClient @@ -206,11 +192,8 @@ paths: ' language: python - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteCollectionAsync(\"{collection_name}\").get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteCollection(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go + - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'import { QdrantClient } from ''@qdrant/qdrant-js''; @@ -222,12 +205,12 @@ paths: ' language: typescript - description: Drops the specified collection and all associated data in it. - summary: Delete a collection - tags: - - Collections - get: - x-fern-examples: + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteCollection(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go + - code-samples: + - code: "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: 'using Qdrant.Client; @@ -235,10 +218,16 @@ paths: var client = new QdrantClient("localhost", 6334); - await client.GetCollectionInfoAsync("{collection_name}"); + await client.DeleteCollectionAsync("{collection_name}"); ' language: csharp + description: Drops the specified collection and all associated data in it. + summary: Delete a collection + tags: + - Collections + get: + x-fern-examples: - code-samples: - code: 'use qdrant_client::Qdrant; @@ -250,9 +239,6 @@ paths: ' language: rust - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'from qdrant_client import QdrantClient @@ -265,11 +251,8 @@ paths: ' language: python - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.getCollectionInfoAsync(\"{collection_name}\").get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc getCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tinfo, err := client.GetCollectionInfo(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Collection info: \", info)\n}\n" - language: go + - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -281,60 +264,77 @@ paths: ' language: typescript + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc getCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tinfo, err := client.GetCollectionInfo(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Collection info: \", info)\n}\n" + language: go + - code-samples: + - code: "import 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: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.GetCollectionInfoAsync("{collection_name}"); + +' + language: csharp description: Retrieves parameters from the specified collection. summary: Get collection details tags: - Collections patch: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateCollectionAsync(\n collectionName: \"{collection_name}\",\n optimizersConfig: new OptimizersConfigDiff { IndexingThreshold = 10000 }\n);\n" - language: csharp - code-samples: - code: "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: "curl -X PATCH \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"optimizers_config\": {\n \"indexing_threshold\": 10000\n }\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.update_collection(\n collection_name=\"{collection_name}\",\n optimizer_config=models.OptimizersConfigDiff(indexing_threshold=10000),\n)\n" language: python - code-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: "curl -X PATCH \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"optimizers_config\": {\n \"indexing_threshold\": 10000\n }\n}'" + language: curl + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.updateCollection(\"{collection_name}\", {\n optimizers_config: {\n indexing_threshold: 10000,\n },\n});\n" + language: typescript - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc updateCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tthreshold := uint64(10000)\n\terr = client.UpdateCollection(context.Background(), &qdrant.UpdateCollection{\n\t\tCollectionName: \"{collection_name}\",\n\t\tOptimizersConfig: &qdrant.OptimizersConfigDiff{\n\t\t\tIndexingThreshold: &threshold,\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.updateCollection(\"{collection_name}\", {\n optimizers_config: {\n indexing_threshold: 10000,\n },\n});\n" - language: typescript + - 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: "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 description: Updates the parameters of the specified collection. summary: Update collection parameters tags: - Collections put: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.CreateCollectionAsync(\n\tcollectionName: \"{collection_name}\",\n\tvectorsConfig: new VectorParams { Size = 100, Distance = Distance.Cosine }\n);\n\n// Or with sparse vectors\n\nawait client.CreateCollectionAsync(\n\tcollectionName: \"{collection_name}\",\n\tsparseVectorsConfig: (\"splade-model-name\", new SparseVectorParams{\n Index = new SparseIndexConfig {\n OnDisk = false,\n }\n })\n);" - language: csharp - code-samples: - code: "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: "# Create a collection with default dense vector\ncurl -X PUT \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"vectors\": {\n \"size\": 384,\n \"distance\": \"Cosine\"\n }\n}'\n\n# Create a collection with named dense and sparse vectors\ncurl -X PUT \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"vectors\": {\n \"dense-vector-name\": {\n \"size\": 1536,\n \"distance\": \"Cosine\"\n }\n },\n \"sparse_vectors\": {\n \"sparse-vector-name\": {\n \"index\": {\n \"on_disk\": true\n }\n }\n }\n}'\n" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.create_collection(\n collection_name=\"{collection_name}\",\n vectors_config=models.VectorParams(size=100, distance=models.Distance.COSINE),\n)\n" language: python - code-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: "# Create a collection with default dense vector\ncurl -X PUT \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"vectors\": {\n \"size\": 384,\n \"distance\": \"Cosine\"\n }\n}'\n\n# Create a collection with named dense and sparse vectors\ncurl -X PUT \\\n 'http://localhost:6333/collections/collection_name' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"vectors\": {\n \"dense-vector-name\": {\n \"size\": 1536,\n \"distance\": \"Cosine\"\n }\n },\n \"sparse_vectors\": {\n \"sparse-vector-name\": {\n \"index\": {\n \"on_disk\": true\n }\n }\n }\n}'\n" + language: curl + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\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: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc createCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.CreateCollection(context.Background(), &qdrant.CreateCollection{\n\t\tCollectionName: \"{collection_name}\",\n\t\tVectorsConfig: qdrant.NewVectorsConfig(&qdrant.VectorParams{\n\t\t\tSize: 100,\n\t\t\tDistance: qdrant.Distance_Cosine,\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.createCollection(\"{collection_name}\", {\n vectors: { size: 100, distance: \"Cosine\" },\n});\n\n// or with sparse vectors\n\nclient.createCollection(\"{collection_name}\", {\n vectors: { size: 100, distance: \"Cosine\" },\n sparse_vectors: {\n \"splade-model-name\": {\n index: {\n on_disk: false\n }\n }\n }\n});" - language: typescript + - 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: "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 description: Creates a new collection with the given parameters. summary: Create a collection tags: @@ -342,17 +342,6 @@ paths: /collections/{collection_name}/aliases: get: x-fern-examples: - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ListCollectionAliasesAsync("{collection_name}"); - -' - language: csharp - code-samples: - code: 'use qdrant_client::Qdrant; @@ -364,9 +353,6 @@ paths: ' language: rust - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/aliases' \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'from qdrant_client import QdrantClient @@ -379,11 +365,8 @@ paths: ' language: python - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listCollectionAliasesAsync(\"{collection_name}\").get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc listCollectionAliases() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\taliases, err := client.ListCollectionAliases(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Collection aliases: \", aliases)\n}\n" - language: go + - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/aliases' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -395,13 +378,12 @@ paths: ' language: typescript - description: Retrieves a list of all aliases for the specified collection. - summary: List collection aliases - tags: - - Aliases - /collections/{collection_name}/exists: - get: - 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(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Collection aliases: \", aliases)\n}\n" + language: go + - code-samples: + - code: "import 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: 'using Qdrant.Client; @@ -409,10 +391,17 @@ paths: var client = new QdrantClient("localhost", 6334); - await client.CollectionExistsAsync("{collection_name}"); + await client.ListCollectionAliasesAsync("{collection_name}"); ' language: csharp + description: Retrieves a list of all aliases for the specified collection. + summary: List collection aliases + tags: + - Aliases + /collections/{collection_name}/exists: + get: + x-fern-examples: - code-samples: - code: 'use qdrant_client::Qdrant; @@ -424,9 +413,6 @@ paths: ' language: rust - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/exists' \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'from qdrant_client import QdrantClient @@ -437,8 +423,25 @@ paths: client.collection_exists(collection_name="{collection_name}")' language: python - code-samples: - - code: 'import static io.qdrant.client.ConditionFactory.matchKeyword; - + - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/exists' \\\n --header 'api-key: '" + language: curl + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.collectionExists("{collection_name}"); + +' + language: typescript + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc collectionExists() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\texists, err := client.CollectionExists(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Collection exists: \", exists)\n}\n" + language: go + - code-samples: + - code: 'import static io.qdrant.client.ConditionFactory.matchKeyword; + import io.qdrant.client.QdrantClient; @@ -456,19 +459,16 @@ paths: ' language: java - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc collectionExists() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\texists, err := client.CollectionExists(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Collection exists: \", exists)\n}\n" - language: go - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.collectionExists("{collection_name}"); + await client.CollectionExistsAsync("{collection_name}"); ' - language: typescript + language: csharp description: Checks whether the specified collection exists. summary: Check collection existence tags: @@ -476,9 +476,6 @@ paths: /collections/{collection_name}/facet: post: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.FacetAsync(\n\t\"{collection_name}\",\n\tfilter: MatchKeyword(\"color\", \"red\"),\n\tkey: \"my-payload-key\",\n\tlimit: 10\n);" - language: csharp - code-samples: - code: "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 @@ -486,14 +483,17 @@ paths: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.facet(\n collection_name=\"{collection_name}\",\n key=\"my-payload-key\",\n facet_filter=models.Filter(must=[models.Match(\"color\", \"red\")]),\n limit=10,\n)\n\n" language: python - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\nimport io.qdrant.client.grpc.Points;\nimport io.qdrant.client.grpc.Filter;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .facetAsync(\n Points.FacetCounts.newBuilder()\n .setCollectionName(collection_name)\n .setKey(\"my-payload-key\")\n .setFilter(\n Filter.newBuilder()\n .addMust(matchKeyword(\"color\", \"red\"))\n .build())\n .build())\n .get();" - language: java + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.facet(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n key: \"my-payload-key\",\n limit: 10,\n});\n" + language: typescript - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc facet() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tlimit := uint64(10)\n\tresults, err := client.Facet(context.Background(), &qdrant.FacetCounts{\n\t\tCollectionName: \"{collection_name}\",\n\t\tKey: \"my-payload-key\",\n\t\tLimit: &limit,\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.facet(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n key: \"my-payload-key\",\n limit: 10,\n});\n" - language: typescript + - code: "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: "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 description: Retrieves facets for the specified payload field. summary: Payload field facets tags: @@ -501,27 +501,27 @@ paths: /collections/{collection_name}/index: put: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.CreatePayloadIndexAsync(\n collectionName: \"{collection_name}\",\n fieldName: \"name_of_the_field_to_index\"\n);\n" - language: csharp - code-samples: - code: "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: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/index' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"field_name\": \"field_name\",\n \"field_schema\": \"keyword\"\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.create_payload_index(\n collection_name=\"{collection_name}\",\n field_name=\"name_of_the_field_to_index\",\n field_schema=\"keyword\",\n)\n" language: python - code-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: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/index' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"field_name\": \"field_name\",\n \"field_schema\": \"keyword\"\n}'" + language: curl + - code-samples: + - code: "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: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc createFieldIndex() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.CreateFieldIndex(context.Background(), &qdrant.CreateFieldIndexCollection{\n\t\tCollectionName: \"{collection_name}\",\n\t\tFieldName: \"name_of_the_field_to_index\",\n\t\tFieldType: qdrant.FieldType_FieldTypeKeyword.Enum(),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.createPayloadIndex(\"{collection_name}\", {\n field_name: \"{field_name}\",\n field_schema: \"keyword\",\n});\n" - language: typescript + - 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: "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 description: Creates a payload index for a field in the specified collection. summary: Create payload index tags: @@ -529,15 +529,9 @@ paths: /collections/{collection_name}/index/{field_name}: delete: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.DeletePayloadIndexAsync(\n collectionName: \"{collection_name}\",\n fieldName: \"name_of_the_field_to_index\"\n);\n" - language: csharp - code-samples: - code: "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: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/index/field_name' \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'from qdrant_client import QdrantClient @@ -550,11 +544,8 @@ paths: ' language: python - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deletePayloadIndexAsync(\"{collection_name}\", \"{field_name}\", true, null, null).get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteFieldIndex() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.DeleteFieldIndex(context.Background(), &qdrant.DeleteFieldIndexCollection{\n\t\tCollectionName: \"{collection_name}\",\n\t\tFieldName: \"{field_name}\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go + - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/index/field_name' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -566,6 +557,15 @@ paths: ' language: typescript + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteFieldIndex() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.DeleteFieldIndex(context.Background(), &qdrant.DeleteFieldIndexCollection{\n\t\tCollectionName: \"{collection_name}\",\n\t\tFieldName: \"{field_name}\",\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go + - code-samples: + - code: "import 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: "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 description: Deletes a payload index for a field in the specified collection. summary: Delete payload index tags: @@ -573,54 +573,54 @@ paths: /collections/{collection_name}/points: post: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RetrieveAsync(\n collectionName: \"{collection_name}\",\n ids: [0, 30, 100],\n withPayload: false,\n withVectors: false\n);\n" - language: csharp - code-samples: - code: "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: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"ids\": [\n 0,\n 3,\n 100\n ]\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.retrieve(\n collection_name=\"{collection_name}\",\n ids=[0, 3, 100],\n)\n" language: python - code-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: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"ids\": [\n 0,\n 3,\n 100\n ]\n}'" + language: curl + - code-samples: + - code: "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: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc getPoints() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tpoints, err := client.Get(context.Background(), &qdrant.GetPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tIds: []*qdrant.PointId{\n\t\t\tqdrant.NewIDNum(0), qdrant.NewID(\"3\"), qdrant.NewIDNum(100),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Points: \", points)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.retrieve(\"{collection_name}\", {\n ids: [0, 3, 100],\n});\n" - language: typescript + - 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: "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 description: Retrieves all details from multiple points. summary: Retrieve points tags: - Points put: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.UpsertAsync(\n collectionName: \"{collection_name}\",\n points: new List\n {\n new()\n {\n Id = 1,\n Vectors = new[] { 0.9f, 0.1f, 0.1f },\n Payload = { [\"city\"] = \"red\" }\n },\n new()\n {\n Id = 2,\n Vectors = new[] { 0.1f, 0.9f, 0.1f },\n Payload = { [\"city\"] = \"green\" }\n },\n new()\n {\n Id = 3,\n Vectors = new[] { 0.1f, 0.1f, 0.9f },\n Payload = { [\"city\"] = \"blue\" }\n }\n }\n);\n" - language: csharp - code-samples: - code: "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: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"points\": [\n {\n \"id\": \"76874cce-1fb9-4e16-9b0b-f085ac06ed6f\",\n \"payload\": {\n \"color\": \"red\"\n },\n \"vector\": [\n 0.9,\n 0.1,\n 0.1\n ]\n },\n {\n \"id\": 1,\n \"payload\": {\n \"color\": \"green\"\n },\n \"vector\": [\n 0.1,\n 0.9,\n 0.1\n ]\n },\n {\n \"id\": 2,\n \"payload\": {\n \"color\": \"blue\"\n },\n \"vector\": [\n 0.1,\n 0.1,\n 0.9\n ]\n }\n ]\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.upsert(\n collection_name=\"{collection_name}\",\n points=[\n models.PointStruct(\n id=1,\n payload={\n \"color\": \"red\",\n },\n vector=[0.9, 0.1, 0.1],\n ),\n models.PointStruct(\n id=2,\n payload={\n \"color\": \"green\",\n },\n vector=[0.1, 0.9, 0.1],\n ),\n models.PointStruct(\n id=3,\n payload={\n \"color\": \"blue\",\n },\n vector=[0.1, 0.1, 0.9],\n ),\n ],\n)\n" language: python - code-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: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"points\": [\n {\n \"id\": \"76874cce-1fb9-4e16-9b0b-f085ac06ed6f\",\n \"payload\": {\n \"color\": \"red\"\n },\n \"vector\": [\n 0.9,\n 0.1,\n 0.1\n ]\n },\n {\n \"id\": 1,\n \"payload\": {\n \"color\": \"green\"\n },\n \"vector\": [\n 0.1,\n 0.9,\n 0.1\n ]\n },\n {\n \"id\": 2,\n \"payload\": {\n \"color\": \"blue\"\n },\n \"vector\": [\n 0.1,\n 0.1,\n 0.9\n ]\n }\n ]\n}'" + language: curl + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\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: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc upsert() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresponse, err := client.Upsert(context.Background(), &qdrant.UpsertPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: []*qdrant.PointStruct{\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(1),\n\t\t\t\tVectors: qdrant.NewVectors(0.9, 0.1, 0.1),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\t\t\"color\": \"red\",\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(2),\n\t\t\t\tVectors: qdrant.NewVectors(0.1, 0.9, 0.1),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\t\t\"color\": \"green\",\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(3),\n\t\t\t\tVectors: qdrant.NewVectors(0.1, 0.1, 0.9),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\t\t\"color\": \"blue\",\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Upsert status: \", response.GetStatus())\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.upsert(\"{collection_name}\", {\n points: [\n {\n id: 1,\n payload: { color: \"red\" },\n vector: [0.9, 0.1, 0.1],\n },\n {\n id: 2,\n payload: { color: \"green\" },\n vector: [0.1, 0.9, 0.1],\n },\n {\n id: 3,\n payload: { color: \"blue\" },\n vector: [0.1, 0.1, 0.9],\n },\n ],\n});\n" - language: typescript + - 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: "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 description: Performs the insert + update action on specified points. Any point with an existing {id} will be overwritten. summary: Upsert points tags: @@ -628,27 +628,27 @@ paths: /collections/{collection_name}/points/batch: post: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateBatchAsync(\n \"{collection_name}\",\n [\n new()\n {\n Upsert = new()\n {\n Points =\n {\n new PointStruct { Id = 1, Vectors = new[] { 0.9f, 0.1f, 0.1f } },\n }\n }\n },\n new()\n {\n UpdateVectors = new()\n {\n Points =\n {\n new PointVectors { Id = 1, Vectors = new[] { 0.9f, 0.1f, 0.1f } },\n }\n }\n },\n new()\n {\n SetPayload = new()\n {\n PointsSelector = new PointsSelector { Points = new PointsIdsList { Ids = { 1 } } },\n Payload = { [\"test_payload_2\"] = 2, [\"test_payload_3\"] = 3 }\n }\n }\n ]\n);\n" - language: csharp - code-samples: - code: "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: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/batch' \\\n --header 'Content-Type: application/json' \\\n --header 'api-key: ' \\\n --data-raw '{\n \"operations\": [\n {\n \"upsert\": {\n \"points\": [\n {\n \"id\": 1,\n \"vector\": [\n 0.4,\n 0.3,\n 0.2,\n 0.1\n ]\n }\n ]\n }\n },\n {\n \"update_vectors\": {\n \"points\": [\n {\n \"id\": 1,\n \"vector\": [\n 0.11,\n 0.22,\n 0.33,\n 0.44\n ]\n }\n ]\n }\n },\n {\n \"set_payload\": {\n \"payload\": {\n \"test_payload_2\": 2,\n \"test_payload_3\": 3\n },\n \"points\": [\n 1\n ]\n }\n }\n ]\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.batch_update_points(\n collection_name=\"{collection_name}\",\n update_operations=[\n models.UpsertOperation(\n upsert=models.PointsList(\n points=[\n models.PointStruct(\n id=1,\n vector=[1.0, 2.0, 3.0, 4.0],\n payload={},\n ),\n ]\n )\n ),\n models.UpdateVectorsOperation(\n update_vectors=models.UpdateVectors(\n points=[\n models.PointVectors(\n id=1,\n vector=[1.0, 2.0, 3.0, 4.0],\n )\n ]\n )\n ),\n models.SetPayloadOperation(\n set_payload=models.SetPayload(\n payload={\n \"test_payload_2\": 2,\n \"test_payload_3\": 3,\n },\n points=[1],\n )\n ),\n ],\n)\n" language: python - code-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: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/batch' \\\n --header 'Content-Type: application/json' \\\n --header 'api-key: ' \\\n --data-raw '{\n \"operations\": [\n {\n \"upsert\": {\n \"points\": [\n {\n \"id\": 1,\n \"vector\": [\n 0.4,\n 0.3,\n 0.2,\n 0.1\n ]\n }\n ]\n }\n },\n {\n \"update_vectors\": {\n \"points\": [\n {\n \"id\": 1,\n \"vector\": [\n 0.11,\n 0.22,\n 0.33,\n 0.44\n ]\n }\n ]\n }\n },\n {\n \"set_payload\": {\n \"payload\": {\n \"test_payload_2\": 2,\n \"test_payload_3\": 3\n },\n \"points\": [\n 1\n ]\n }\n }\n ]\n}'" + language: curl + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\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: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc batchUpdate() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.UpdateBatch(context.Background(), &qdrant.UpdateBatchPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tOperations: []*qdrant.PointsUpdateOperation{\n\t\t\tqdrant.NewPointsUpdateUpsert(&qdrant.PointsUpdateOperation_PointStructList{\n\t\t\t\tPoints: []*qdrant.PointStruct{{\n\t\t\t\t\tId: qdrant.NewIDNum(1),\n\t\t\t\t\tVectors: qdrant.NewVectors(1.0, 2.0, 3.0, 4.0),\n\t\t\t\t}},\n\t\t\t}),\n\t\t\tqdrant.NewPointsUpdateUpdateVectors(&qdrant.PointsUpdateOperation_UpdateVectors{\n\t\t\t\tPoints: []*qdrant.PointVectors{\n\t\t\t\t\t{\n\t\t\t\t\t\tId: qdrant.NewIDNum(1),\n\t\t\t\t\t\tVectors: qdrant.NewVectors(0.1, 0.2, 0.3, 0.4),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t\tqdrant.NewPointsUpdateSetPayload(&qdrant.PointsUpdateOperation_SetPayload{\n\t\t\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(1)),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\t\t\"test_payload_2\": 2,\n\t\t\t\t\t\"test_payload_3\": 3,\n\t\t\t\t}),\n\t\t\t}),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.batchUpdate(\"{collection_name}\", {\n operations: [\n {\n upsert: {\n points: [\n {\n id: 1,\n vector: [1.0, 2.0, 3.0, 4.0],\n payload: {},\n },\n ],\n },\n },\n {\n update_vectors: {\n points: [\n {\n id: 1,\n vector: [1.0, 2.0, 3.0, 4.0],\n },\n ],\n },\n },\n {\n set_payload: {\n payload: {\n test_payload_2: 2,\n test_payload_3: 3,\n },\n points: [1],\n },\n },\n ],\n});\n" - language: typescript + - 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: "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 description: Batch updates points, including their respective vectors and payloads. summary: Batch update points tags: @@ -656,27 +656,27 @@ paths: /collections/{collection_name}/points/count: post: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.CountAsync(\n collectionName: \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"),\n exact: true\n);\n" - language: csharp - code-samples: - code: "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: "# Count total number of points in a collection\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/count' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"exact\": true\n}'\n\n# Count points satisfying a filter condition\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/count' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n },\n \"exact\": true\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.count(\n collection_name=\"{collection_name}\",\n count_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n exact=True,\n)\n" language: python - code-samples: - - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\n\nQdrantClient client = new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .countAsync(\n \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"color\", \"red\")).build(),\n true)\n .get();\n" - language: java + - code: "# Count total number of points in a collection\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/count' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"exact\": true\n}'\n\n# Count points satisfying a filter condition\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/count' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n },\n \"exact\": true\n}'" + language: curl + - code-samples: + - code: "import { 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: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc count() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tcount, err := client.Count(context.Background(), &qdrant.CountPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Count:\", count)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.count(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n exact: true,\n});\n" - language: typescript + - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\n\nQdrantClient client = new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .countAsync(\n \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"color\", \"red\")).build(),\n true)\n .get();\n" + language: java + - code-samples: + - code: "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 description: Counts the number of points that match a specified filtering condition. summary: Count points tags: @@ -684,6 +684,24 @@ paths: /collections/{collection_name}/points/delete: post: x-fern-examples: + - code-samples: + - code: "use qdrant_client::qdrant::{Condition, DeletePointsBuilder, Filter, PointsIdsList};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .delete_points(\n DeletePointsBuilder::new(\"{collection_name}\")\n .points(PointsIdsList {\n ids: vec![0.into(), 3.into(), 100.into()],\n })\n .wait(true),\n )\n .await?;\n\nclient\n .delete_points(\n DeletePointsBuilder::new(\"{collection_name}\")\n .points(Filter::must([Condition::matches(\n \"color\",\n \"red\".to_string(),\n )]))\n .wait(true),\n )\n .await?;\n" + language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete(\n collection_name=\"{collection_name}\",\n points_selector=models.PointIdsList(\n points=[0, 3, 100],\n ),\n)\n\nclient.delete(\n collection_name=\"{collection_name}\",\n points_selector=models.FilterSelector(\n filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"color\",\n match=models.MatchValue(value=\"red\"),\n ),\n ],\n )\n ),\n)\n" + language: python + - code-samples: + - code: "# Delete points by IDs\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"points\": [\n 0,\n 3,\n 100\n ]\n}'\n\n# Delete points by filter \ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n }\n}'\n" + language: curl + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\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: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc delete() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.Delete(context.Background(), &qdrant.DeletePoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: qdrant.NewPointsSelectorIDs([]*qdrant.PointId{\n\t\t\tqdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(100),\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.Delete(context.Background(), &qdrant.DeletePoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: qdrant.NewPointsSelectorFilter(&qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go + - code-samples: + - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteAsync(\"{collection_name}\", List.of(id(0), id(3), id(100)));\n\nclient\n .deleteAsync(\n \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"color\", \"red\")).build())\n .get();\n" + language: java - code-samples: - code: 'using Qdrant.Client; @@ -698,24 +716,6 @@ paths: ' language: csharp - - code-samples: - - code: "use qdrant_client::qdrant::{Condition, DeletePointsBuilder, Filter, PointsIdsList};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .delete_points(\n DeletePointsBuilder::new(\"{collection_name}\")\n .points(PointsIdsList {\n ids: vec![0.into(), 3.into(), 100.into()],\n })\n .wait(true),\n )\n .await?;\n\nclient\n .delete_points(\n DeletePointsBuilder::new(\"{collection_name}\")\n .points(Filter::must([Condition::matches(\n \"color\",\n \"red\".to_string(),\n )]))\n .wait(true),\n )\n .await?;\n" - language: rust - - code-samples: - - code: "# Delete points by IDs\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"points\": [\n 0,\n 3,\n 100\n ]\n}'\n\n# Delete points by filter \ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n }\n}'\n" - language: curl - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete(\n collection_name=\"{collection_name}\",\n points_selector=models.PointIdsList(\n points=[0, 3, 100],\n ),\n)\n\nclient.delete(\n collection_name=\"{collection_name}\",\n points_selector=models.FilterSelector(\n filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"color\",\n match=models.MatchValue(value=\"red\"),\n ),\n ],\n )\n ),\n)\n" - language: python - - code-samples: - - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteAsync(\"{collection_name}\", List.of(id(0), id(3), id(100)));\n\nclient\n .deleteAsync(\n \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"color\", \"red\")).build())\n .get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc delete() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.Delete(context.Background(), &qdrant.DeletePoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: qdrant.NewPointsSelectorIDs([]*qdrant.PointId{\n\t\t\tqdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(100),\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.Delete(context.Background(), &qdrant.DeletePoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: qdrant.NewPointsSelectorFilter(&qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.delete(\"{collection_name}\", {\n points: [0, 3, 100],\n});\n\nclient.delete(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n});\n" - language: typescript description: Deletes specified points from the collection. summary: Delete points tags: @@ -723,27 +723,27 @@ paths: /collections/{collection_name}/points/discover: post: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.DiscoverAsync(\n collectionName: \"{collection_name}\",\n target: new TargetVector\n {\n Single = new VectorExample { Vector = new float[] { 0.2f, 0.1f, 0.9f, 0.7f }, }\n },\n context:\n [\n new()\n {\n Positive = new VectorExample { Id = 100 },\n Negative = new VectorExample { Id = 718 }\n },\n new()\n {\n Positive = new VectorExample { Id = 200 },\n Negative = new VectorExample { Id = 300 }\n }\n ],\n limit: 10\n);\n" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{\n target_vector::Target, vector_example::Example, ContextExamplePairBuilder,\n DiscoverPointsBuilder, VectorExample,\n};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .discover(\n DiscoverPointsBuilder::new(\n \"{collection_name}\",\n vec![\n ContextExamplePairBuilder::default()\n .positive(Example::Id(100.into()))\n .negative(Example::Id(718.into()))\n .build(),\n ContextExamplePairBuilder::default()\n .positive(Example::Id(200.into()))\n .negative(Example::Id(300.into()))\n .build(),\n ],\n 10,\n )\n .target(Target::Single(VectorExample {\n example: Some(Example::Vector(vec![0.2, 0.1, 0.9, 0.7].into())),\n })),\n )\n .await?;\n" language: rust - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/discover' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"target\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"context\": [\n {\n \"positive\": \"7f6652c4-89bd-40e0-ab1d-510f7fcddd2b\",\n \"negative\": \"2c2c9f86-0171-4bd2-9ab0-b4754682cddd\"\n }\n ],\n \"limit\": 10\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.discover(\n \"{collection_name}\",\n target=[0.2, 0.1, 0.9, 0.7],\n context=[\n models.ContextExamplePair(positive=100, negative=718),\n models.ContextExamplePair(positive=200, negative=300),\n ],\n limit=10,\n)\n" language: python - code-samples: - - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.ContextExamplePair;\nimport io.qdrant.client.grpc.Points.DiscoverPoints;\nimport io.qdrant.client.grpc.Points.TargetVector;\nimport io.qdrant.client.grpc.Points.VectorExample;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .discoverAsync(\n DiscoverPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setTarget(\n TargetVector.newBuilder()\n .setSingle(\n VectorExample.newBuilder()\n .setVector(vector(0.2f, 0.1f, 0.9f, 0.7f))\n .build()))\n .addAllContext(\n List.of(\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample.newBuilder().setId(id(100)))\n .setNegative(VectorExample.newBuilder().setId(id(718)))\n .build(),\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample.newBuilder().setId(id(200)))\n .setNegative(VectorExample.newBuilder().setId(id(300)))\n .build()))\n .setLimit(10)\n .build())\n .get();\n" - language: java + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/discover' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"target\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"context\": [\n {\n \"positive\": \"7f6652c4-89bd-40e0-ab1d-510f7fcddd2b\",\n \"negative\": \"2c2c9f86-0171-4bd2-9ab0-b4754682cddd\"\n }\n ],\n \"limit\": 10\n}'" + language: curl + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.discover(\"{collection_name}\", {\n target: [0.2, 0.1, 0.9, 0.7],\n context: [\n {\n positive: 100,\n negative: 718,\n },\n {\n positive: 200,\n negative: 300,\n },\n ],\n limit: 10,\n});\n" + language: typescript - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc discover() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresults, err := client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQueryDiscover(&qdrant.DiscoverInput{\n\t\t\tTarget: qdrant.NewVectorInput(0.2, 0.1, 0.9, 0.7),\n\t\t\tContext: &qdrant.ContextInput{\n\t\t\t\tPairs: []*qdrant.ContextInputPair{{\n\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\t\t\t\t}, {\n\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(300)),\n\t\t\t\t}},\n\t\t\t},\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.discover(\"{collection_name}\", {\n target: [0.2, 0.1, 0.9, 0.7],\n context: [\n {\n positive: 100,\n negative: 718,\n },\n {\n positive: 200,\n negative: 300,\n },\n ],\n limit: 10,\n});\n" - language: typescript + - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.ContextExamplePair;\nimport io.qdrant.client.grpc.Points.DiscoverPoints;\nimport io.qdrant.client.grpc.Points.TargetVector;\nimport io.qdrant.client.grpc.Points.VectorExample;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .discoverAsync(\n DiscoverPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setTarget(\n TargetVector.newBuilder()\n .setSingle(\n VectorExample.newBuilder()\n .setVector(vector(0.2f, 0.1f, 0.9f, 0.7f))\n .build()))\n .addAllContext(\n List.of(\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample.newBuilder().setId(id(100)))\n .setNegative(VectorExample.newBuilder().setId(id(718)))\n .build(),\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample.newBuilder().setId(id(200)))\n .setNegative(VectorExample.newBuilder().setId(id(300)))\n .build()))\n .setLimit(10)\n .build())\n .get();\n" + language: java + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.DiscoverAsync(\n collectionName: \"{collection_name}\",\n target: new TargetVector\n {\n Single = new VectorExample { Vector = new float[] { 0.2f, 0.1f, 0.9f, 0.7f }, }\n },\n context:\n [\n new()\n {\n Positive = new VectorExample { Id = 100 },\n Negative = new VectorExample { Id = 718 }\n },\n new()\n {\n Positive = new VectorExample { Id = 200 },\n Negative = new VectorExample { Id = 300 }\n }\n ],\n limit: 10\n);\n" + language: csharp description: > Retrieves the most similar points to a given target, constrained by the provided context. @@ -757,27 +757,27 @@ paths: /collections/{collection_name}/points/discover/batch: post: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar discoverPoints = new List\n{\n new DiscoverPoints\n {\n CollectionName = \"{collection_name}\",\n Target = new TargetVector\n {\n Single = new VectorExample { Vector = new float[] { 0.2f, 0.1f, 0.9f, 0.7f }, }\n },\n Context =\n {\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 100 },\n Negative = new VectorExample { Id = 718 }\n },\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 200 },\n Negative = new VectorExample { Id = 300 }\n }\n },\n Limit = 10\n },\n new DiscoverPoints\n {\n CollectionName = \"{collection_name}\",\n Target = new TargetVector\n {\n Single = new VectorExample { Vector = new float[] { 0.5f, 0.3f, 0.2f, 0.3f }, }\n },\n Context =\n {\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 342 },\n Negative = new VectorExample { Id = 213 }\n },\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 100 },\n Negative = new VectorExample { Id = 200 }\n }\n },\n Limit = 10\n }\n};\nawait client.DiscoverBatchAsync(\"{collection_name}\", discoverPoints);\n" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{\n vector_example::Example, ContextExamplePairBuilder, DiscoverBatchPointsBuilder,\n DiscoverPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet discover_points = DiscoverBatchPointsBuilder::new(\n \"{collection_name}\",\n vec![\n DiscoverPointsBuilder::new(\n \"{collection_name}\",\n vec![\n ContextExamplePairBuilder::default()\n .positive(Example::Id(100.into()))\n .negative(Example::Id(718.into()))\n .build(),\n ContextExamplePairBuilder::default()\n .positive(Example::Id(200.into()))\n .negative(Example::Id(300.into()))\n .build(),\n ],\n 10,\n )\n .build(),\n DiscoverPointsBuilder::new(\n \"{collection_name}\",\n vec![\n ContextExamplePairBuilder::default()\n .positive(Example::Id(342.into()))\n .negative(Example::Id(213.into()))\n .build(),\n ContextExamplePairBuilder::default()\n .positive(Example::Id(100.into()))\n .negative(Example::Id(200.into()))\n .build(),\n ],\n 10,\n )\n .build(),\n ],\n);\n\nclient.discover_batch(&discover_points.build()).await?;\n" language: rust - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/discover/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"target\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"context\": [\n {\n \"positive\": \"7f6652c4-89bd-40e0-ab1d-510f7fcddd2b\",\n \"negative\": \"2c2c9f86-0171-4bd2-9ab0-b4754682cddd\"\n }\n ],\n \"limit\": 1\n },\n {\n \"target\": [\n 0.5,\n 0.3,\n 0.2,\n 0.3\n ],\n \"context\": [\n {\n \"positive\": 342,\n \"negative\": 213\n }\n ],\n \"limit\": 1\n }\n ]\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\ndiscover_queries = [\n models.DiscoverRequest(\n target=[0.2, 0.1, 0.9, 0.7],\n context=[\n models.ContextExamplePair(\n positive=100,\n negative=718,\n ),\n models.ContextExamplePair(\n positive=200,\n negative=300,\n ),\n ],\n limit=10,\n ),\n models.DiscoverRequest(\n target=[0.5, 0.3, 0.2, 0.3],\n context=[\n models.ContextExamplePair(\n positive=342,\n negative=213,\n ),\n models.ContextExamplePair(\n positive=100,\n negative=200,\n ),\n ],\n limit=5,\n ),\n]\n\nclient.discover_batch(\"{collection_name}\", discover_queries)\n" language: python - code-samples: - - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\nimport java.util.Arrays;\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.ContextExamplePair;\nimport io.qdrant.client.grpc.Points.DiscoverPoints;\nimport io.qdrant.client.grpc.Points.TargetVector;\nimport io.qdrant.client.grpc.Points.VectorExample;\n\nQdrantClient client = new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nList discoverPoints = Arrays.asList(\n DiscoverPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setTarget(\n TargetVector.newBuilder()\n .setSingle(\n VectorExample.newBuilder()\n .setVector(vector(\n 0.2 f,\n 0.1 f,\n 0.9 f,\n 0.7 f))\n .build()))\n .addAllContext(\n List.of(\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample\n .newBuilder()\n .setId(id(100)))\n .setNegative(VectorExample\n .newBuilder()\n .setId(id(718)))\n .build(),\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample\n .newBuilder()\n .setId(id(200)))\n .setNegative(VectorExample\n .newBuilder()\n .setId(id(300)))\n .build()))\n .setLimit(10)\n .build(),\n DiscoverPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setTarget(\n TargetVector.newBuilder()\n .setSingle(\n VectorExample.newBuilder()\n .setVector(vector(\n 0.5 f, 0.3 f, 0.2 f, 0.3 f))\n .build()))\n .addAllContext(\n List.of(\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample\n .newBuilder()\n .setId(id(342)))\n .setNegative(VectorExample\n .newBuilder()\n .setId(id(213)))\n .build(),\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample\n .newBuilder()\n .setId(id(100)))\n .setNegative(VectorExample\n .newBuilder()\n .setId(id(200)))\n .build()))\n .setLimit(10)\n .build());\nclient.discoverBatchAsync(\"{collection_name}\", discoverPoints, null);\n" - language: java + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/discover/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"target\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"context\": [\n {\n \"positive\": \"7f6652c4-89bd-40e0-ab1d-510f7fcddd2b\",\n \"negative\": \"2c2c9f86-0171-4bd2-9ab0-b4754682cddd\"\n }\n ],\n \"limit\": 1\n },\n {\n \"target\": [\n 0.5,\n 0.3,\n 0.2,\n 0.3\n ],\n \"context\": [\n {\n \"positive\": 342,\n \"negative\": 213\n }\n ],\n \"limit\": 1\n }\n ]\n}'" + language: curl + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nconst searches = [\n {\n target: [0.2, 0.1, 0.9, 0.7],\n context: [\n {\n positive: 100,\n negative: 718,\n },\n {\n positive: 200,\n negative: 300,\n },\n ],\n limit: 10,\n },\n {\n target: [0.5, 0.3, 0.2, 0.3],\n context: [\n {\n positive: 342,\n negative: 213,\n },\n {\n positive: 100,\n negative: 200,\n },\n ],\n limit: 5,\n },\n];\n\nclient.discoverBatchPoints(\"{collection_name}\", {\n searches,\n});\n" + language: typescript - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc discoverBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresults, err := client.QueryBatch(context.Background(), &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryDiscover(&qdrant.DiscoverInput{\n\t\t\t\t\tTarget: qdrant.NewVectorInput(0.2, 0.1, 0.9, 0.7),\n\t\t\t\t\tContext: &qdrant.ContextInput{\n\t\t\t\t\t\tPairs: []*qdrant.ContextInputPair{{\n\t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(300)),\n\t\t\t\t\t\t}},\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryDiscover(&qdrant.DiscoverInput{\n\t\t\t\t\tTarget: qdrant.NewVectorInput(0.5, 0.3, 0.2, 0.3),\n\t\t\t\t\tContext: &qdrant.ContextInput{\n\t\t\t\t\t\tPairs: []*qdrant.ContextInputPair{{\n\t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(342)),\n\t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(213)),\n\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\t\t\t\t\t\t}},\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nconst searches = [\n {\n target: [0.2, 0.1, 0.9, 0.7],\n context: [\n {\n positive: 100,\n negative: 718,\n },\n {\n positive: 200,\n negative: 300,\n },\n ],\n limit: 10,\n },\n {\n target: [0.5, 0.3, 0.2, 0.3],\n context: [\n {\n positive: 342,\n negative: 213,\n },\n {\n positive: 100,\n negative: 200,\n },\n ],\n limit: 5,\n },\n];\n\nclient.discoverBatchPoints(\"{collection_name}\", {\n searches,\n});\n" - language: typescript + - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\nimport java.util.Arrays;\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.ContextExamplePair;\nimport io.qdrant.client.grpc.Points.DiscoverPoints;\nimport io.qdrant.client.grpc.Points.TargetVector;\nimport io.qdrant.client.grpc.Points.VectorExample;\n\nQdrantClient client = new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nList discoverPoints = Arrays.asList(\n DiscoverPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setTarget(\n TargetVector.newBuilder()\n .setSingle(\n VectorExample.newBuilder()\n .setVector(vector(\n 0.2 f,\n 0.1 f,\n 0.9 f,\n 0.7 f))\n .build()))\n .addAllContext(\n List.of(\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample\n .newBuilder()\n .setId(id(100)))\n .setNegative(VectorExample\n .newBuilder()\n .setId(id(718)))\n .build(),\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample\n .newBuilder()\n .setId(id(200)))\n .setNegative(VectorExample\n .newBuilder()\n .setId(id(300)))\n .build()))\n .setLimit(10)\n .build(),\n DiscoverPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setTarget(\n TargetVector.newBuilder()\n .setSingle(\n VectorExample.newBuilder()\n .setVector(vector(\n 0.5 f, 0.3 f, 0.2 f, 0.3 f))\n .build()))\n .addAllContext(\n List.of(\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample\n .newBuilder()\n .setId(id(342)))\n .setNegative(VectorExample\n .newBuilder()\n .setId(id(213)))\n .build(),\n ContextExamplePair.newBuilder()\n .setPositive(VectorExample\n .newBuilder()\n .setId(id(100)))\n .setNegative(VectorExample\n .newBuilder()\n .setId(id(200)))\n .build()))\n .setLimit(10)\n .build());\nclient.discoverBatchAsync(\"{collection_name}\", discoverPoints, null);\n" + language: java + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar discoverPoints = new List\n{\n new DiscoverPoints\n {\n CollectionName = \"{collection_name}\",\n Target = new TargetVector\n {\n Single = new VectorExample { Vector = new float[] { 0.2f, 0.1f, 0.9f, 0.7f }, }\n },\n Context =\n {\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 100 },\n Negative = new VectorExample { Id = 718 }\n },\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 200 },\n Negative = new VectorExample { Id = 300 }\n }\n },\n Limit = 10\n },\n new DiscoverPoints\n {\n CollectionName = \"{collection_name}\",\n Target = new TargetVector\n {\n Single = new VectorExample { Vector = new float[] { 0.5f, 0.3f, 0.2f, 0.3f }, }\n },\n Context =\n {\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 342 },\n Negative = new VectorExample { Id = 213 }\n },\n new ContextExamplePair()\n {\n Positive = new VectorExample { Id = 100 },\n Negative = new VectorExample { Id = 200 }\n }\n },\n Limit = 10\n }\n};\nawait client.DiscoverBatchAsync(\"{collection_name}\", discoverPoints);\n" + language: csharp description: Retrieves points in batches based on the target and/or positive and negative example pairs. summary: Discover batch points tags: @@ -785,54 +785,54 @@ paths: /collections/{collection_name}/points/payload: post: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SetPayloadAsync(\n collectionName: \"{collection_name}\",\n payload: new Dictionary { { \"property1\", \"string\" }, { \"property2\", \"string\" } },\n ids: new ulong[] { 0, 3, 10 }\n);\n" - language: csharp - code-samples: - code: "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: "# Set payload by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"payload\": {\n \"property1\": \"some_value\",\n \"property2\": 32,\n \"property3\": true\n },\n \"points\": [\n 0,\n 3,\n 10\n ]\n}'\n\n# Set payload by filter\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n },\n \"payload\": {\n \"property1\": \"some_value\",\n \"property2\": 32,\n \"property3\": true\n }\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.set_payload(\n collection_name=\"{collection_name}\",\n payload={\n \"property1\": \"string\",\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n)\n" language: python - code-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: "# Set payload by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"payload\": {\n \"property1\": \"some_value\",\n \"property2\": 32,\n \"property3\": true\n },\n \"points\": [\n 0,\n 3,\n 10\n ]\n}'\n\n# Set payload by filter\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n },\n \"payload\": {\n \"property1\": \"some_value\",\n \"property2\": 32,\n \"property3\": true\n }\n}'" + language: curl + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\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: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc setPayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresults, err := client.SetPayload(context.Background(), &qdrant.SetPayloadPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\"property1\": \"string\",\n\t\t\t\"property2\": \"string\",\n\t\t}),\n\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(10)),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.setPayload(\"{collection_name}\", {\n payload: {\n property1: \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n});\n" - language: typescript + - 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: "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 description: Sets payload values for specified points. summary: Set payload tags: - Points put: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.OverwritePayloadAsync(\n collectionName: \"{collection_name}\",\n payload: new Dictionary { { \"property1\", \"string\" }, { \"property2\", \"string\" } },\n ids: new ulong[] { 0, 3, 10 }\n);\n" - language: csharp - code-samples: - code: "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: "# Overwrite payload by ID\ncurl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points/payload' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"payload\": {\n \"property1\": \"string\",\n \"property2\": \"string\"\n },\n \"points\": [\n 0,\n 3,\n 10\n ]\n}'\n\n# Overwrite payload by filter\ncurl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points/payload' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"payload\": {\n \"property1\": \"string\",\n \"property2\": \"string\"\n },\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n }\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.overwrite_payload(\n collection_name=\"{collection_name}\",\n payload={\n \"property1\": \"string\",\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n)\n" language: python - code-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: "# Overwrite payload by ID\ncurl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points/payload' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"payload\": {\n \"property1\": \"string\",\n \"property2\": \"string\"\n },\n \"points\": [\n 0,\n 3,\n 10\n ]\n}'\n\n# Overwrite payload by filter\ncurl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points/payload' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"payload\": {\n \"property1\": \"string\",\n \"property2\": \"string\"\n },\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n }\n}'" + language: curl + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\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: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc overwritePayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.OverwritePayload(context.Background(), &qdrant.SetPayloadPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\"property1\": \"string\",\n\t\t\t\"property2\": \"string\",\n\t\t}),\n\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(10)),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.overwritePayload(\"{collection_name}\", {\n payload: {\n property1: \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n});\n" - language: typescript + - 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: "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 description: Replaces the entire payload of a specified point with a new payload. summary: Overwrite payload tags: @@ -840,42 +840,24 @@ paths: /collections/{collection_name}/points/payload/clear: post: x-fern-examples: - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ClearPayloadAsync("{collection_name}", [0, 3, 10]); - -' - language: csharp - code-samples: - code: "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: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload/clear' \\\n --header 'Content-Type: application/json' \\\n --header 'api-key: ' \\\n --data-raw '{\n \"points\": [\n 0,\n 3,\n 100\n ]\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.clear_payload(\n collection_name=\"{collection_name}\",\n points_selector=[0, 3, 100],\n)\n" language: python - code-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: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload/clear' \\\n --header 'Content-Type: application/json' \\\n --header 'api-key: ' \\\n --data-raw '{\n \"points\": [\n 0,\n 3,\n 100\n ]\n}'" + language: curl + - code-samples: + - code: "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: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc clearPayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.ClearPayload(context.Background(), &qdrant.ClearPayloadPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewID(\"3\"), qdrant.NewIDNum(100)),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.clearPayload(\"{collection_name}\", {\n points: [0, 3, 100],\n});\n" - language: typescript - description: Removes the entire payload for specified points. - summary: Clear payload - tags: - - Points - /collections/{collection_name}/points/payload/delete: - post: - x-fern-examples: + - 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: 'using Qdrant.Client; @@ -883,28 +865,46 @@ paths: var client = new QdrantClient("localhost", 6334); - await client.DeletePayloadAsync("{collection_name}", ["color", "price"], [0, 3, 10]); + await client.ClearPayloadAsync("{collection_name}", [0, 3, 10]); ' language: csharp + description: Removes the entire payload for specified points. + summary: Clear payload + tags: + - Points + /collections/{collection_name}/points/payload/delete: + post: + x-fern-examples: - code-samples: - code: "use qdrant_client::qdrant::{DeletePayloadPointsBuilder, PointsIdsList};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .delete_payload(\n DeletePayloadPointsBuilder::new(\n \"{collection_name}\",\n vec![\"color\".to_string(), \"price\".to_string()],\n )\n .points_selector(PointsIdsList {\n ids: vec![0.into(), 3.into(), 100.into()],\n })\n .wait(true),\n )\n .await?;\n" language: rust - - code-samples: - - code: "# Delete payload by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"keys\": [\n \"color\",\n \"price\"\n ],\n \"points\": [\n 0,\n 3,\n 100\n ]\n}'\n\n# Delete payload by filter\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"keys\": [\n \"color\",\n \"price\"\n ],\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n }\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete_payload(\n collection_name=\"{collection_name}\",\n keys=[\"color\", \"price\"],\n points=[0, 3, 100],\n)\n" language: python - code-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: "# Delete payload by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"keys\": [\n \"color\",\n \"price\"\n ],\n \"points\": [\n 0,\n 3,\n 100\n ]\n}'\n\n# Delete payload by filter\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"keys\": [\n \"color\",\n \"price\"\n ],\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n }\n}'" + language: curl + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.deletePayload(\"{collection_name}\", {\n keys: [\"color\", \"price\"],\n points: [0, 3, 100],\n});\n" + language: typescript - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deletePayload() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.DeletePayload(context.Background(), &qdrant.DeletePayloadPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(100)),\n\t\tKeys: []string{\"color\", \"price\"},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.deletePayload(\"{collection_name}\", {\n keys: [\"color\", \"price\"],\n points: [0, 3, 100],\n});\n" - language: typescript + - 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: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.DeletePayloadAsync("{collection_name}", ["color", "price"], [0, 3, 10]); + +' + language: csharp description: Deletes a specified key payload for points. summary: Delete payload tags: @@ -912,27 +912,27 @@ paths: /collections/{collection_name}/points/query: post: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\n// Query nearest by ID\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tquery: Guid.Parse(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")\n);\n\n// Recommend on the average of these vectors\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tquery: new RecommendInput\n\t{\n\t\tPositive =\n\t\t{\n\t\t\tGuid.Parse(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"),\n\t\t\tnew float[] { 0.11f, 0.35f, 0.6f }\n\t\t},\n\t\tNegative = { new float[] { 0.01f, 0.45f, 0.67f } }\n\t}\n);\n\n// Fusion query\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tprefetch: new List\n\t{\n\t\tnew()\n\t\t{\n\t\t\tQuery = new (float, uint)[] { (0.22f, 1), (0.8f, 42), },\n\t\t\tUsing = \"sparse\",\n\t\t\tLimit = 20\n\t\t},\n\t\tnew()\n\t\t{\n\t\t\tQuery = new float[] { 0.01f, 0.45f, 0.67f },\n\t\t\tUsing = \"dense\",\n\t\t\tLimit = 20\n\t\t}\n\t},\n\tquery: Fusion.Rrf\n);\n\n// 2-stage query\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tprefetch: new List\n\t{\n\t\tnew() { Query = new float[] { 0.01f, 0.45f, 0.67f }, Limit = 100 }\n\t},\n\tquery: new float[][] { [0.1f, 0.2f], [0.2f, 0.1f], [0.8f, 0.9f] },\n\tusingVector: \"colbert\",\n\tlimit: 10\n);\n\n// Random sampling (as of 1.11.0)\nawait client.QueryAsync(\n collectionName: \"{collection_name}\",\n query: Sample.Random\n);\n\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: "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: "# Query nearest by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"query\": \"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\n}'\n\n# Recommend on the average of these vectors\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"query\": {\n \"recommend\": {\n \"positive\": [\n [\n 0.11,\n 0.35,\n 0.6\n ]\n ],\n \"negative\": [\n \"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\",\n [\n 0.01,\n 0.45,\n 0.67\n ]\n ]\n }\n }\n}'\n\n# Fusion query\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"prefetch\": [\n {\n \"query\": {\n \"values\": [\n 0.22,\n 0.8\n ],\n \"indices\": [\n 1,\n 42\n ]\n },\n \"using\": \"sparse\",\n \"limit\": 20\n },\n {\n \"query\": [\n 0.01,\n 0.45,\n 0.67\n ],\n \"using\": \"dense\",\n \"limit\": 20\n }\n ],\n \"query\": {\n \"fusion\": \"rrf\"\n }\n}'\n\n# 2-stage query\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"prefetch\": {\n \"query\": [\n 1,\n 23,\n 45,\n 67\n ],\n \"limit\": 100\n },\n \"query\": [\n [\n 0.1,\n 0.2,\n 0.3\n ],\n [\n 0.2,\n 0.1,\n 0.35\n ],\n [\n 0.8,\n 0.9,\n 0.53\n ]\n ],\n \"using\": \"colbert\",\n \"limit\": 10\n}'\n\n# Random sampling (as of 1.11.0)\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"query\": {\n \"sample\": \"random\"\n }\n}'\n\n# Score boost depending on payload conditions (as of 1.14.0)\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"prefetch\": {\n \"query\": [0.2, 0.8, ...], // <-- dense vector\n \"limit\": 50\n }\n \"query\": {\n \"formula\": {\n \"sum\": [\n \"$score,\n { \"mult\": [ 0.5, { \"key\": \"tag\", \"match\": { \"any\": [\"h1\", \"h2\", \"h3\", \"h4\"] } } ] },\n { \"mult\": [ 0.25, { \"key\": \"tag\", \"match\": { \"any\": [\"p\", \"li\"] } } ] }\n ]\n }\n }\n}'\n\n# Score boost geographically closer points (as of 1.14.0)\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"prefetch\": { \"query\": [0.2, 0.8, ...], \"limit\": 50 },\n \"query\": {\n \"formula\": {\n \"sum\": [\n \"$score\",\n {\n \"gauss_decay\": {\n \"x\": {\n \"geo_distance\": {\n \"origin\": { \"lat\": 52.504043, \"lon\": 13.393236 } // Berlin\n \"to\": \"geo.location\"\n }\n },\n \"scale\": 5000 // 5km\n }\n }\n ]\n },\n \"defaults\": { \"geo.location\": {\"lat\": 48.137154, \"lon\": 11.576124} } // Munich\n }\n}'\n" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\n# Query nearest by ID\nnearest = client.query_points(\n collection_name=\"{collection_name}\",\n query=\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\",\n)\n\n# Recommend on the average of these vectors\nrecommended = client.query_points(\n collection_name=\"{collection_name}\",\n query=models.RecommendQuery(recommend=models.RecommendInput(\n positive=[\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\", [0.11, 0.35, 0.6, ...]],\n negative=[[0.01, 0.45, 0.67, ...]]\n ))\n)\n\n# Fusion query\nhybrid = client.query_points(\n collection_name=\"{collection_name}\",\n prefetch=[\n models.Prefetch(\n query=models.SparseVector(indices=[1, 42], values=[0.22, 0.8]),\n using=\"sparse\",\n limit=20,\n ),\n models.Prefetch(\n query=[0.01, 0.45, 0.67, ...], # <-- dense vector\n using=\"dense\",\n limit=20,\n ),\n ],\n query=models.FusionQuery(fusion=models.Fusion.RRF),\n)\n\n# 2-stage query\nrefined = client.query_points(\n collection_name=\"{collection_name}\",\n prefetch=models.Prefetch(\n query=[0.01, 0.45, 0.67, ...], # <-- dense vector\n limit=100,\n ),\n query=[\n [0.1, 0.2, ...], # <─┐\n [0.2, 0.1, ...], # < ├─ multi-vector\n [0.8, 0.9, ...], # < ┘\n ],\n using=\"colbert\",\n limit=10,\n)\n\n# Random sampling (as of 1.11.0)\nsampled = client.query_points(\n collection_name=\"{collection_name}\",\n query=models.SampleQuery(sample=models.Sample.RANDOM)\n)\n\n# Score boost depending on payload conditions (as of 1.14.0)\ntag_boosted = client.query_points(\n collection_name=\"{collection_name}\",\n prefetch=models.Prefetch(\n query=[0.2, 0.8, ...], # <-- dense vector\n limit=50\n ),\n query=models.FormulaQuery(\n formula=models.SumExpression(sum=[\n \"$score\",\n models.MultExpression(mult=[0.5, models.FieldCondition(key=\"tag\", match=models.MatchAny(any=[\"h1\", \"h2\", \"h3\", \"h4\"]))]),\n models.MultExpression(mult=[0.25, models.FieldCondition(key=\"tag\", match=models.MatchAny(any=[\"p\", \"li\"]))])\n ]\n ))\n)\n\n# Score boost geographically closer points (as of 1.14.0)\ngeo_boosted = client.query_points(\n collection_name=\"{collection_name}\",\n prefetch=models.Prefetch(\n query=[0.2, 0.8, ...], # <-- dense vector\n limit=50\n ),\n query=models.FormulaQuery(\n formula=models.SumExpression(sum=[\n \"$score\",\n models.GaussDecayExpression(\n gauss_decay=models.DecayParamsExpression(\n x=models.GeoDistance(\n geo_distance=models.GeoDistanceParams(\n origin=models.GeoPoint(\n lat=52.504043,\n lon=13.393236\n ), # Berlin\n to=\"geo.location\"\n )\n ),\n scale=5000 # 5km\n )\n )\n ]),\n defaults={\"geo.location\": models.GeoPoint(lat=48.137154, lon=11.576124)} # Munich\n )\n)\n" language: python - code-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: "# Query nearest by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"query\": \"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\n}'\n\n# Recommend on the average of these vectors\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"query\": {\n \"recommend\": {\n \"positive\": [\n [\n 0.11,\n 0.35,\n 0.6\n ]\n ],\n \"negative\": [\n \"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\",\n [\n 0.01,\n 0.45,\n 0.67\n ]\n ]\n }\n }\n}'\n\n# Fusion query\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"prefetch\": [\n {\n \"query\": {\n \"values\": [\n 0.22,\n 0.8\n ],\n \"indices\": [\n 1,\n 42\n ]\n },\n \"using\": \"sparse\",\n \"limit\": 20\n },\n {\n \"query\": [\n 0.01,\n 0.45,\n 0.67\n ],\n \"using\": \"dense\",\n \"limit\": 20\n }\n ],\n \"query\": {\n \"fusion\": \"rrf\"\n }\n}'\n\n# 2-stage query\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"prefetch\": {\n \"query\": [\n 1,\n 23,\n 45,\n 67\n ],\n \"limit\": 100\n },\n \"query\": [\n [\n 0.1,\n 0.2,\n 0.3\n ],\n [\n 0.2,\n 0.1,\n 0.35\n ],\n [\n 0.8,\n 0.9,\n 0.53\n ]\n ],\n \"using\": \"colbert\",\n \"limit\": 10\n}'\n\n# Random sampling (as of 1.11.0)\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"query\": {\n \"sample\": \"random\"\n }\n}'\n\n# Score boost depending on payload conditions (as of 1.14.0)\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"prefetch\": {\n \"query\": [0.2, 0.8, ...], // <-- dense vector\n \"limit\": 50\n }\n \"query\": {\n \"formula\": {\n \"sum\": [\n \"$score,\n { \"mult\": [ 0.5, { \"key\": \"tag\", \"match\": { \"any\": [\"h1\", \"h2\", \"h3\", \"h4\"] } } ] },\n { \"mult\": [ 0.25, { \"key\": \"tag\", \"match\": { \"any\": [\"p\", \"li\"] } } ] }\n ]\n }\n }\n}'\n\n# Score boost geographically closer points (as of 1.14.0)\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"prefetch\": { \"query\": [0.2, 0.8, ...], \"limit\": 50 },\n \"query\": {\n \"formula\": {\n \"sum\": [\n \"$score\",\n {\n \"gauss_decay\": {\n \"x\": {\n \"geo_distance\": {\n \"origin\": { \"lat\": 52.504043, \"lon\": 13.393236 } // Berlin\n \"to\": \"geo.location\"\n }\n },\n \"scale\": 5000 // 5km\n }\n }\n ]\n },\n \"defaults\": { \"geo.location\": {\"lat\": 48.137154, \"lon\": 11.576124} } // Munich\n }\n}'\n" + language: curl + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n// Query nearest by ID\nlet _nearest = client.query(\"{collection_name\", {\n query: \"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\n});\n\n// Recommend on the average of these vectors\nlet _recommendations = client.query(\"{collection_name}\", {\n query: {\n recommend: {\n positive: [\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\", [0.11, 0.35, 0.6]],\n negative: [0.01, 0.45, 0.67]\n }\n }\n});\n\n// Fusion query\nlet _hybrid = client.query(\"{collection_name}\", {\n prefetch: [\n {\n query: {\n values: [0.22, 0.8],\n indices: [1, 42],\n },\n using: 'sparse',\n limit: 20,\n },\n {\n query: [0.01, 0.45, 0.67],\n using: 'dense',\n limit: 20,\n },\n ],\n query: {\n fusion: 'rrf',\n },\n});\n\n// 2-stage query\nlet _refined = client.query(\"{collection_name}\", {\n prefetch: {\n query: [1, 23, 45, 67],\n limit: 100,\n },\n query: [\n [0.1, 0.2],\n [0.2, 0.1],\n [0.8, 0.9],\n ],\n using: 'colbert',\n limit: 10,\n});\n\n// Random sampling (as of 1.11.0)\nlet _sampled = client.query(\"{collection_name}\", {\n query: { sample: \"random\" },\n});\n\n// Score boost depending on payload conditions (as of 1.14.0)\nconst tag_boosted = await client.query(\"{collection_name}\", {\n prefetch: {\n query: [0.2, 0.8, 0.1, 0.9],\n limit: 50\n },\n query: {\n formula: {\n sum: [\n \"$score\",\n {\n mult: [ 0.5, { key: \"tag\", match: { any: [\"h1\", \"h2\", \"h3\", \"h4\"] }} ]\n },\n {\n mult: [ 0.25, { key: \"tag\", match: { any: [\"p\", \"li\"] }} ]\n }\n ]\n }\n }\n});\n\n// Score boost geographically closer points (as of 1.14.0)\nconst distance_boosted = await client.query(\"{collection_name}\", {\n prefetch: {\n query: [0.2, 0.8, ...],\n limit: 50\n },\n query: {\n formula: {\n sum: [\n \"$score\",\n {\n gauss_decay: {\n x: {\n geo_distance: {\n origin: { lat: 52.504043, lon: 13.393236 }, // Berlin\n to: \"geo.location\"\n }\n },\n scale: 5000 // 5km\n }\n }\n ]\n },\n defaults: { \"geo.location\": { lat: 48.137154, lon: 11.576124 } } // Munich\n }\n});\n" + language: typescript - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc query() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Query nearest by ID\n\tpoints, err := client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQueryID(qdrant.NewID(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", points)\n\n\t// Recommend on the average of these vectors\n\tpoints, err = client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewID(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")),\n\t\t\t\tqdrant.NewVectorInput(0.11, 0.35, 0.6),\n\t\t\t},\n\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInput(0.01, 0.45, 0.67),\n\t\t\t},\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", points)\n\n\t// Fusion query\n\tpoints, err = client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPrefetch: []*qdrant.PrefetchQuery{\n\t\t\t{\n\t\t\t\tQuery: qdrant.NewQuerySparse([]uint32{1, 42}, []float32{0.22, 0.8}),\n\t\t\t\tUsing: qdrant.PtrOf(\"sparse\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\t\t\tUsing: qdrant.PtrOf(\"dense\"),\n\t\t\t},\n\t\t},\n\t\tQuery: qdrant.NewQueryFusion(qdrant.Fusion_RRF),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", points)\n\n\t// 2-stage query\n\tpoints, err = client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPrefetch: []*qdrant.PrefetchQuery{\n\t\t\t{\n\t\t\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\t\t},\n\t\t},\n\t\tQuery: qdrant.NewQueryMulti([][]float32{\n\t\t\t{0.1, 0.2},\n\t\t\t{0.2, 0.1},\n\t\t\t{0.8, 0.9},\n\t\t}),\n\t\tUsing: qdrant.PtrOf(\"colbert\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", points)\n\n\t// Random sampling (as of 1.11.0)\n\tpoints, err = client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQuerySample(qdrant.Sample_Random),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", points)\n\n\t// Score boost depending on payload conditions (as of 1.14.0)\n\tpoints, err = client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPrefetch: []*qdrant.PrefetchQuery{\n\t\t\t{\n\t\t\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\t\t},\n\t\t},\n\t\tQuery: qdrant.NewQueryFormula(&qdrant.Formula{\n\t\t\tExpression: qdrant.NewExpressionSum(&qdrant.SumExpression{\n\t\t\t\tSum: []*qdrant.Expression{\n\t\t\t\t\tqdrant.NewExpressionVariable(\"$score\"),\n\t\t\t\t\tqdrant.NewExpressionMult(&qdrant.MultExpression{\n\t\t\t\t\t\tMult: []*qdrant.Expression{\n\t\t\t\t\t\t\tqdrant.NewExpressionConstant(0.5),\n\t\t\t\t\t\t\tqdrant.NewExpressionCondition(qdrant.NewMatchKeywords(\"tag\", \"h1\", \"h2\", \"h3\", \"h4\")),\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t\tqdrant.NewExpressionMult(&qdrant.MultExpression{\n\t\t\t\t\t\tMult: []*qdrant.Expression{\n\t\t\t\t\t\t\tqdrant.NewExpressionConstant(0.25),\n\t\t\t\t\t\t\tqdrant.NewExpressionCondition(qdrant.NewMatchKeywords(\"tag\", \"p\", \"li\")),\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t})\n\n\t// Score boost geographically closer points (as of 1.14.0)\n\tclient.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPrefetch: []*qdrant.PrefetchQuery{\n\t\t\t{\n\t\t\t\tQuery: qdrant.NewQuery(0.2, 0.8),\n\t\t\t},\n\t\t},\n\t\tQuery: qdrant.NewQueryFormula(&qdrant.Formula{\n\t\t\tExpression: qdrant.NewExpressionSum(&qdrant.SumExpression{\n\t\t\t\tSum: []*qdrant.Expression{\n\t\t\t\t\tqdrant.NewExpressionVariable(\"$score\"),\n\t\t\t\t\tqdrant.NewExpressionExpDecay(&qdrant.DecayParamsExpression{\n\t\t\t\t\t\tX: qdrant.NewExpressionGeoDistance(&qdrant.GeoDistance{\n\t\t\t\t\t\t\tOrigin: &qdrant.GeoPoint{\n\t\t\t\t\t\t\t\tLat: 52.504043,\n\t\t\t\t\t\t\t\tLon: 13.393236,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tTo: \"geo.location\",\n\t\t\t\t\t\t}),\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t}),\n\t\t\tDefaults: qdrant.NewValueMap(map[string]any{\n\t\t\t\t\"geo.location\": map[string]any{\n\t\t\t\t\t\"lat\": 48.137154,\n\t\t\t\t\t\"lon\": 11.576124,\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t})\n}\n" language: go - code-samples: - - code: "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: "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: "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 description: Universally query points. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries. summary: Query points tags: @@ -940,27 +940,27 @@ paths: /collections/{collection_name}/points/query/batch: post: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.QueryBatchAsync(\n\tcollectionName: \"{collection_name}\",\n\tqueries: new List\n\t{\n\t\tnew() { Query = new float[] { 0.1f, 0.2f, 0.3f }, },\n\t\tnew() { Query = new float[] { 0.4f, 0.5f, 0.6f }, }\n\t}\n);\n" - language: csharp - code-samples: - code: "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: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"query\": [\n 0.23,\n 0.325,\n 0.623\n ],\n \"limit\": 1\n },\n {\n \"query\": [\n 0.423,\n 0.23,\n 0.623\n ],\n \"limit\": 5,\n \"using\": \"image-vector\"\n }\n ]\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nnearest = client.query_batch_points(\n collection_name=\"{collection_name}\",\n requests=[\n models.QueryRequest(\n query=[0.01, 0.45, 0.67, ...],\n ),\n models.QueryRequest(\n query=[0.11, 0.35, 0.6, ...],\n ),\n ]\n)" language: python - code-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: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"query\": [\n 0.23,\n 0.325,\n 0.623\n ],\n \"limit\": 1\n },\n {\n \"query\": [\n 0.423,\n 0.23,\n 0.623\n ],\n \"limit\": 5,\n \"using\": \"image-vector\"\n }\n ]\n}'" + language: curl + - code-samples: + - code: "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: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc queryBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresults, err := client.QueryBatch(context.Background(), &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\t\t},\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQuery(0.11, 0.35, 0.6),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.queryBatch(\"{collection_name\", {\n searches: [{\n query: [0.01, 0.45, 0.67]\n },\n {\n query: [0.11, 0.35, 0.6]\n }]\n});\n" - language: typescript + - 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: "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 description: Universally query points in batch. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries. summary: Query points in batch tags: @@ -968,27 +968,27 @@ paths: /collections/{collection_name}/points/query/groups: post: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.QueryGroupsAsync(\n collectionName: \"{collection_name}\",\n groupBy: \"document_id\",\n groupSize: 5,\n limit: 10,\n query: new float[] {\n 0.01f, 0.45f, 0.67f\n }\n);\n" - language: csharp - code-samples: - code: "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: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query/groups' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"query\": [\n 0.324,\n 0.643,\n 0.423\n ],\n \"group_by\": \"document_id\",\n \"limit\": 1,\n \"group_size\": 5\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.query_points_groups(\n collection_name=\"{collection_name}\",\n query=[0.01, 0.45, 0.67],\n group_by=\"document_id\",\n limit=10,\n group_size=5,\n)" language: python - code-samples: - - code: "import java.util.List;\n\nimport static io.qdrant.client.QueryFactory.nearest;\n\nimport io.qdrant.client.grpc.Points.QueryPointGroups;\nimport io.qdrant.client.grpc.Points.QueryPoints;\n\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .queryGroupsAsync(\n QueryPointGroups.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setGroupBy(\"document_id\")\n .setGroupSize(5)\n .setLimit(10)\n .setQuery(nearest(List.of(0.01f, 0.45f, 0.67f)))\n .build())\n .get();\n" - language: java + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query/groups' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"query\": [\n 0.324,\n 0.643,\n 0.423\n ],\n \"group_by\": \"document_id\",\n \"limit\": 1,\n \"group_size\": 5\n}'" + language: curl + - code-samples: + - code: "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: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc queryGroups() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tgroupSize := uint64(5)\n\tresults, err := client.QueryGroups(context.Background(), &qdrant.QueryPointGroups{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\tGroupBy: \"document_id\",\n\t\tGroupSize: &groupSize,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.queryGroups(\"{collection_name}\", {\n query: [0.01, 0.45, 0.67],\n group_by: \"document_id\",\n limit: 10,\n group_size: 5,\n});\n" - language: typescript + - 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: "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 description: Universally query points and group results by a specified payload field. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries. summary: Query point groups tags: @@ -996,27 +996,27 @@ paths: /collections/{collection_name}/points/recommend: post: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendAsync(\n \"{collection_name}\",\n positive: new ulong[] { 100, 231 },\n negative: new ulong[] { 718 },\n filter: MatchKeyword(\"city\", \"London\"),\n limit: 3\n);\n" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{Condition, Filter, RecommendPointsBuilder, RecommendStrategy};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .recommend(\n RecommendPointsBuilder::new(\"{collection_name}\", 3)\n .add_positive(100)\n .add_positive(200)\n .add_positive(vec![100.0, 231.0])\n .add_negative(718)\n .add_negative(vec![0.2, 0.3, 0.4, 0.5])\n .strategy(RecommendStrategy::AverageVector)\n .filter(Filter::must([Condition::matches(\n \"city\",\n \"London\".to_string(),\n )])),\n )\n .await?;\n" language: rust - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"positive\": [\n 100,\n 231\n ],\n \"negative\": [\n \"3a6e2150-f7b7-496e-92cd-687e63e215fd\",\n [\n 0.2,\n 0.3,\n 0.4,\n 0.5\n ]\n ],\n \"filter\": {\n \"must\": [\n {\n \"key\": \"city\",\n \"match\": {\n \"value\": \"London\"\n }\n }\n ]\n },\n \"limit\": 1\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.recommend(\n collection_name=\"{collection_name}\",\n positive=[100, 231],\n negative=[718, [0.2, 0.3, 0.4, 0.5]],\n strategy=models.RecommendStrategy.AVERAGE_VECTOR,\n query_filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"city\",\n match=models.MatchValue(\n value=\"London\",\n ),\n )\n ]\n ),\n limit=3,\n)\n" language: python - code-samples: - - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\nimport static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.RecommendPoints;\nimport io.qdrant.client.grpc.Points.RecommendStrategy;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .recommendAsync(\n RecommendPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .addAllPositive(List.of(id(100), id(200)))\n .addAllPositiveVectors(List.of(vector(100.0f, 231.0f)))\n .addAllNegative(List.of(id(718)))\n .addAllPositiveVectors(List.of(vector(0.2f, 0.3f, 0.4f, 0.5f)))\n .setStrategy(RecommendStrategy.AverageVector)\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\")))\n .setLimit(3)\n .build())\n .get();\n" - language: java + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"positive\": [\n 100,\n 231\n ],\n \"negative\": [\n \"3a6e2150-f7b7-496e-92cd-687e63e215fd\",\n [\n 0.2,\n 0.3,\n 0.4,\n 0.5\n ]\n ],\n \"filter\": {\n \"must\": [\n {\n \"key\": \"city\",\n \"match\": {\n \"value\": \"London\"\n }\n }\n ]\n },\n \"limit\": 1\n}'" + language: curl + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.recommend(\"{collection_name}\", {\n positive: [100, 231],\n negative: [718, [0.2, 0.3, 0.4, 0.5]],\n strategy: \"average_vector\",\n filter: {\n must: [\n {\n key: \"city\",\n match: {\n value: \"London\",\n },\n },\n ],\n },\n limit: 3,\n});\n" + language: typescript - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc recommend() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresults, err := client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(231)),\n\t\t\t},\n\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\t\t\t\tqdrant.NewVectorInput(0.2, 0.3, 0.4, 0.5),\n\t\t\t},\n\t\t\tStrategy: qdrant.RecommendStrategy_AverageVector.Enum(),\n\t\t}),\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"city\", \"London\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.recommend(\"{collection_name}\", {\n positive: [100, 231],\n negative: [718, [0.2, 0.3, 0.4, 0.5]],\n strategy: \"average_vector\",\n filter: {\n must: [\n {\n key: \"city\",\n match: {\n value: \"London\",\n },\n },\n ],\n },\n limit: 3,\n});\n" - language: typescript + - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\nimport static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.RecommendPoints;\nimport io.qdrant.client.grpc.Points.RecommendStrategy;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .recommendAsync(\n RecommendPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .addAllPositive(List.of(id(100), id(200)))\n .addAllPositiveVectors(List.of(vector(100.0f, 231.0f)))\n .addAllNegative(List.of(id(718)))\n .addAllPositiveVectors(List.of(vector(0.2f, 0.3f, 0.4f, 0.5f)))\n .setStrategy(RecommendStrategy.AverageVector)\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\")))\n .setLimit(3)\n .build())\n .get();\n" + language: java + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendAsync(\n \"{collection_name}\",\n positive: new ulong[] { 100, 231 },\n negative: new ulong[] { 718 },\n filter: MatchKeyword(\"city\", \"London\"),\n limit: 3\n);\n" + language: csharp description: Retrieves points that are closer to stored positive examples and further from negative examples. summary: Recommend points tags: @@ -1024,27 +1024,27 @@ paths: /collections/{collection_name}/points/recommend/batch: post: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter = MatchKeyword(\"city\", \"london\");\n\nawait client.RecommendBatchAsync(\n collectionName: \"{collection_name}\",\n recommendSearches:\n [\n new()\n {\n CollectionName = \"{collection_name}\",\n Positive = { new PointId[] { 100, 231 } },\n Negative = { new PointId[] { 718 } },\n Limit = 3,\n Filter = filter,\n },\n new()\n {\n CollectionName = \"{collection_name}\",\n Positive = { new PointId[] { 200, 67 } },\n Negative = { new PointId[] { 300 } },\n Limit = 3,\n Filter = filter,\n }\n ]\n);\n" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{\n Condition, Filter, RecommendBatchPointsBuilder, RecommendPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet filter = Filter::must([Condition::matches(\"city\", \"London\".to_string())]);\nlet recommend_queries = vec![\n RecommendPointsBuilder::new(\"{collection_name}\", 3)\n .add_positive(100)\n .add_positive(231)\n .add_negative(718)\n .filter(filter.clone())\n .build(),\n RecommendPointsBuilder::new(\"{collection_name}\", 3)\n .add_positive(200)\n .add_positive(67)\n .add_negative(300)\n .filter(filter.clone())\n .build(),\n];\n\nclient\n .recommend_batch(RecommendBatchPointsBuilder::new(\n \"{collection_name}\",\n recommend_queries,\n ))\n .await?;\n" language: rust - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"positive\": [\n 100,\n 231\n ],\n \"negative\": [\n \"9ad0884a-7bfe-43c0-b88f-c1d9a588b7e1\"\n ],\n \"limit\": 1\n },\n {\n \"positive\": [\n 200,\n 67\n ],\n \"negative\": [\n 300\n ],\n \"limit\": 5\n }\n ]\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nrecommend_queries = [\n models.RecommendRequest(\n positive=[100, 231], negative=[718], filter=filter_, limit=3\n ),\n models.RecommendRequest(positive=[200, 67], negative=[300], limit=3),\n]\n\nclient.recommend_batch(collection_name=\"{collection_name}\", requests=recommend_queries)\n" language: python - code-samples: - - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\nimport static io.qdrant.client.PointIdFactory.id;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.RecommendPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\")).build();\n\nList recommendQueries =\n List.of(\n RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(100), id(231)))\n .addAllNegative(List.of(id(718)))\n .setFilter(filter)\n .setLimit(3)\n .build(),\n RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(200), id(67)))\n .addAllNegative(List.of(id(300)))\n .setFilter(filter)\n .setLimit(3)\n .build());\n\nclient.recommendBatchAsync(\"{collection_name}\", recommendQueries, null).get();\n" - language: java + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"positive\": [\n 100,\n 231\n ],\n \"negative\": [\n \"9ad0884a-7bfe-43c0-b88f-c1d9a588b7e1\"\n ],\n \"limit\": 1\n },\n {\n \"positive\": [\n 200,\n 67\n ],\n \"negative\": [\n 300\n ],\n \"limit\": 5\n }\n ]\n}'" + language: curl + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nconst searches = [\n {\n positive: [100, 231],\n negative: [718],\n limit: 3,\n },\n {\n positive: [200, 67],\n negative: [300],\n limit: 3,\n },\n];\n\nclient.recommend_batch(\"{collection_name}\", {\n searches,\n});\n" + language: typescript - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc recommendBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresults, err := client.QueryBatch(context.Background(), &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\t\t\t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(231)),\n\t\t\t\t\t},\n\t\t\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\t\t\t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(67)),\n\t\t\t\t\t},\n\t\t\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(300)),\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nconst searches = [\n {\n positive: [100, 231],\n negative: [718],\n limit: 3,\n },\n {\n positive: [200, 67],\n negative: [300],\n limit: 3,\n },\n];\n\nclient.recommend_batch(\"{collection_name}\", {\n searches,\n});\n" - language: typescript + - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\nimport static io.qdrant.client.PointIdFactory.id;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.RecommendPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\")).build();\n\nList recommendQueries =\n List.of(\n RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(100), id(231)))\n .addAllNegative(List.of(id(718)))\n .setFilter(filter)\n .setLimit(3)\n .build(),\n RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(200), id(67)))\n .addAllNegative(List.of(id(300)))\n .setFilter(filter)\n .setLimit(3)\n .build());\n\nclient.recommendBatchAsync(\"{collection_name}\", recommendQueries, null).get();\n" + language: java + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter = MatchKeyword(\"city\", \"london\");\n\nawait client.RecommendBatchAsync(\n collectionName: \"{collection_name}\",\n recommendSearches:\n [\n new()\n {\n CollectionName = \"{collection_name}\",\n Positive = { new PointId[] { 100, 231 } },\n Negative = { new PointId[] { 718 } },\n Limit = 3,\n Filter = filter,\n },\n new()\n {\n CollectionName = \"{collection_name}\",\n Positive = { new PointId[] { 200, 67 } },\n Negative = { new PointId[] { 300 } },\n Limit = 3,\n Filter = filter,\n }\n ]\n);\n" + language: csharp description: Retrieves points in batches that are closer to stored positive examples and further from negative examples. summary: Recommend batch points tags: @@ -1052,27 +1052,27 @@ paths: /collections/{collection_name}/points/recommend/groups: post: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendGroupsAsync(\n \"{collection_name}\",\n \"document_id\",\n groupSize: 3,\n positive: new ulong[] { 100, 231 },\n negative: new ulong[] { 718 },\n filter: MatchKeyword(\"city\", \"London\"),\n limit: 3\n);\n" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{RecommendPointGroupsBuilder, RecommendStrategy};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .recommend_groups(\n RecommendPointGroupsBuilder::new(\"{collection_name}\", \"document_id\", 2, 3)\n .add_positive(100)\n .add_positive(200)\n .add_negative(718)\n .strategy(RecommendStrategy::AverageVector),\n )\n .await?;\n" language: rust - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend/groups' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"positive\": [\n 100,\n 231\n ],\n \"negative\": [\n 718\n ],\n \"group_by\": \"document_id\",\n \"limit\": 3,\n \"group_size\": 2\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.recommend_groups(\n collection_name=\"{collection_name}\",\n positive=[100, 231],\n negative=[718],\n group_by=\"document_id\",\n limit=3,\n group_size=2,\n)\n" language: python - code-samples: - - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.RecommendPointGroups;\nimport io.qdrant.client.grpc.Points.RecommendStrategy;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.recommendGroupsAsync(RecommendPointGroups.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setGroupBy(\"document_id\")\n .setGroupSize(2)\n .addAllPositive(List.of(id(100), id(200)))\n .addAllNegative(List.of(id(718)))\n .setStrategy(RecommendStrategy.AverageVector)\n .setLimit(3)\n .build());\n" - language: java + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend/groups' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"positive\": [\n 100,\n 231\n ],\n \"negative\": [\n 718\n ],\n \"group_by\": \"document_id\",\n \"limit\": 3,\n \"group_size\": 2\n}'" + language: curl + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.recommendPointGroups(\"{collection_name}\", {\n positive: [100, 231],\n negative: [718],\n group_by: \"document_id\",\n limit: 3,\n group_size: 2,\n});\n" + language: typescript - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc recommendGroups() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tgroupSize := uint64(5)\n\tresults, err := client.QueryGroups(context.Background(), &qdrant.QueryPointGroups{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(231)),\n\t\t\t},\n\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\t\t\t},\n\t\t}),\n\t\tGroupBy: \"document_id\",\n\t\tGroupSize: &groupSize,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.recommendPointGroups(\"{collection_name}\", {\n positive: [100, 231],\n negative: [718],\n group_by: \"document_id\",\n limit: 3,\n group_size: 2,\n});\n" - language: typescript + - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.RecommendPointGroups;\nimport io.qdrant.client.grpc.Points.RecommendStrategy;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.recommendGroupsAsync(RecommendPointGroups.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setGroupBy(\"document_id\")\n .setGroupSize(2)\n .addAllPositive(List.of(id(100), id(200)))\n .addAllNegative(List.of(id(718)))\n .setStrategy(RecommendStrategy.AverageVector)\n .setLimit(3)\n .build());\n" + language: java + - code-samples: + - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendGroupsAsync(\n \"{collection_name}\",\n \"document_id\",\n groupSize: 3,\n positive: new ulong[] { 100, 231 },\n negative: new ulong[] { 718 },\n filter: MatchKeyword(\"city\", \"London\"),\n limit: 3\n);\n" + language: csharp description: Retrieves points that are closer to stored positive examples and further from negative examples. Results are grouped by the specified payload field. summary: Recommend point groups tags: @@ -1080,27 +1080,27 @@ paths: /collections/{collection_name}/points/scroll: post: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.ScrollAsync(\n collectionName: \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"),\n limit: 1,\n payloadSelector: true\n);\n" - language: csharp - code-samples: - code: "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: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/scroll' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"with_payload\": [\n \"city\",\n \"color\"\n ],\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n },\n \"limit\": 2,\n \"with_vector\": false\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.scroll(\n collection_name=\"{collection_name}\",\n scroll_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n limit=1,\n with_payload=True,\n with_vectors=False,\n)\n" language: python - code-samples: - - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\nimport static io.qdrant.client.WithPayloadSelectorFactory.enable;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.ScrollPoints;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .scrollAsync(\n ScrollPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"color\", \"red\")).build())\n .setLimit(1)\n .setWithPayload(enable(true))\n .build())\n .get();\n" - language: java + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/scroll' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"with_payload\": [\n \"city\",\n \"color\"\n ],\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n },\n \"limit\": 2,\n \"with_vector\": false\n}'" + language: curl + - code-samples: + - code: "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: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc scroll() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tlimit := uint32(1)\n\tresults, err := client.Scroll(context.Background(), &qdrant.ScrollPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t},\n\t\tLimit: &limit,\n\t\tWithPayload: qdrant.NewWithPayloadEnable(true),\n\t\tWithVectors: qdrant.NewWithVectorsEnable(false),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.scroll(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n limit: 1,\n with_payload: true,\n with_vector: false,\n});\n" - language: typescript + - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\nimport static io.qdrant.client.WithPayloadSelectorFactory.enable;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.ScrollPoints;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .scrollAsync(\n ScrollPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"color\", \"red\")).build())\n .setLimit(1)\n .setWithPayload(enable(true))\n .build())\n .get();\n" + language: java + - code-samples: + - code: "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 description: 'Returns all points in a page-by-page manner. By default, all resulting points are sorted by {id}. @@ -1116,27 +1116,27 @@ paths: /collections/{collection_name}/points/search: post: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchAsync(\n collectionName: \"{collection_name}\",\n vector: new float[] { 0.2f, 0.1f, 0.9f, 0.7f },\n filter: MatchKeyword(\"city\", \"London\"),\n limit: 3\n);\n" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{Condition, Filter, SearchParamsBuilder, SearchPointsBuilder};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .search_points(\n SearchPointsBuilder::new(\"{collection_name}\", vec![0.2, 0.1, 0.9, 0.7], 3)\n .filter(Filter::must([Condition::matches(\n \"city\",\n \"London\".to_string(),\n )]))\n .params(SearchParamsBuilder::default().hnsw_ef(128).exact(false)),\n )\n .await?;\n" language: rust - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"limit\": 1,\n \"filter\": {\n \"must\": [\n {\n \"key\": \"city\",\n \"match\": {\n \"value\": \"London\"\n }\n }\n ]\n }\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.search(\n collection_name=\"{collection_name}\",\n query_filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"city\",\n match=models.MatchValue(\n value=\"London\",\n ),\n )\n ]\n ),\n query_vector=[0.2, 0.1, 0.9, 0.7],\n limit=3,\n)\n" language: python - code-samples: - - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .searchAsync(\n SearchPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\")).build())\n .addAllVector(List.of(0.2f, 0.1f, 0.9f, 0.7f))\n .setLimit(3)\n .build())\n .get();\n" - language: java + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"limit\": 1,\n \"filter\": {\n \"must\": [\n {\n \"key\": \"city\",\n \"match\": {\n \"value\": \"London\"\n }\n }\n ]\n }\n}'" + language: curl + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.search(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"city\",\n match: {\n value: \"London\",\n },\n },\n ],\n },\n vector: [0.2, 0.1, 0.9, 0.7],\n limit: 3,\n});\n" + language: typescript - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc search() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tlimit := uint64(3)\n\tresults, err := client.Query(context.Background(), &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQuery(0.2, 0.1, 0.9, 0.7),\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"city\", \"London\"),\n\t\t\t},\n\t\t},\n\t\tLimit: &limit,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.search(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"city\",\n match: {\n value: \"London\",\n },\n },\n ],\n },\n vector: [0.2, 0.1, 0.9, 0.7],\n limit: 3,\n});\n" - language: typescript + - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .searchAsync(\n SearchPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\")).build())\n .addAllVector(List.of(0.2f, 0.1f, 0.9f, 0.7f))\n .setLimit(3)\n .build())\n .get();\n" + language: java + - code-samples: + - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchAsync(\n collectionName: \"{collection_name}\",\n vector: new float[] { 0.2f, 0.1f, 0.9f, 0.7f },\n filter: MatchKeyword(\"city\", \"London\"),\n limit: 3\n);\n" + language: csharp description: Retrieves the closest points based on vector similarity and given filtering conditions. summary: Search points tags: @@ -1144,27 +1144,27 @@ paths: /collections/{collection_name}/points/search/batch: post: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter = MatchKeyword(\"city\", \"London\");\n\nvar searches = new List\n{\n new()\n {\n Vector = { new float[] { 0.2f, 0.1f, 0.9f, 0.7f } },\n Filter = filter,\n Limit = 3\n },\n new()\n {\n Vector = { new float[] { 0.5f, 0.3f, 0.2f, 0.3f } },\n Filter = filter,\n Limit = 3\n }\n};\n\nawait client.SearchBatchAsync(collectionName: \"{collection_name}\", searches: searches);\n" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{\n Condition, Filter, SearchBatchPointsBuilder, SearchPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nlet filter = Filter::must([Condition::matches(\"city\", \"London\".to_string())]);\n\nlet searches = vec![\n SearchPointsBuilder::new(\"{collection_name}\", vec![0.2, 0.1, 0.9, 0.7], 3)\n .filter(filter.clone())\n .build(),\n SearchPointsBuilder::new(\"{collection_name}\", vec![0.5, 0.3, 0.2, 0.3], 3)\n .filter(filter.clone())\n .build(),\n];\n\nclient\n .search_batch_points(SearchBatchPointsBuilder::new(\"{collection_name}\", searches))\n .await?;\n" language: rust - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"limit\": 3\n },\n {\n \"vector\": [\n 0.5,\n 0.3,\n 0.2,\n 0.3\n ],\n \"filter\": {\n \"must\": [\n {\n \"key\": \"city\",\n \"match\": {\n \"value\": \"London\"\n }\n }\n ]\n },\n \"limit\": 3\n }\n ]\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nfilter_ = models.Filter(\n must=[\n models.FieldCondition(\n key=\"city\",\n match=models.MatchValue(\n value=\"London\",\n ),\n )\n ]\n)\n\nsearch_queries = [\n models.SearchRequest(vector=[0.2, 0.1, 0.9, 0.7], filter=filter_, limit=3),\n models.SearchRequest(vector=[0.5, 0.3, 0.2, 0.3], filter=filter_, limit=3),\n]\n\nclient.search_batch(collection_name=\"{collection_name}\", requests=search_queries)\n" language: python - code-samples: - - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\")).build();\nList searches =\n List.of(\n SearchPoints.newBuilder()\n .addAllVector(List.of(0.2f, 0.1f, 0.9f, 0.7f))\n .setFilter(filter)\n .setLimit(3)\n .build(),\n SearchPoints.newBuilder()\n .addAllVector(List.of(0.5f, 0.3f, 0.2f, 0.3f))\n .setFilter(filter)\n .setLimit(3)\n .build());\nclient.searchBatchAsync(\"{collection_name}\", searches, null).get();\n" - language: java + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search/batch' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"limit\": 3\n },\n {\n \"vector\": [\n 0.5,\n 0.3,\n 0.2,\n 0.3\n ],\n \"filter\": {\n \"must\": [\n {\n \"key\": \"city\",\n \"match\": {\n \"value\": \"London\"\n }\n }\n ]\n },\n \"limit\": 3\n }\n ]\n}'" + language: curl + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nconst filter = {\n must: [\n {\n key: \"city\",\n match: {\n value: \"London\",\n },\n },\n ],\n};\n\nconst searches = [\n {\n vector: [0.2, 0.1, 0.9, 0.7],\n filter,\n limit: 3,\n },\n {\n vector: [0.5, 0.3, 0.2, 0.3],\n filter,\n limit: 3,\n },\n];\n\nclient.searchBatch(\"{collection_name}\", {\n searches,\n});\n" + language: typescript - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc searchBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfilter := qdrant.Filter{\n\t\tMust: []*qdrant.Condition{\n\t\t\tqdrant.NewMatch(\"city\", \"London\"),\n\t\t},\n\t}\n\tlimit := uint64(3)\n\tresults, err := client.QueryBatch(context.Background(), &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQuery(0.2, 0.1, 0.9, 0.7),\n\t\t\t\tLimit: &limit,\n\t\t\t\tFilter: &filter,\n\t\t\t},\n\t\t\t{\n\t\t\t\tCollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQuery(0.5, 0.3, 0.2, 0.3),\n\t\t\t\tLimit: &limit,\n\t\t\t\tFilter: &filter,\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nconst filter = {\n must: [\n {\n key: \"city\",\n match: {\n value: \"London\",\n },\n },\n ],\n};\n\nconst searches = [\n {\n vector: [0.2, 0.1, 0.9, 0.7],\n filter,\n limit: 3,\n },\n {\n vector: [0.5, 0.3, 0.2, 0.3],\n filter,\n limit: 3,\n },\n];\n\nclient.searchBatch(\"{collection_name}\", {\n searches,\n});\n" - language: typescript + - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\")).build();\nList searches =\n List.of(\n SearchPoints.newBuilder()\n .addAllVector(List.of(0.2f, 0.1f, 0.9f, 0.7f))\n .setFilter(filter)\n .setLimit(3)\n .build(),\n SearchPoints.newBuilder()\n .addAllVector(List.of(0.5f, 0.3f, 0.2f, 0.3f))\n .setFilter(filter)\n .setLimit(3)\n .build());\nclient.searchBatchAsync(\"{collection_name}\", searches, null).get();\n" + language: java + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter = MatchKeyword(\"city\", \"London\");\n\nvar searches = new List\n{\n new()\n {\n Vector = { new float[] { 0.2f, 0.1f, 0.9f, 0.7f } },\n Filter = filter,\n Limit = 3\n },\n new()\n {\n Vector = { new float[] { 0.5f, 0.3f, 0.2f, 0.3f } },\n Filter = filter,\n Limit = 3\n }\n};\n\nawait client.SearchBatchAsync(collectionName: \"{collection_name}\", searches: searches);\n" + language: csharp description: Retrieves the closest points in batches based on vector similarity and given filtering conditions. summary: Search batch points tags: @@ -1172,27 +1172,27 @@ paths: /collections/{collection_name}/points/search/groups: post: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchGroupsAsync(\n collectionName: \"{collection_name}\",\n vector: new float[] { 1.1f },\n groupBy: \"document_id\",\n limit: 4,\n groupSize: 2\n);\n" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::SearchPointGroupsBuilder;\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\nclient\n .search_groups(SearchPointGroupsBuilder::new(\n \"{collection_name}\",\n vec![1.1],\n 4,\n \"document_id\",\n 2,\n ))\n .await?;\n" language: rust - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search/groups' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"group_by\": \"document_id\",\n \"limit\": 4,\n \"group_size\": 2\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.search_groups(\n collection_name=\"{collection_name}\",\n query_vector=[1.1],\n group_by=\"document_id\",\n limit=4,\n group_size=2,\n)\n" language: python - code-samples: - - code: "import java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.SearchPointGroups;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .searchGroupsAsync(\n SearchPointGroups.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .addAllVector(List.of(1.1f))\n .setGroupBy(\"document_id\")\n .setLimit(4)\n .setGroupSize(2)\n .build())\n .get();\n" - language: java + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search/groups' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"vector\": [\n 0.2,\n 0.1,\n 0.9,\n 0.7\n ],\n \"group_by\": \"document_id\",\n \"limit\": 4,\n \"group_size\": 2\n}'" + language: curl + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.searchPointGroups(\"{collection_name}\", {\n vector: [1.1],\n group_by: \"document_id\",\n limit: 4,\n group_size: 2,\n});\n" + language: typescript - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc searchGroups() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tgroupSize := uint64(2)\n\tresults, err := client.QueryGroups(context.Background(), &qdrant.QueryPointGroups{\n\t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\tGroupBy: \"document_id\",\n\t\tGroupSize: &groupSize,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.searchPointGroups(\"{collection_name}\", {\n vector: [1.1],\n group_by: \"document_id\",\n limit: 4,\n group_size: 2,\n});\n" - language: typescript + - code: "import java.util.List;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.SearchPointGroups;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .searchGroupsAsync(\n SearchPointGroups.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .addAllVector(List.of(1.1f))\n .setGroupBy(\"document_id\")\n .setLimit(4)\n .setGroupSize(2)\n .build())\n .get();\n" + language: java + - code-samples: + - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchGroupsAsync(\n collectionName: \"{collection_name}\",\n vector: new float[] { 1.1f },\n groupBy: \"document_id\",\n limit: 4,\n groupSize: 2\n);\n" + language: csharp description: Retrieves the closest points based on vector similarity and given filtering conditions, grouped by a given payload field. summary: Search point groups tags: @@ -1200,9 +1200,6 @@ paths: /collections/{collection_name}/points/search/matrix/offsets: post: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchMatrixOffsetsAsync(\n \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"),\n sample: 100,\n limit: 5\n);" - language: csharp - code-samples: - code: "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 @@ -1210,14 +1207,17 @@ paths: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.search_matrix_offsets(\n collection_name=\"{collection_name}\",\n sample=100,\n limit=5,\n query_filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"color\", match=models.MatchValue(value=\"red\")\n ),\n ]\n ),\n)" language: python - code-samples: - - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchMatrixPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .searchMatrixOffsetsAsync(\n SearchMatrixPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setFilter(\n Filter.newBuilder()\n .addMust(matchKeyword(\"color\", \"red\"))\n .build()\n )\n .setSample(100)\n .setLimit(5)\n .build())\n .get();\n" - language: java + - code: "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: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc searchMatiOffsets() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsample := uint64(100)\n\tlimit := uint64(5)\n\tresults, err := client.SearchMatrixOffsets(context.Background(), &qdrant.SearchMatrixPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tSample: &sample,\n\t\tLimit: &limit,\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.searchMatrixOffsets(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n sample: 100,\n limit: 5,\n});\n" - language: typescript + - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchMatrixPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .searchMatrixOffsetsAsync(\n SearchMatrixPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setFilter(\n Filter.newBuilder()\n .addMust(matchKeyword(\"color\", \"red\"))\n .build()\n )\n .setSample(100)\n .setLimit(5)\n .build())\n .get();\n" + language: java + - code-samples: + - code: "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 description: Retrieves sparse matrix of pairwise distances between points sampled from the collection. Output is a form of row and column offsets and list of distances. summary: Distance matrix offsets tags: @@ -1225,9 +1225,6 @@ paths: /collections/{collection_name}/points/search/matrix/pairs: post: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchMatrixPairsAsync(\n \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"),\n sample: 100,\n limit: 5\n);" - language: csharp - code-samples: - code: "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 @@ -1235,14 +1232,17 @@ paths: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.search_matrix_pairs(\n collection_name=\"{collection_name}\",\n sample=100,\n limit=5,\n query_filter=models.Filter(\n must=[\n models.FieldCondition(\n key=\"color\", match=models.MatchValue(value=\"red\")\n ),\n ]\n ),\n)" language: python - code-samples: - - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchMatrixPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .searchMatrixPairsAsync(\n SearchMatrixPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setFilter(\n Filter.newBuilder()\n .addMust(matchKeyword(\"color\", \"red\"))\n .build()\n )\n .setSample(100)\n .setLimit(5)\n .build())\n .get();\n" - language: java + - code: "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: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc searchMatixPairs() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsample := uint64(100)\n\tlimit := uint64(5)\n\tresults, err := client.SearchMatrixPairs(context.Background(), &qdrant.SearchMatrixPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\tSample: &sample,\n\t\tLimit: &limit,\n\t\tFilter: &qdrant.Filter{\n\t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"color\", \"red\"),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.searchMatrixPairs(\"{collection_name}\", {\n filter: {\n must: [\n {\n key: \"color\",\n match: {\n value: \"red\",\n },\n },\n ],\n },\n sample: 100,\n limit: 5,\n});" - language: typescript + - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchMatrixPoints;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient\n .searchMatrixPairsAsync(\n SearchMatrixPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setFilter(\n Filter.newBuilder()\n .addMust(matchKeyword(\"color\", \"red\"))\n .build()\n )\n .setSample(100)\n .setLimit(5)\n .build())\n .get();\n" + language: java + - code-samples: + - code: "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 description: Retrieves sparse matrix of pairwise distances between points sampled from the collection. Output is a list of pairs of points and their distances. summary: Distance matrix pairs tags: @@ -1250,27 +1250,27 @@ paths: /collections/{collection_name}/points/vectors: put: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateVectorsAsync(\n collectionName: \"{collection_name}\",\n points: new List\n {\n new() { Id = 1, Vectors = (\"image\", new float[] { 0.1f, 0.2f, 0.3f, 0.4f }) },\n new()\n {\n Id = 2,\n Vectors = (\"text\", new float[] { 0.9f, 0.8f, 0.7f, 0.6f, 0.5f, 0.4f, 0.3f, 0.2f })\n }\n }\n);\n" - language: csharp - code-samples: - code: "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: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points/vectors?wait=true' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"points\": [\n {\n \"id\": 1,\n \"vector\": [\n 0.0984,\n 0.1406,\n 0.8973\n ]\n },\n {\n \"id\": 2,\n \"vector\": {\n \"vector-name\": [\n 0.9,\n 0.8,\n 0.7,\n 0.6\n ]\n }\n }\n ]\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.update_vectors(\n collection_name=\"{collection_name}\",\n points=[\n models.PointVectors(\n id=1,\n vector={\n \"image\": [0.1, 0.2, 0.3, 0.4],\n },\n ),\n models.PointVectors(\n id=2,\n vector={\n \"text\": [0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n ),\n ],\n)\n" language: python - code-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: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points/vectors?wait=true' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"points\": [\n {\n \"id\": 1,\n \"vector\": [\n 0.0984,\n 0.1406,\n 0.8973\n ]\n },\n {\n \"id\": 2,\n \"vector\": {\n \"vector-name\": [\n 0.9,\n 0.8,\n 0.7,\n 0.6\n ]\n }\n }\n ]\n}'" + language: curl + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\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: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc updateVectors() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.UpdateVectors(context.Background(), &qdrant.UpdatePointVectors{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPoints: []*qdrant.PointVectors{\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(1),\n\t\t\t\tVectors: qdrant.NewVectorsMap(map[string]*qdrant.Vector{\n\t\t\t\t\t\"image\": qdrant.NewVector(0.1, 0.2, 0.3, 0.4),\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(2),\n\t\t\t\tVectors: qdrant.NewVectorsMap(map[string]*qdrant.Vector{\n\t\t\t\t\t\"text\": qdrant.NewVector(0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2),\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.updateVectors(\"{collection_name}\", {\n points: [\n {\n id: 1,\n vector: {\n image: [0.1, 0.2, 0.3, 0.4],\n },\n },\n {\n id: 2,\n vector: {\n text: [0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n },\n ],\n});\n" - language: typescript + - 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: "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 description: Updates specified vectors on points. All other unspecified vectors will stay intact. summary: Update vectors tags: @@ -1278,35 +1278,35 @@ paths: /collections/{collection_name}/points/vectors/delete: post: x-fern-examples: - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.DeleteVectorsAsync("{collection_name}", ["text", "image"], [0, 3, 10]); - -' - language: csharp - code-samples: - code: "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: "# Delete vectors by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/vectors/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"points\": [\n 0,\n 3,\n 10\n ],\n \"vectors\": [\n \"text\",\n \"image\"\n ]\n}'\n\n# Delete vectors by filter\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/vectors/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n },\n \"vectors\": [\n \"text\",\n \"image\"\n ]\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete_vectors(\n collection_name=\"{collection_name}\",\n points=[0, 3, 100],\n vectors=[\"text\", \"image\"],\n)\n" language: python - code-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: "# Delete vectors by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/vectors/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"points\": [\n 0,\n 3,\n 10\n ],\n \"vectors\": [\n \"text\",\n \"image\"\n ]\n}'\n\n# Delete vectors by filter\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/vectors/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"filter\": {\n \"must\": [\n {\n \"key\": \"color\",\n \"match\": {\n \"value\": \"red\"\n }\n }\n ]\n },\n \"vectors\": [\n \"text\",\n \"image\"\n ]\n}'" + language: curl + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.deleteVectors(\"{collection_name}\", {\n points: [0, 3, 10],\n vectors: [\"text\", \"image\"],\n});\n" + language: typescript - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteVectors() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = client.DeleteVectors(context.Background(), &qdrant.DeletePointVectors{\n\t\tCollectionName: \"{collection_name}\",\n\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(0), qdrant.NewIDNum(3), qdrant.NewIDNum(100)),\n\t\tVectors: &qdrant.VectorsSelector{\n\t\t\tNames: []string{\"text\", \"image\"},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.deleteVectors(\"{collection_name}\", {\n points: [0, 3, 10],\n vectors: [\"text\", \"image\"],\n});\n" - language: typescript + - 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: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.DeleteVectorsAsync("{collection_name}", ["text", "image"], [0, 3, 10]); + +' + language: csharp description: Deletes specified vectors from points. All other unspecified vectors will stay intact. summary: Delete vectors tags: @@ -1314,15 +1314,9 @@ paths: /collections/{collection_name}/shards: put: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.CreateShardKeyAsync(\n \"{collection_name}\",\n new CreateShardKey { ShardKey = new ShardKey { Keyword = \"{shard_key}\", } }\n);\n" - language: csharp - code-samples: - code: "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: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/shards' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"shard_key\": \"{shard_key}\"\n}'" - language: curl - code-samples: - code: 'from qdrant_client import QdrantClient @@ -1335,14 +1329,20 @@ paths: ' language: python - code-samples: - - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.CreateShardKey;\nimport io.qdrant.client.grpc.Collections.CreateShardKeyRequest;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createShardKeyAsync(CreateShardKeyRequest.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setRequest(CreateShardKey.newBuilder()\n .setShardKey(shardKey(\"{shard_key}\"))\n .build())\n .build()).get();\n" - language: java + - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/shards' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"shard_key\": \"{shard_key}\"\n}'" + language: curl + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n});\n\nclient.createShardKey(\"{collection_name}\", {\n shard_key: \"{shard_key}\"\n});\n" + language: typescript - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc createShardKey() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.CreateShardKey(context.Background(), \"{collection_name}\", &qdrant.CreateShardKey{\n\t\tShardKey: qdrant.NewShardKey(\"{shard_key}\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n});\n\nclient.createShardKey(\"{collection_name}\", {\n shard_key: \"{shard_key}\"\n});\n" - language: typescript + - 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: "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 description: Creates one or more shard keys for a specified collection. summary: Create a shard key tags: @@ -1350,15 +1350,9 @@ paths: /collections/{collection_name}/shards/delete: post: x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.DeleteShardKeyAsync(\n \"{collection_name}\",\n new DeleteShardKey { ShardKey = new ShardKey { Keyword = \"shard_key\", } }\n);\n" - language: csharp - code-samples: - code: "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: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/shards/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"shard_key\": \"{shard_key}\"\n}'" - language: curl - code-samples: - code: 'from qdrant_client import QdrantClient @@ -1371,14 +1365,20 @@ paths: ' language: python - code-samples: - - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Collections.DeleteShardKey;\nimport io.qdrant.client.grpc.Collections.DeleteShardKeyRequest;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteShardKeyAsync(DeleteShardKeyRequest.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setRequest(DeleteShardKey.newBuilder()\n .setShardKey(shardKey(\"{shard_key}\"))\n .build())\n .build()).get();\n" - language: java + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/shards/delete' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"shard_key\": \"{shard_key}\"\n}'" + language: curl + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n});\n\nclient.deleteShardKey(\"{collection_name}\", {\n shard_key: \"{shard_key}\"\n});\n" + language: typescript - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteShardKey() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteShardKey(context.Background(), \"{collection_name}\", &qdrant.DeleteShardKey{\n\t\tShardKey: qdrant.NewShardKey(\"{shard_key}\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n});\n\nclient.deleteShardKey(\"{collection_name}\", {\n shard_key: \"{shard_key}\"\n});\n" - language: typescript + - 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: "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 description: Deletes one or more shard keys for a specified collection. summary: Delete a shard key tags: @@ -1386,17 +1386,6 @@ paths: /collections/{collection_name}/snapshots: get: x-fern-examples: - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ListSnapshotsAsync("{collection_name}"); - -' - language: csharp - code-samples: - code: 'use qdrant_client::Qdrant; @@ -1408,9 +1397,6 @@ paths: ' language: rust - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/snapshots' \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'from qdrant_client import QdrantClient @@ -1423,11 +1409,8 @@ paths: ' language: python - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listSnapshotAsync(\"{collection_name}\").get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc listSnapshots() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsnapshots, err := client.ListSnapshots(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Snapshots: \", snapshots)\n}\n" - language: go + - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/snapshots' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -1439,12 +1422,12 @@ paths: ' language: typescript - 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: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc listSnapshots() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsnapshots, err := client.ListSnapshots(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Snapshots: \", snapshots)\n}\n" + language: go + - code-samples: + - code: "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: 'using Qdrant.Client; @@ -1452,10 +1435,16 @@ paths: var client = new QdrantClient("localhost", 6334); - await client.CreateSnapshotAsync("{collection_name}"); + await client.ListSnapshotsAsync("{collection_name}"); ' language: csharp + 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: 'use qdrant_client::Qdrant; @@ -1467,9 +1456,6 @@ paths: ' language: rust - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/snapshots' \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'from qdrant_client import QdrantClient @@ -1482,11 +1468,8 @@ paths: ' language: python - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createSnapshotAsync(\"{collection_name}\").get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc createSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsnapshot, err := client.CreateSnapshot(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Snapshot created: \", snapshot.Name)\n}\n" - language: go + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/snapshots' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -1498,6 +1481,23 @@ paths: ' language: typescript + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc createSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsnapshot, err := client.CreateSnapshot(context.Background(), \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Snapshot created: \", snapshot.Name)\n}\n" + language: go + - code-samples: + - code: "import 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: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.CreateSnapshotAsync("{collection_name}"); + +' + language: csharp description: Creates a new snapshot for a specified collection. summary: Create a snapshot (collection) tags: @@ -1505,12 +1505,12 @@ paths: /collections/{collection_name}/snapshots/recover: put: x-fern-examples: - - code-samples: - - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/snapshots/recover' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"location\": \"http://example.com/path/to/snapshot.shapshot\"\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.recover_snapshot(\n \"{collection_name}\",\n \"http://example.com/path/to/snapshot.shapshot\",\n)\n" language: python + - code-samples: + - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/snapshots/recover' \\\n --header 'api-key: ' \\\n --header 'Content-Type: application/json' \\\n --data-raw '{\n \"location\": \"http://example.com/path/to/snapshot.shapshot\"\n}'" + language: curl - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\nclient.recoverSnapshot(\"{collection_name}\", {\n location: \"http://example.com/path/to/snapshot.shapshot\",\n});\n" language: typescript @@ -1531,32 +1531,15 @@ paths: /collections/{collection_name}/snapshots/{snapshot_name}: delete: x-fern-examples: - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.DeleteSnapshotAsync("{collection_name}", "{snapshot_name}"); - -' - language: csharp - code-samples: - code: "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: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/snapshots/snapshot_name' \\\n --header 'api-key: '" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"http://localhost:6333\")\n\nclient.delete_snapshot(\n collection_name=\"{collection_name}\", snapshot_name=\"{snapshot_name}\"\n)\n" language: python - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteSnapshotAsync(\"{collection_name}\", \"{snapshot_name}\").get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteSnapshot(context.Background(), \"{collection_name}\", \"{snapshot_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go + - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/snapshots/snapshot_name' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -1568,6 +1551,23 @@ paths: ' language: typescript + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteSnapshot(context.Background(), \"{collection_name}\", \"{snapshot_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go + - code-samples: + - code: "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: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.DeleteSnapshotAsync("{collection_name}", "{snapshot_name}"); + +' + language: csharp description: Deletes the specified snapshot for a collection. summary: Delete a snapshot (collection) tags: @@ -1580,17 +1580,6 @@ paths: /snapshots: get: x-fern-examples: - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ListFullSnapshotsAsync(); - -' - language: csharp - code-samples: - code: 'use qdrant_client::Qdrant; @@ -1602,9 +1591,6 @@ paths: ' language: rust - - code-samples: - - code: "curl -X GET \\\n 'http://localhost:6333/snapshots' \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'from qdrant_client import QdrantClient @@ -1617,11 +1603,8 @@ paths: ' language: python - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.listFullSnapshotAsync().get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc listFullSnapshots() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsnapshots, err := client.ListFullSnapshots(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Full snapshots: \", snapshots)\n}\n" - language: go + - code: "curl -X GET \\\n 'http://localhost:6333/snapshots' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -1633,12 +1616,12 @@ paths: ' language: typescript - 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: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc listFullSnapshots() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsnapshots, err := client.ListFullSnapshots(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Full snapshots: \", snapshots)\n}\n" + language: go + - code-samples: + - code: "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: 'using Qdrant.Client; @@ -1646,10 +1629,16 @@ paths: var client = new QdrantClient("localhost", 6334); - await client.CreateFullSnapshotAsync(); + await client.ListFullSnapshotsAsync(); ' language: csharp + 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: 'use qdrant_client::Qdrant; @@ -1661,9 +1650,6 @@ paths: ' language: rust - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/snapshots' \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'from qdrant_client import QdrantClient @@ -1676,11 +1662,8 @@ paths: ' language: python - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.createFullSnapshotAsync().get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc createFullSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsnapshot, err := client.CreateFullSnapshot(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Snapshot created: \", snapshot.Name)\n}\n" - language: go + - code: "curl -X POST \\\n 'http://localhost:6333/snapshots' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -1692,13 +1675,12 @@ paths: ' language: typescript - description: Creates a new snapshot of the entire storage. - summary: Create a snapshot (storage) - tags: - - Snapshots - /snapshots/{snapshot_name}: - delete: - x-fern-examples: + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc createFullSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsnapshot, err := client.CreateFullSnapshot(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Snapshot created: \", snapshot.Name)\n}\n" + language: go + - code-samples: + - code: "import 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: 'using Qdrant.Client; @@ -1706,10 +1688,17 @@ paths: var client = new QdrantClient("localhost", 6334); - await client.DeleteFullSnapshotAsync("{snapshot_name}"); + await client.CreateFullSnapshotAsync(); ' language: csharp + description: Creates a new snapshot of the entire storage. + summary: Create a snapshot (storage) + tags: + - Snapshots + /snapshots/{snapshot_name}: + delete: + x-fern-examples: - code-samples: - code: 'use qdrant_client::Qdrant; @@ -1721,9 +1710,6 @@ paths: ' language: rust - - code-samples: - - code: "curl -X DELETE \\\n 'http://localhost:6333/snapshots/snapshot_name' \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'from qdrant_client import QdrantClient @@ -1736,11 +1722,8 @@ paths: ' language: python - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\nclient.deleteFullSnapshotAsync(\"{snapshot_name}\").get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteFullSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteFullSnapshot(context.Background(), \"{snapshot_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go + - code: "curl -X DELETE \\\n 'http://localhost:6333/snapshots/snapshot_name' \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -1752,6 +1735,23 @@ paths: ' language: typescript + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\n)\n\nfunc deleteFullSnapshot() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = client.DeleteFullSnapshot(context.Background(), \"{snapshot_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go + - code-samples: + - code: "import 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: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.DeleteFullSnapshotAsync("{snapshot_name}"); + +' + language: csharp 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 5cc6578..b0629be 100644 --- a/fern/apis/master/openapi.json +++ b/fern/apis/master/openapi.json @@ -6546,10 +6546,10 @@ "example": { "collections": [ { - "name": "arivx-title" + "name": "arxiv-title" }, { - "name": "arivx-abstract" + "name": "arxiv-abstract" }, { "name": "medium-title" @@ -11377,6 +11377,12 @@ "format": "uint", "minimum": 0 }, + "max_collections": { + "type": "integer", + "format": "uint", + "minimum": 0, + "nullable": true + }, "collections": { "type": "array", "items": { @@ -11539,6 +11545,16 @@ "additionalProperties": { "$ref": "#/components/schemas/ReplicaState" } + }, + "partial_snapshot": { + "anyOf": [ + { + "$ref": "#/components/schemas/PartialSnapshotTelemetry" + }, + { + "nullable": true + } + ] } } }, @@ -12009,14 +12025,14 @@ "SparseVectorStorageType": { "oneOf": [ { - "description": "Storage on disk", + "description": "Storage on disk (rocksdb storage)", "type": "string", "enum": [ "on_disk" ] }, { - "description": "Storage in memory maps", + "description": "Storage in memory maps (gridstore storage)", "type": "string", "enum": [ "mmap" @@ -12326,6 +12342,25 @@ } } }, + "PartialSnapshotTelemetry": { + "type": "object", + "required": [ + "ongoing_create_snapshot_requests", + "recovery_timestamp" + ], + "properties": { + "ongoing_create_snapshot_requests": { + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "recovery_timestamp": { + "type": "integer", + "format": "uint64", + "minimum": 0 + } + } + }, "ShardCleanStatusTelemetry": { "oneOf": [ { @@ -15225,6 +15260,22 @@ "type": "boolean" } ] + }, + "Usage": { + "description": "Usage of the hardware resources, spent to process the request", + "type": "object", + "properties": { + "hardware": { + "anyOf": [ + { + "$ref": "#/components/schemas/HardwareUsage" + }, + { + "nullable": true + } + ] + } + } } } } diff --git a/fern/apis/v1.14.x/openapi-overrides.yml b/fern/apis/v1.14.x/openapi-overrides.yml index 776c192..6ca5afe 100644 --- a/fern/apis/v1.14.x/openapi-overrides.yml +++ b/fern/apis/v1.14.x/openapi-overrides.yml @@ -18,47 +18,42 @@ paths: - Aliases x-fern-examples: - code-samples: - - code: 'using Qdrant.Client; + - code: 'use qdrant_client::Qdrant; - var client = new QdrantClient("localhost", 6334); + let client = Qdrant::from_url("http://localhost:6334").build()?; - await client.ListAliasesAsync(); + client.list_aliases().await?; ' - language: csharp + language: rust - code-samples: - - code: 'use qdrant_client::Qdrant; + - code: 'from qdrant_client import QdrantClient - let client = Qdrant::from_url("http://localhost:6334").build()?; + client = QdrantClient(url="http://localhost:6333") - client.list_aliases().await?; + client.get_aliases() ' - language: rust + language: python - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/aliases' \\\n --header\ \ 'api-key: '" language: curl - code-samples: - - code: 'from qdrant_client import QdrantClient + - 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 - - 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 + language: typescript - 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\ @@ -68,16 +63,21 @@ paths: }\n" language: go - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - 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: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.getAliases(); + await client.ListAliasesAsync(); ' - language: typescript + language: csharp /cluster: get: description: Returns information about the cluster's current state and composition. @@ -106,47 +106,42 @@ paths: - Collections x-fern-examples: - code-samples: - - code: 'using Qdrant.Client; + - code: 'use qdrant_client::Qdrant; - var client = new QdrantClient("localhost", 6334); + let client = Qdrant::from_url("http://localhost:6334").build()?; - await client.ListCollectionsAsync(); + client.list_collections().await?; ' - language: csharp + language: rust - code-samples: - - code: 'use qdrant_client::Qdrant; + - code: 'from qdrant_client import QdrantClient - let client = Qdrant::from_url("http://localhost:6334").build()?; + client = QdrantClient(url="http://localhost:6333") - client.list_collections().await?; + client.get_collections() ' - language: rust + language: python - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/collections' \\\n --header\ \ 'api-key: '" language: curl - 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 - - 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 + language: typescript - 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\ @@ -156,16 +151,21 @@ paths: , collections)\n}\n" language: go - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - 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: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.getCollections(); + await client.ListCollectionsAsync(); ' - language: typescript + language: csharp /collections/aliases: post: description: Updates aliases for the specified collections. @@ -173,21 +173,6 @@ paths: tags: - Aliases x-fern-examples: - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.CreateAliasAsync(aliasName: "production_collection", collectionName: - "example_collection"); - - - await client.DeleteAliasAsync("production_collection"); - - ' - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{CreateAliasBuilder, DeleteAlias};\nuse\ \ qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ @@ -196,6 +181,16 @@ paths: \ ))\n .await?;\n\nclient\n .delete_alias(DeleteAlias {\n \ \ alias_name: \"production_collection\".to_string(),\n })\n .await?;\n" language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.update_collection_aliases(\n change_aliases_operations=[\n\ + \ models.CreateAliasOperation(\n create_alias=models.CreateAlias(\n\ + \ collection_name=\"example_collection\", alias_name=\"\ + production_collection\"\n )\n )\n ]\n)\n\nclient.update_collection_aliases(\n\ + \ change_aliases_operations=[\n models.DeleteAliasOperation(\n\ + \ delete_alias=models.DeleteAlias(alias_name=\"production_collection\"\ + )\n ),\n ]\n)\n" + language: python - code-samples: - code: "# Create an alias\ncurl -X POST \\\n 'http://localhost:6333/collections/aliases'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -214,24 +209,14 @@ paths: \ ]\n}'\n" language: curl - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.update_collection_aliases(\n change_aliases_operations=[\n\ - \ models.CreateAliasOperation(\n create_alias=models.CreateAlias(\n\ - \ collection_name=\"example_collection\", alias_name=\"\ - production_collection\"\n )\n )\n ]\n)\n\nclient.update_collection_aliases(\n\ - \ change_aliases_operations=[\n models.DeleteAliasOperation(\n\ - \ delete_alias=models.DeleteAlias(alias_name=\"production_collection\"\ - )\n ),\n ]\n)\n" - language: python - - code-samples: - - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport\ - \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Collections.DeleteShardKey;\nimport io.qdrant.client.grpc.Collections.DeleteShardKeyRequest;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.createAliasAsync(\"production_collection\"\ - , \"example_collection\").get();\n\nclient.deleteAliasAsync(\"production_collection\"\ - ).get();\n" - language: java + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\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: "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\ @@ -244,21 +229,14 @@ paths: , \"legacy_collection\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.updateCollectionAliases({\n actions: [\n {\n create_alias:\ - \ {\n collection_name: \"example_collection\",\n alias_name:\ - \ \"production_collection\",\n },\n },\n ],\n});\n\nclient.updateCollectionAliases({\n\ - \ actions: [\n {\n delete_alias: {\n alias_name: \"production_collection\"\ - ,\n },\n },\n ],\n});\n" - language: typescript - /collections/{collection_name}: - delete: - description: Drops the specified collection and all associated data in it. - summary: Delete a collection - tags: - - Collections - x-fern-examples: + - 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: 'using Qdrant.Client; @@ -266,10 +244,21 @@ paths: var client = new QdrantClient("localhost", 6334); - await client.DeleteCollectionAsync("{collection_name}"); + await client.CreateAliasAsync(aliasName: "production_collection", collectionName: + "example_collection"); + + + await client.DeleteAliasAsync("production_collection"); ' language: csharp + /collections/{collection_name}: + delete: + description: Drops the specified collection and all associated data in it. + summary: Delete a collection + tags: + - Collections + x-fern-examples: - code-samples: - code: 'use qdrant_client::Qdrant; @@ -281,10 +270,6 @@ paths: ' language: rust - - code-samples: - - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name'\ - \ \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'from qdrant_client import QdrantClient @@ -297,11 +282,20 @@ paths: ' language: python - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.deleteCollectionAsync(\"\ - {collection_name}\").get();\n" - language: java + - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name'\ + \ \\\n --header 'api-key: '" + language: curl + - code-samples: + - code: 'import { QdrantClient } from ''@qdrant/qdrant-js''; + + + const client = new QdrantClient({url: ''http://127.0.0.1:6333''}); + + + client.deleteCollection("{collection_name}"); + + ' + language: typescript - 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\ @@ -310,16 +304,22 @@ paths: \ \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: 'import { QdrantClient } from ''@qdrant/qdrant-js''; + - 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: 'using Qdrant.Client; - const client = new QdrantClient({url: ''http://127.0.0.1:6333''}); + var client = new QdrantClient("localhost", 6334); - client.deleteCollection("{collection_name}"); + await client.DeleteCollectionAsync("{collection_name}"); ' - language: typescript + language: csharp get: description: Retrieves parameters from the specified collection. summary: Get collection details @@ -327,48 +327,42 @@ paths: - Collections x-fern-examples: - code-samples: - - code: 'using Qdrant.Client; + - code: 'use qdrant_client::Qdrant; - var client = new QdrantClient("localhost", 6334); + let client = Qdrant::from_url("http://localhost:6334").build()?; - await client.GetCollectionInfoAsync("{collection_name}"); + client.collection_info("{collection_name}").await?; ' - language: csharp + language: rust - code-samples: - - code: 'use qdrant_client::Qdrant; + - code: 'from qdrant_client import QdrantClient - let client = Qdrant::from_url("http://localhost:6334").build()?; + client = QdrantClient(url="http://localhost:6333") - client.collection_info("{collection_name}").await?; + client.get_collection("{collection_name}") ' - language: rust + language: python - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name'\ \ \\\n --header 'api-key: '" language: curl - 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 - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.getCollectionInfoAsync(\"\ - {collection_name}\").get();\n" - language: java + language: typescript - 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\ @@ -378,28 +372,28 @@ paths: Collection info: \", info)\n}\n" language: go - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - 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: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.getCollection("{collection_name}"); + await client.GetCollectionInfoAsync("{collection_name}"); ' - language: typescript + language: csharp patch: description: Updates the parameters of the specified collection. summary: Update collection parameters tags: - Collections x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateCollectionAsync(\n\ - \ collectionName: \"{collection_name}\",\n optimizersConfig: new OptimizersConfigDiff\ - \ { IndexingThreshold = 10000 }\n);\n" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{OptimizersConfigDiffBuilder, UpdateCollectionBuilder};\n\ use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ @@ -407,6 +401,12 @@ paths: {collection_name}\").optimizers_config(\n OptimizersConfigDiffBuilder::default().indexing_threshold(10_000),\n\ \ ),\n )\n .await?;\n" language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.update_collection(\n collection_name=\"\ + {collection_name}\",\n optimizer_config=models.OptimizersConfigDiff(indexing_threshold=10000),\n\ + )\n" + language: python - code-samples: - code: "curl -X PATCH \\\n 'http://localhost:6333/collections/collection_name'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -414,11 +414,21 @@ paths: \ \"indexing_threshold\": 10000\n }\n}'" language: curl - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.update_collection(\n collection_name=\"\ - {collection_name}\",\n optimizer_config=models.OptimizersConfigDiff(indexing_threshold=10000),\n\ - )\n" - language: python + - code: "import { 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: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc updateCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tthreshold := uint64(10000)\n\terr = client.UpdateCollection(context.Background(),\ + \ &qdrant.UpdateCollection{\n\t\tCollectionName: \"{collection_name}\"\ + ,\n\t\tOptimizersConfig: &qdrant.OptimizersConfigDiff{\n\t\t\tIndexingThreshold:\ + \ &threshold,\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\ + }\n" + language: go - code-samples: - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport\ \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -431,37 +441,17 @@ paths: \ .build());\n" language: java - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc updateCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\tthreshold := uint64(10000)\n\terr = client.UpdateCollection(context.Background(),\ - \ &qdrant.UpdateCollection{\n\t\tCollectionName: \"{collection_name}\"\ - ,\n\t\tOptimizersConfig: &qdrant.OptimizersConfigDiff{\n\t\t\tIndexingThreshold:\ - \ &threshold,\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\ - }\n" - language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.updateCollection(\"{collection_name}\", {\n optimizers_config:\ - \ {\n indexing_threshold: 10000,\n },\n});\n" - language: typescript + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateCollectionAsync(\n\ + \ collectionName: \"{collection_name}\",\n optimizersConfig: new OptimizersConfigDiff\ + \ { IndexingThreshold = 10000 }\n);\n" + language: csharp put: description: Creates a new collection with the given parameters. summary: Create a collection tags: - Collections x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.CreateCollectionAsync(\n\ - \tcollectionName: \"{collection_name}\",\n\tvectorsConfig: new VectorParams\ - \ { Size = 100, Distance = Distance.Cosine }\n);\n\n// Or with sparse\ - \ vectors\n\nawait client.CreateCollectionAsync(\n\tcollectionName: \"\ - {collection_name}\",\n\tsparseVectorsConfig: (\"splade-model-name\", new\ - \ SparseVectorParams{\n Index = new SparseIndexConfig {\n \ - \ OnDisk = false,\n }\n })\n);" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{CreateCollectionBuilder, Distance, VectorParamsBuilder};\n\ use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ @@ -469,6 +459,12 @@ paths: {collection_name}\")\n .vectors_config(VectorParamsBuilder::new(100,\ \ Distance::Cosine)),\n )\n .await?;\n" language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.create_collection(\n collection_name=\"\ + {collection_name}\",\n vectors_config=models.VectorParams(size=100,\ + \ distance=models.Distance.COSINE),\n)\n" + language: python - code-samples: - code: "# Create a collection with default dense vector\ncurl -X PUT \\\n\ \ 'http://localhost:6333/collections/collection_name' \\\n --header\ @@ -483,11 +479,24 @@ paths: : {\n \"on_disk\": true\n }\n }\n }\n}'\n" language: curl - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.create_collection(\n collection_name=\"\ - {collection_name}\",\n vectors_config=models.VectorParams(size=100,\ - \ distance=models.Distance.COSINE),\n)\n" - language: python + - code: "import { 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: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc createCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\terr = client.CreateCollection(context.Background(),\ + \ &qdrant.CreateCollection{\n\t\tCollectionName: \"{collection_name}\"\ + ,\n\t\tVectorsConfig: qdrant.NewVectorsConfig(&qdrant.VectorParams{\n\t\ + \t\tSize: 100,\n\t\t\tDistance: qdrant.Distance_Cosine,\n\t\t}),\n\ + \t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go - code-samples: - code: "import 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\ @@ -504,24 +513,15 @@ paths: \ ).build()\n ).build()\n ).build()\n).get();" language: java - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc createCollection() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\terr = client.CreateCollection(context.Background(),\ - \ &qdrant.CreateCollection{\n\t\tCollectionName: \"{collection_name}\"\ - ,\n\t\tVectorsConfig: qdrant.NewVectorsConfig(&qdrant.VectorParams{\n\t\ - \t\tSize: 100,\n\t\t\tDistance: qdrant.Distance_Cosine,\n\t\t}),\n\ - \t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\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: "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 /collections/{collection_name}/aliases: get: description: Retrieves a list of all aliases for the specified collection. @@ -530,48 +530,42 @@ paths: - Aliases x-fern-examples: - code-samples: - - code: 'using Qdrant.Client; + - code: 'use qdrant_client::Qdrant; - var client = new QdrantClient("localhost", 6334); + let client = Qdrant::from_url("http://localhost:6334").build()?; - await client.ListCollectionAliasesAsync("{collection_name}"); + client.list_collection_aliases("{collection_name}").await?; ' - language: csharp + language: rust - code-samples: - - code: 'use qdrant_client::Qdrant; + - code: 'from qdrant_client import QdrantClient - let client = Qdrant::from_url("http://localhost:6334").build()?; + client = QdrantClient(url="http://localhost:6333") - client.list_collection_aliases("{collection_name}").await?; + client.get_collection_aliases("{collection_name}") ' - language: rust + language: python - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/aliases'\ \ \\\n --header 'api-key: '" language: curl - code-samples: - - code: 'from qdrant_client import QdrantClient + - 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 - - 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 + language: typescript - 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\ @@ -581,16 +575,22 @@ paths: Collection aliases: \", aliases)\n}\n" language: go - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - 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: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.getCollectionAliases("{collection_name}"); + await client.ListCollectionAliasesAsync("{collection_name}"); ' - language: typescript + language: csharp /collections/{collection_name}/cluster: get: description: Retrieves cluster details for a specified collection. @@ -610,40 +610,48 @@ paths: - Collections x-fern-examples: - code-samples: - - code: 'using Qdrant.Client; + - code: 'use qdrant_client::Qdrant; - var client = new QdrantClient("localhost", 6334); + let client = Qdrant::from_url("http://localhost:6334").build()?; - await client.CollectionExistsAsync("{collection_name}"); + client.collection_exists("{collection_name}").await?; ' - language: csharp + language: rust - code-samples: - - code: 'use qdrant_client::Qdrant; - + - code: 'from qdrant_client import QdrantClient - let client = Qdrant::from_url("http://localhost:6334").build()?; + client = QdrantClient(url="http://localhost:6333") - client.collection_exists("{collection_name}").await?; - ' - language: rust + 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 - 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: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc collectionExists() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\texists, err := client.CollectionExists(context.Background(),\ + \ \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"\ + Collection exists: \", exists)\n}\n" + language: go - code-samples: - code: 'import static io.qdrant.client.ConditionFactory.matchKeyword; @@ -665,24 +673,16 @@ paths: ' language: java - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc collectionExists() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\texists, err := client.CollectionExists(context.Background(),\ - \ \"{collection_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"\ - Collection exists: \", exists)\n}\n" - language: go - - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - code: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.collectionExists("{collection_name}"); + await client.CollectionExistsAsync("{collection_name}"); ' - language: typescript + language: csharp /collections/{collection_name}/facet: post: description: Retrieves facets for the specified payload field. @@ -690,12 +690,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.FacetAsync(\n\t\"\ - {collection_name}\",\n\tfilter: MatchKeyword(\"color\", \"red\"),\n\t\ - key: \"my-payload-key\",\n\tlimit: 10\n);" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{Condition, FacetCountsBuilder, Filter};\n\ use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ @@ -712,17 +706,14 @@ paths: color\", \"red\")]),\n limit=10,\n)\n\n" language: python - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport static io.qdrant.client.ConditionFactory.matchKeyword;\nimport\ - \ io.qdrant.client.grpc.Points;\nimport io.qdrant.client.grpc.Filter;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .facetAsync(\n \ - \ Points.FacetCounts.newBuilder()\n .setCollectionName(collection_name)\n\ - \ .setKey(\"my-payload-key\")\n .setFilter(\n \ - \ Filter.newBuilder()\n .addMust(matchKeyword(\"\ - color\", \"red\"))\n .build())\n .build())\n\ - \ .get();" - language: java + - 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: "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\ @@ -736,39 +727,37 @@ paths: }\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.facet(\"{collection_name}\", {\n filter: {\n must: [\n\ - \ {\n key: \"color\",\n match:\ - \ {\n value: \"red\",\n },\n \ - \ },\n ],\n },\n key: \"my-payload-key\",\n limit:\ - \ 10,\n});\n" - language: typescript - /collections/{collection_name}/index: - put: - description: Creates a payload index for a field in the specified collection. - summary: Create payload index - tags: - - Indexes - x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\"\ - , 6334);\n\nawait client.CreatePayloadIndexAsync(\n collectionName: \"\ - {collection_name}\",\n fieldName: \"name_of_the_field_to_index\"\n);\n" - language: csharp - - code-samples: + - code: "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: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nawait client.FacetAsync(\n\t\"\ + {collection_name}\",\n\tfilter: MatchKeyword(\"color\", \"red\"),\n\t\ + key: \"my-payload-key\",\n\tlimit: 10\n);" + language: csharp + /collections/{collection_name}/index: + put: + description: Creates a payload index for a field in the specified collection. + summary: Create payload index + tags: + - Indexes + x-fern-examples: + - code-samples: - code: "use qdrant_client::qdrant::{CreateFieldIndexCollectionBuilder, FieldType};\n\ use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ ).build()?;\n\nclient\n .create_field_index(\n CreateFieldIndexCollectionBuilder::new(\n\ \ \"{collection_name}\",\n \"{field_name}\",\n \ \ FieldType::Keyword,\n ),\n )\n .await?;\n" language: rust - - code-samples: - - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/index'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"field_name\": \"field_name\"\ - ,\n \"field_schema\": \"keyword\"\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.create_payload_index(\n collection_name=\"\ @@ -776,14 +765,17 @@ paths: \ field_schema=\"keyword\",\n)\n" language: python - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Collections.PayloadSchemaType;\n\nQdrantClient\ - \ client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.createPayloadIndexAsync(\n\ - \ \"{collection_name}\",\n \"{field_name}\"\ - ,\n PayloadSchemaType.Keyword,\n null,\n\ - \ true,\n null,\n null);\n" - language: java + - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/index'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"field_name\": \"field_name\"\ + ,\n \"field_schema\": \"keyword\"\n}'" + language: curl + - code-samples: + - code: "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: "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\ @@ -795,11 +787,19 @@ paths: \ {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.createPayloadIndex(\"{collection_name}\", {\n field_name: \"{field_name}\"\ - ,\n field_schema: \"keyword\",\n});\n" - language: typescript + - 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: "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 /collections/{collection_name}/index/{field_name}: delete: description: Deletes a payload index for a field in the specified collection. @@ -807,11 +807,6 @@ paths: tags: - Indexes x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\"\ - , 6334);\n\nawait client.DeletePayloadIndexAsync(\n collectionName: \"\ - {collection_name}\",\n fieldName: \"name_of_the_field_to_index\"\n);\n" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::DeleteFieldIndexCollectionBuilder;\nuse\ \ qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ @@ -819,10 +814,6 @@ paths: \ \"{collection_name}\",\n \"{field_name}\",\n ))\n \ \ .await?;\n" language: rust - - code-samples: - - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/index/field_name'\ - \ \\\n --header 'api-key: '" - language: curl - code-samples: - code: 'from qdrant_client import QdrantClient @@ -835,20 +826,9 @@ paths: ' language: python - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.deletePayloadIndexAsync(\"\ - {collection_name}\", \"{field_name}\", true, null, null).get();\n" - language: java - - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc deleteFieldIndex() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\t_, err = client.DeleteFieldIndex(context.Background(),\ - \ &qdrant.DeleteFieldIndexCollection{\n\t\tCollectionName: \"{collection_name}\"\ - ,\n\t\tFieldName: \"{field_name}\",\n\t})\n\tif err != nil {\n\t\t\ - panic(err)\n\t}\n}\n" - language: go + - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/index/field_name'\ + \ \\\n --header 'api-key: '" + language: curl - code-samples: - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; @@ -860,6 +840,26 @@ paths: ' language: typescript + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc deleteFieldIndex() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\t_, err = client.DeleteFieldIndex(context.Background(),\ + \ &qdrant.DeleteFieldIndexCollection{\n\t\tCollectionName: \"{collection_name}\"\ + ,\n\t\tFieldName: \"{field_name}\",\n\t})\n\tif err != nil {\n\t\t\ + panic(err)\n\t}\n}\n" + language: go + - code-samples: + - code: "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: "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 /collections/{collection_name}/points: post: description: Retrieves all details from multiple points. @@ -867,18 +867,17 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\"\ - , 6334);\n\nawait client.RetrieveAsync(\n collectionName: \"{collection_name}\"\ - ,\n ids: [0, 30, 100],\n withPayload: false,\n withVectors: false\n\ - );\n" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::GetPointsBuilder;\nuse qdrant_client::Qdrant;\n\ \nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\ \nclient\n .get_points(GetPointsBuilder::new(\n \"{collection_name}\"\ ,\n vec![0.into(), 30.into(), 100.into()],\n ))\n .await?;\n" language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.retrieve(\n collection_name=\"{collection_name}\"\ + ,\n ids=[0, 3, 100],\n)\n" + language: python - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -886,17 +885,10 @@ paths: \ 100\n ]\n}'" language: curl - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.retrieve(\n collection_name=\"{collection_name}\"\ - ,\n ids=[0, 3, 100],\n)\n" - language: python - - code-samples: - - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .retrieveAsync(\"{collection_name}\"\ - , List.of(id(0), id(30), id(100)), false, false, null)\n .get();\n" - language: java + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.retrieve(\"{collection_name}\", {\n ids: [0, 3, 100],\n});\n" + language: typescript - code-samples: - code: "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\ @@ -908,10 +900,18 @@ paths: \t}\n\tfmt.Println(\"Points: \", points)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.retrieve(\"{collection_name}\", {\n ids: [0, 3, 100],\n});\n" - language: typescript + - 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: "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 put: description: Performs the insert + update action on specified points. Any point with an existing {id} will be overwritten. @@ -919,17 +919,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.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: "use qdrant_client::qdrant::{PointStruct, UpsertPointsBuilder};\n\ use qdrant_client::{Qdrant, Payload};\nuse serde_json::json;\n\nlet client\ @@ -950,6 +939,18 @@ paths: \ ),\n ],\n )\n .wait(true),\n )\n \ \ .await?;\n" language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.upsert(\n collection_name=\"{collection_name}\"\ + ,\n points=[\n models.PointStruct(\n id=1,\n \ + \ payload={\n \"color\": \"red\",\n },\n\ + \ vector=[0.9, 0.1, 0.1],\n ),\n models.PointStruct(\n\ + \ id=2,\n payload={\n \"color\":\ + \ \"green\",\n },\n vector=[0.1, 0.9, 0.1],\n \ + \ ),\n models.PointStruct(\n id=3,\n \ + \ payload={\n \"color\": \"blue\",\n },\n \ + \ vector=[0.1, 0.1, 0.9],\n ),\n ],\n)\n" + language: python - code-samples: - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -964,17 +965,33 @@ paths: \ 0.9\n ]\n }\n ]\n}'" language: curl - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.upsert(\n collection_name=\"{collection_name}\"\ - ,\n points=[\n models.PointStruct(\n id=1,\n \ - \ payload={\n \"color\": \"red\",\n },\n\ - \ vector=[0.9, 0.1, 0.1],\n ),\n models.PointStruct(\n\ - \ id=2,\n payload={\n \"color\":\ - \ \"green\",\n },\n vector=[0.1, 0.9, 0.1],\n \ - \ ),\n models.PointStruct(\n id=3,\n \ - \ payload={\n \"color\": \"blue\",\n },\n \ - \ vector=[0.1, 0.1, 0.9],\n ),\n ],\n)\n" - language: python + - code: "import { 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: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc upsert() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tresponse, err := client.Upsert(context.Background(),\ + \ &qdrant.UpsertPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ + \tPoints: []*qdrant.PointStruct{\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(1),\n\ + \t\t\t\tVectors: qdrant.NewVectors(0.9, 0.1, 0.1),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\ + \t\t\t\t\t\"color\": \"red\",\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\t\ + Id: qdrant.NewIDNum(2),\n\t\t\t\tVectors: qdrant.NewVectors(0.1,\ + \ 0.9, 0.1),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\ + \t\t\t\"color\": \"green\",\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\t\ + Id: qdrant.NewIDNum(3),\n\t\t\t\tVectors: qdrant.NewVectors(0.1,\ + \ 0.1, 0.9),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\ + \t\t\t\"color\": \"blue\",\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif\ + \ err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Upsert status: \"\ + , response.GetStatus())\n}\n" + language: go - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ \ io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\ @@ -997,33 +1014,16 @@ paths: \ 0.9f))))\n .build()))\n .get();\n" language: java - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc upsert() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\tresponse, err := client.Upsert(context.Background(),\ - \ &qdrant.UpsertPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ - \tPoints: []*qdrant.PointStruct{\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(1),\n\ - \t\t\t\tVectors: qdrant.NewVectors(0.9, 0.1, 0.1),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\ - \t\t\t\t\t\"color\": \"red\",\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\t\ - Id: qdrant.NewIDNum(2),\n\t\t\t\tVectors: qdrant.NewVectors(0.1,\ - \ 0.9, 0.1),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\ - \t\t\t\"color\": \"green\",\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\t\ - Id: qdrant.NewIDNum(3),\n\t\t\t\tVectors: qdrant.NewVectors(0.1,\ - \ 0.1, 0.9),\n\t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\ - \t\t\t\"color\": \"blue\",\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif\ - \ err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Upsert status: \"\ - , response.GetStatus())\n}\n" - language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.upsert(\"{collection_name}\", {\n points: [\n {\n id:\ - \ 1,\n payload: { color: \"red\" },\n vector: [0.9, 0.1, 0.1],\n\ - \ },\n {\n id: 2,\n payload: { color: \"green\" },\n \ - \ vector: [0.1, 0.9, 0.1],\n },\n {\n id: 3,\n payload:\ - \ { color: \"blue\" },\n vector: [0.1, 0.1, 0.9],\n },\n ],\n\ - });\n" - language: typescript + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nawait client.UpsertAsync(\n collectionName:\ + \ \"{collection_name}\",\n points: new List\n {\n new()\n\ + \ {\n Id = 1,\n Vectors = new[] { 0.9f, 0.1f, 0.1f },\n \ + \ Payload = { [\"city\"] = \"red\" }\n },\n new()\n {\n \ + \ Id = 2,\n Vectors = new[] { 0.1f, 0.9f, 0.1f },\n Payload\ + \ = { [\"city\"] = \"green\" }\n },\n new()\n {\n Id = 3,\n\ + \ Vectors = new[] { 0.1f, 0.1f, 0.9f },\n Payload = { [\"city\"\ + ] = \"blue\" }\n }\n }\n);\n" + language: csharp /collections/{collection_name}/points/batch: post: description: Batch updates points, including their respective vectors and payloads. @@ -1031,22 +1031,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.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: "use qdrant_client::qdrant::{\n points_selector::PointsSelectorOneOf,\n\ \ points_update_operation::{\n Operation, OverwritePayload,\ @@ -1079,22 +1063,6 @@ paths: \ })),\n },\n ],\n )\n \ \ .wait(true),\n )\n .await?;\n" language: rust - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/batch'\ - \ \\\n --header 'Content-Type: application/json' \\\n --header 'api-key:\ - \ ' \\\n --data-raw '{\n \"operations\": [\n {\n \ - \ \"upsert\": {\n \"points\": [\n {\n \"\ - id\": 1,\n \"vector\": [\n 0.4,\n \ - \ 0.3,\n 0.2,\n 0.1\n ]\n \ - \ }\n ]\n }\n },\n {\n \"update_vectors\": {\n\ - \ \"points\": [\n {\n \"id\": 1,\n \ - \ \"vector\": [\n 0.11,\n 0.22,\n \ - \ 0.33,\n 0.44\n ]\n }\n \ - \ ]\n }\n },\n {\n \"set_payload\": {\n \"payload\"\ - : {\n \"test_payload_2\": 2,\n \"test_payload_3\": 3\n\ - \ },\n \"points\": [\n 1\n ]\n }\n\ - \ }\n ]\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.batch_update_points(\n collection_name=\"\ @@ -1113,6 +1081,56 @@ paths: : 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 + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.batchUpdate(\"{collection_name}\", {\n operations: [\n \ + \ {\n upsert: {\n points: [\n \ + \ {\n id: 1,\n vector:\ + \ [1.0, 2.0, 3.0, 4.0],\n payload: {},\n \ + \ },\n ],\n },\n },\n \ + \ {\n update_vectors: {\n points: [\n \ + \ {\n id: 1,\n \ + \ vector: [1.0, 2.0, 3.0, 4.0],\n },\n \ + \ ],\n },\n },\n {\n set_payload:\ + \ {\n payload: {\n test_payload_2: 2,\n\ + \ test_payload_3: 3,\n },\n \ + \ points: [1],\n },\n },\n ],\n});\n" + language: typescript + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc batchUpdate() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\t_, err = client.UpdateBatch(context.Background(),\ + \ &qdrant.UpdateBatchPoints{\n\t\tCollectionName: \"{collection_name}\"\ + ,\n\t\tOperations: []*qdrant.PointsUpdateOperation{\n\t\t\tqdrant.NewPointsUpdateUpsert(&qdrant.PointsUpdateOperation_PointStructList{\n\ + \t\t\t\tPoints: []*qdrant.PointStruct{{\n\t\t\t\t\tId: qdrant.NewIDNum(1),\n\ + \t\t\t\t\tVectors: qdrant.NewVectors(1.0, 2.0, 3.0, 4.0),\n\t\t\t\t}},\n\ + \t\t\t}),\n\t\t\tqdrant.NewPointsUpdateUpdateVectors(&qdrant.PointsUpdateOperation_UpdateVectors{\n\ + \t\t\t\tPoints: []*qdrant.PointVectors{\n\t\t\t\t\t{\n\t\t\t\t\t\tId:\ + \ qdrant.NewIDNum(1),\n\t\t\t\t\t\tVectors: qdrant.NewVectors(0.1,\ + \ 0.2, 0.3, 0.4),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t\tqdrant.NewPointsUpdateSetPayload(&qdrant.PointsUpdateOperation_SetPayload{\n\ + \t\t\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(1)),\n\ + \t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\t\t\"test_payload_2\"\ + : 2,\n\t\t\t\t\t\"test_payload_3\": 3,\n\t\t\t\t}),\n\t\t\t}),\n\t\t},\n\ + \t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go - code-samples: - code: "import 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\ @@ -1149,39 +1167,21 @@ paths: \ .build()))\n .get();\n" language: java - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc batchUpdate() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\t_, err = client.UpdateBatch(context.Background(),\ - \ &qdrant.UpdateBatchPoints{\n\t\tCollectionName: \"{collection_name}\"\ - ,\n\t\tOperations: []*qdrant.PointsUpdateOperation{\n\t\t\tqdrant.NewPointsUpdateUpsert(&qdrant.PointsUpdateOperation_PointStructList{\n\ - \t\t\t\tPoints: []*qdrant.PointStruct{{\n\t\t\t\t\tId: qdrant.NewIDNum(1),\n\ - \t\t\t\t\tVectors: qdrant.NewVectors(1.0, 2.0, 3.0, 4.0),\n\t\t\t\t}},\n\ - \t\t\t}),\n\t\t\tqdrant.NewPointsUpdateUpdateVectors(&qdrant.PointsUpdateOperation_UpdateVectors{\n\ - \t\t\t\tPoints: []*qdrant.PointVectors{\n\t\t\t\t\t{\n\t\t\t\t\t\tId:\ - \ qdrant.NewIDNum(1),\n\t\t\t\t\t\tVectors: qdrant.NewVectors(0.1,\ - \ 0.2, 0.3, 0.4),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t\tqdrant.NewPointsUpdateSetPayload(&qdrant.PointsUpdateOperation_SetPayload{\n\ - \t\t\t\tPointsSelector: qdrant.NewPointsSelector(qdrant.NewIDNum(1)),\n\ - \t\t\t\tPayload: qdrant.NewValueMap(map[string]any{\n\t\t\t\t\t\"test_payload_2\"\ - : 2,\n\t\t\t\t\t\"test_payload_3\": 3,\n\t\t\t\t}),\n\t\t\t}),\n\t\t},\n\ - \t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.batchUpdate(\"{collection_name}\", {\n operations: [\n \ - \ {\n upsert: {\n points: [\n \ - \ {\n id: 1,\n vector:\ - \ [1.0, 2.0, 3.0, 4.0],\n payload: {},\n \ - \ },\n ],\n },\n },\n \ - \ {\n update_vectors: {\n points: [\n \ - \ {\n id: 1,\n \ - \ vector: [1.0, 2.0, 3.0, 4.0],\n },\n \ - \ ],\n },\n },\n {\n set_payload:\ - \ {\n payload: {\n test_payload_2: 2,\n\ - \ test_payload_3: 3,\n },\n \ - \ points: [1],\n },\n },\n ],\n});\n" - language: typescript + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateBatchAsync(\n\ + \ \"{collection_name}\",\n [\n new()\n {\n \ + \ Upsert = new()\n {\n Points =\n \ + \ {\n new PointStruct { Id = 1, Vectors =\ + \ new[] { 0.9f, 0.1f, 0.1f } },\n }\n }\n \ + \ },\n new()\n {\n UpdateVectors = new()\n\ + \ {\n Points =\n {\n \ + \ new PointVectors { Id = 1, Vectors = new[] { 0.9f, 0.1f,\ + \ 0.1f } },\n }\n }\n },\n new()\n\ + \ {\n SetPayload = new()\n {\n \ + \ PointsSelector = new PointsSelector { Points = new PointsIdsList\ + \ { Ids = { 1 } } },\n Payload = { [\"test_payload_2\"\ + ] = 2, [\"test_payload_3\"] = 3 }\n }\n }\n ]\n);\n" + language: csharp /collections/{collection_name}/points/count: post: description: Counts the number of points that match a specified filtering condition. @@ -1189,12 +1189,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\ - \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.CountAsync(\n\ - \ collectionName: \"{collection_name}\",\n filter: MatchKeyword(\"color\"\ - , \"red\"),\n exact: true\n);\n" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{Condition, CountPointsBuilder, Filter};\n\ use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ @@ -1203,6 +1197,13 @@ paths: \ \"color\",\n \"red\".to_string(),\n \ \ )]))\n .exact(true),\n )\n .await?;\n" language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.count(\n collection_name=\"{collection_name}\"\ + ,\n count_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"\ + color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n\ + \ exact=True,\n)\n" + language: python - code-samples: - code: "# Count total number of points in a collection\ncurl -X POST \\\n\ \ 'http://localhost:6333/collections/collection_name/points/count' \\\ @@ -1216,20 +1217,13 @@ paths: : true\n}'" language: curl - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.count(\n collection_name=\"{collection_name}\"\ - ,\n count_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"\ - color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n\ - \ exact=True,\n)\n" - language: python - - code-samples: - - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ - import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Points.Filter;\n\nQdrantClient client =\ - \ new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\ - \nclient\n .countAsync(\n \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"\ - color\", \"red\")).build(),\n true)\n .get();\n" - language: java + - code: "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: "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\ @@ -1241,13 +1235,19 @@ paths: \ != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Count:\", count)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.count(\"{collection_name}\", {\n filter: {\n must: [\n\ - \ {\n key: \"color\",\n match:\ - \ {\n value: \"red\",\n },\n \ - \ },\n ],\n },\n exact: true,\n});\n" - language: typescript + - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ + import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.Filter;\n\nQdrantClient client =\ + \ new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\ + \nclient\n .countAsync(\n \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"\ + color\", \"red\")).build(),\n true)\n .get();\n" + language: java + - code-samples: + - code: "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 /collections/{collection_name}/points/delete: post: description: Deletes specified points from the collection. @@ -1255,22 +1255,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.DeleteAsync(collectionName: "{collection_name}", ids: [0, - 3, 100]); - - - await client.DeleteAsync(collectionName: "{collection_name}", filter: - MatchKeyword("color", "red")); - - ' - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{Condition, DeletePointsBuilder, Filter,\ \ PointsIdsList};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"\ @@ -1283,6 +1267,16 @@ paths: \ \"color\",\n \"red\".to_string(),\n )]))\n\ \ .wait(true),\n )\n .await?;\n" language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.delete(\n collection_name=\"{collection_name}\"\ + ,\n points_selector=models.PointIdsList(\n points=[0, 3, 100],\n\ + \ ),\n)\n\nclient.delete(\n collection_name=\"{collection_name}\"\ + ,\n points_selector=models.FilterSelector(\n filter=models.Filter(\n\ + \ must=[\n models.FieldCondition(\n \ + \ key=\"color\",\n match=models.MatchValue(value=\"\ + red\"),\n ),\n ],\n )\n ),\n)\n" + language: python - 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:\ @@ -1295,26 +1289,14 @@ paths: \ \"value\": \"red\"\n }\n }\n ]\n }\n}'\n" language: curl - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.delete(\n collection_name=\"{collection_name}\"\ - ,\n points_selector=models.PointIdsList(\n points=[0, 3, 100],\n\ - \ ),\n)\n\nclient.delete(\n collection_name=\"{collection_name}\"\ - ,\n points_selector=models.FilterSelector(\n filter=models.Filter(\n\ - \ must=[\n models.FieldCondition(\n \ - \ key=\"color\",\n match=models.MatchValue(value=\"\ - red\"),\n ),\n ],\n )\n ),\n)\n" - language: python - - code-samples: - - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ - \ io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport java.util.List;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Points.Filter;\n\nQdrantClient client =\ - \ new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\"\ - , 6334, false).build());\n\nclient.deleteAsync(\"{collection_name}\",\ - \ List.of(id(0), id(3), id(100)));\n\nclient\n .deleteAsync(\n \ - \ \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"\ - color\", \"red\")).build())\n .get();\n" - language: java + - code: "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: "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\ @@ -1329,26 +1311,44 @@ paths: \t\t\t},\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.delete(\"{collection_name}\", {\n points: [0, 3, 100],\n});\n\n\ - client.delete(\"{collection_name}\", {\n filter: {\n must: [\n\ - \ {\n key: \"color\",\n match:\ - \ {\n value: \"red\",\n },\n \ - \ },\n ],\n },\n});\n" - language: typescript - /collections/{collection_name}/points/discover: - post: - description: 'Retrieves the most similar points to a given target, constrained - by the provided context. - - Context Search: When only the context is provided (without a target), pairs - of points are used to generate a loss that guides the search towards the area - where most positive examples overlap. The score minimizes finding points closer - to a negative example than to a positive example. The maximum score a point - can achieve is 0.0, meaning many points may have a score of 0.0. - - Target Search: When a target is provided (with or without context), the score + - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ + \ io.qdrant.client.ConditionFactory.matchKeyword;\n\nimport java.util.List;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.Filter;\n\nQdrantClient client =\ + \ new QdrantClient(\n QdrantGrpcClient.newBuilder(\"localhost\"\ + , 6334, false).build());\n\nclient.deleteAsync(\"{collection_name}\",\ + \ List.of(id(0), id(3), id(100)));\n\nclient\n .deleteAsync(\n \ + \ \"{collection_name}\",\n Filter.newBuilder().addMust(matchKeyword(\"\ + color\", \"red\")).build())\n .get();\n" + language: java + - code-samples: + - code: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.DeleteAsync(collectionName: "{collection_name}", ids: [0, + 3, 100]); + + + await client.DeleteAsync(collectionName: "{collection_name}", filter: + MatchKeyword("color", "red")); + + ' + language: csharp + /collections/{collection_name}/points/discover: + post: + description: 'Retrieves the most similar points to a given target, constrained + by the provided context. + + Context Search: When only the context is provided (without a target), pairs + of points are used to generate a loss that guides the search towards the area + where most positive examples overlap. The score minimizes finding points closer + to a negative example than to a positive example. The maximum score a point + can achieve is 0.0, meaning many points may have a score of 0.0. + + Target Search: When a target is provided (with or without context), the score consists of two parts: the integer part represents the rank with respect to the context, and the decimal part relates to the distance to the target. The context score for each pair is +1 if the point is closer to a positive example @@ -1359,17 +1359,6 @@ paths: tags: - Search x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.DiscoverAsync(\n\ - \ collectionName: \"{collection_name}\",\n target: new TargetVector\n\ - \ {\n Single = new VectorExample { Vector = new float[] { 0.2f, 0.1f,\ - \ 0.9f, 0.7f }, }\n },\n context:\n [\n new()\n {\n Positive\ - \ = new VectorExample { Id = 100 },\n Negative = new VectorExample\ - \ { Id = 718 }\n },\n new()\n {\n Positive = new VectorExample\ - \ { Id = 200 },\n Negative = new VectorExample { Id = 300 }\n \ - \ }\n ],\n limit: 10\n);\n" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{\n target_vector::Target, vector_example::Example,\ \ ContextExamplePairBuilder,\n DiscoverPointsBuilder, VectorExample,\n\ @@ -1385,6 +1374,13 @@ paths: \ {\n example: Some(Example::Vector(vec![0.2, 0.1, 0.9, 0.7].into())),\n\ \ })),\n )\n .await?;\n" language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.discover(\n \"{collection_name}\"\ + ,\n target=[0.2, 0.1, 0.9, 0.7],\n context=[\n models.ContextExamplePair(positive=100,\ + \ negative=718),\n models.ContextExamplePair(positive=200, negative=300),\n\ + \ ],\n limit=10,\n)\n" + language: python - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/discover'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -1394,12 +1390,28 @@ paths: \n }\n ],\n \"limit\": 10\n}'" language: curl - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.discover(\n \"{collection_name}\"\ - ,\n target=[0.2, 0.1, 0.9, 0.7],\n context=[\n models.ContextExamplePair(positive=100,\ - \ negative=718),\n models.ContextExamplePair(positive=200, negative=300),\n\ - \ ],\n limit=10,\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.discover(\"{collection_name}\", {\n target: [0.2, 0.1, 0.9,\ + \ 0.7],\n context: [\n {\n positive: 100,\n \ + \ negative: 718,\n },\n {\n positive: 200,\n\ + \ negative: 300,\n },\n ],\n limit: 10,\n});\n" + language: typescript + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc discover() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tresults, err := client.Query(context.Background(),\ + \ &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ + \tQuery: qdrant.NewQueryDiscover(&qdrant.DiscoverInput{\n\t\t\tTarget:\ + \ qdrant.NewVectorInput(0.2, 0.1, 0.9, 0.7),\n\t\t\tContext: &qdrant.ContextInput{\n\ + \t\t\t\tPairs: []*qdrant.ContextInputPair{{\n\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\ + \t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\t\ + \t\t\t}, {\n\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\ + \t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(300)),\n\t\ + \t\t\t}},\n\t\t\t},\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\ + \t}\n\tfmt.Println(\"Results: \", results)\n}\n" + language: go - code-samples: - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ import static io.qdrant.client.VectorFactory.vector;\n\nimport io.qdrant.client.QdrantClient;\n\ @@ -1423,28 +1435,16 @@ paths: \ .build())\n .get();\n" language: java - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc discover() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\tresults, err := client.Query(context.Background(),\ - \ &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ - \tQuery: qdrant.NewQueryDiscover(&qdrant.DiscoverInput{\n\t\t\tTarget:\ - \ qdrant.NewVectorInput(0.2, 0.1, 0.9, 0.7),\n\t\t\tContext: &qdrant.ContextInput{\n\ - \t\t\t\tPairs: []*qdrant.ContextInputPair{{\n\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\ - \t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\t\ - \t\t\t}, {\n\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\ - \t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(300)),\n\t\ - \t\t\t}},\n\t\t\t},\n\t\t}),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\ - \t}\n\tfmt.Println(\"Results: \", results)\n}\n" - language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.discover(\"{collection_name}\", {\n target: [0.2, 0.1, 0.9,\ - \ 0.7],\n context: [\n {\n positive: 100,\n \ - \ negative: 718,\n },\n {\n positive: 200,\n\ - \ negative: 300,\n },\n ],\n limit: 10,\n});\n" - language: typescript + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nawait client.DiscoverAsync(\n\ + \ collectionName: \"{collection_name}\",\n target: new TargetVector\n\ + \ {\n Single = new VectorExample { Vector = new float[] { 0.2f, 0.1f,\ + \ 0.9f, 0.7f }, }\n },\n context:\n [\n new()\n {\n Positive\ + \ = new VectorExample { Id = 100 },\n Negative = new VectorExample\ + \ { Id = 718 }\n },\n new()\n {\n Positive = new VectorExample\ + \ { Id = 200 },\n Negative = new VectorExample { Id = 300 }\n \ + \ }\n ],\n limit: 10\n);\n" + language: csharp /collections/{collection_name}/points/discover/batch: post: description: Retrieves points in batches based on the target and/or positive @@ -1453,30 +1453,6 @@ paths: tags: - Search x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nvar discoverPoints = new List\n\ - {\n new DiscoverPoints\n {\n CollectionName = \"{collection_name}\"\ - ,\n Target = new TargetVector\n {\n Single =\ - \ new VectorExample { Vector = new float[] { 0.2f, 0.1f, 0.9f, 0.7f },\ - \ }\n },\n Context =\n {\n new ContextExamplePair()\n\ - \ {\n Positive = new VectorExample { Id = 100\ - \ },\n Negative = new VectorExample { Id = 718 }\n \ - \ },\n new ContextExamplePair()\n {\n \ - \ Positive = new VectorExample { Id = 200 },\n \ - \ Negative = new VectorExample { Id = 300 }\n }\n \ - \ },\n Limit = 10\n },\n new DiscoverPoints\n {\n \ - \ CollectionName = \"{collection_name}\",\n Target = new TargetVector\n\ - \ {\n Single = new VectorExample { Vector = new float[]\ - \ { 0.5f, 0.3f, 0.2f, 0.3f }, }\n },\n Context =\n \ - \ {\n new ContextExamplePair()\n {\n \ - \ Positive = new VectorExample { Id = 342 },\n Negative\ - \ = new VectorExample { Id = 213 }\n },\n new ContextExamplePair()\n\ - \ {\n Positive = new VectorExample { Id = 100\ - \ },\n Negative = new VectorExample { Id = 200 }\n \ - \ }\n },\n Limit = 10\n }\n};\nawait client.DiscoverBatchAsync(\"\ - {collection_name}\", discoverPoints);\n" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{\n vector_example::Example, ContextExamplePairBuilder,\ \ DiscoverBatchPointsBuilder,\n DiscoverPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\ @@ -1498,19 +1474,6 @@ paths: \ .build(),\n ],\n 10,\n \ \ )\n .build(),\n ],\n);\n\nclient.discover_batch(&discover_points.build()).await?;\n" language: rust - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/discover/batch'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \ - \ \"target\": [\n 0.2,\n 0.1,\n 0.9,\n \ - \ 0.7\n ],\n \"context\": [\n {\n \"positive\"\ - : \"7f6652c4-89bd-40e0-ab1d-510f7fcddd2b\",\n \"negative\": \"\ - 2c2c9f86-0171-4bd2-9ab0-b4754682cddd\"\n }\n ],\n \"\ - limit\": 1\n },\n {\n \"target\": [\n 0.5,\n \ - \ 0.3,\n 0.2,\n 0.3\n ],\n \"context\": [\n \ - \ {\n \"positive\": 342,\n \"negative\": 213\n\ - \ }\n ],\n \"limit\": 1\n }\n ]\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\ndiscover_queries = [\n models.DiscoverRequest(\n\ @@ -1526,6 +1489,59 @@ paths: \ ),\n ],\n limit=5,\n ),\n]\n\nclient.discover_batch(\"\ {collection_name}\", discover_queries)\n" language: python + - code-samples: + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/discover/batch'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \ + \ \"target\": [\n 0.2,\n 0.1,\n 0.9,\n \ + \ 0.7\n ],\n \"context\": [\n {\n \"positive\"\ + : \"7f6652c4-89bd-40e0-ab1d-510f7fcddd2b\",\n \"negative\": \"\ + 2c2c9f86-0171-4bd2-9ab0-b4754682cddd\"\n }\n ],\n \"\ + limit\": 1\n },\n {\n \"target\": [\n 0.5,\n \ + \ 0.3,\n 0.2,\n 0.3\n ],\n \"context\": [\n \ + \ {\n \"positive\": 342,\n \"negative\": 213\n\ + \ }\n ],\n \"limit\": 1\n }\n ]\n}'" + language: curl + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + const searches = [\n {\n target: [0.2, 0.1, 0.9, 0.7],\n \ + \ context: [\n {\n positive: 100,\n \ + \ negative: 718,\n },\n {\n \ + \ positive: 200,\n negative: 300,\n },\n\ + \ ],\n limit: 10,\n },\n {\n target: [0.5,\ + \ 0.3, 0.2, 0.3],\n context: [\n {\n \ + \ positive: 342,\n negative: 213,\n },\n \ + \ {\n positive: 100,\n negative:\ + \ 200,\n },\n ],\n limit: 5,\n },\n];\n\n\ + client.discoverBatchPoints(\"{collection_name}\", {\n searches,\n});\n" + language: typescript + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc discoverBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tresults, err := client.QueryBatch(context.Background(),\ + \ &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\"\ + ,\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName:\ + \ \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryDiscover(&qdrant.DiscoverInput{\n\ + \t\t\t\t\tTarget: qdrant.NewVectorInput(0.2, 0.1, 0.9, 0.7),\n\t\t\t\t\ + \tContext: &qdrant.ContextInput{\n\t\t\t\t\t\tPairs: []*qdrant.ContextInputPair{{\n\ + \t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\ + \t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\ + \t\t\t\t\t\t}, {\n\t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\ + \t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(300)),\n\ + \t\t\t\t\t\t}},\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\t\ + CollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryDiscover(&qdrant.DiscoverInput{\n\ + \t\t\t\t\tTarget: qdrant.NewVectorInput(0.5, 0.3, 0.2, 0.3),\n\t\t\t\t\ + \tContext: &qdrant.ContextInput{\n\t\t\t\t\t\tPairs: []*qdrant.ContextInputPair{{\n\ + \t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(342)),\n\ + \t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(213)),\n\ + \t\t\t\t\t\t}, {\n\t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\ + \t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\ + \t\t\t\t\t\t}},\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\t\ + if err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n\ + }\n" + language: go - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ \ io.qdrant.client.VectorFactory.vector;\n\nimport java.util.Arrays;\n\ @@ -1565,45 +1581,29 @@ paths: \ null);\n" language: java - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc discoverBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\tresults, err := client.QueryBatch(context.Background(),\ - \ &qdrant.QueryBatchPoints{\n\t\tCollectionName: \"{collection_name}\"\ - ,\n\t\tQueryPoints: []*qdrant.QueryPoints{\n\t\t\t{\n\t\t\t\tCollectionName:\ - \ \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryDiscover(&qdrant.DiscoverInput{\n\ - \t\t\t\t\tTarget: qdrant.NewVectorInput(0.2, 0.1, 0.9, 0.7),\n\t\t\t\t\ - \tContext: &qdrant.ContextInput{\n\t\t\t\t\t\tPairs: []*qdrant.ContextInputPair{{\n\ - \t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\ - \t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(718)),\n\ - \t\t\t\t\t\t}, {\n\t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\ - \t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(300)),\n\ - \t\t\t\t\t\t}},\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{\n\t\t\t\t\ - CollectionName: \"{collection_name}\",\n\t\t\t\tQuery: qdrant.NewQueryDiscover(&qdrant.DiscoverInput{\n\ - \t\t\t\t\tTarget: qdrant.NewVectorInput(0.5, 0.3, 0.2, 0.3),\n\t\t\t\t\ - \tContext: &qdrant.ContextInput{\n\t\t\t\t\t\tPairs: []*qdrant.ContextInputPair{{\n\ - \t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(342)),\n\ - \t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(213)),\n\ - \t\t\t\t\t\t}, {\n\t\t\t\t\t\t\tPositive: qdrant.NewVectorInputID(qdrant.NewIDNum(100)),\n\ - \t\t\t\t\t\t\tNegative: qdrant.NewVectorInputID(qdrant.NewIDNum(200)),\n\ - \t\t\t\t\t\t}},\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\t\ - if err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n\ - }\n" - language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - const searches = [\n {\n target: [0.2, 0.1, 0.9, 0.7],\n \ - \ context: [\n {\n positive: 100,\n \ - \ negative: 718,\n },\n {\n \ - \ positive: 200,\n negative: 300,\n },\n\ - \ ],\n limit: 10,\n },\n {\n target: [0.5,\ - \ 0.3, 0.2, 0.3],\n context: [\n {\n \ - \ positive: 342,\n negative: 213,\n },\n \ - \ {\n positive: 100,\n negative:\ - \ 200,\n },\n ],\n limit: 5,\n },\n];\n\n\ - client.discoverBatchPoints(\"{collection_name}\", {\n searches,\n});\n" - language: typescript + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nvar discoverPoints = new List\n\ + {\n new DiscoverPoints\n {\n CollectionName = \"{collection_name}\"\ + ,\n Target = new TargetVector\n {\n Single =\ + \ new VectorExample { Vector = new float[] { 0.2f, 0.1f, 0.9f, 0.7f },\ + \ }\n },\n Context =\n {\n new ContextExamplePair()\n\ + \ {\n Positive = new VectorExample { Id = 100\ + \ },\n Negative = new VectorExample { Id = 718 }\n \ + \ },\n new ContextExamplePair()\n {\n \ + \ Positive = new VectorExample { Id = 200 },\n \ + \ Negative = new VectorExample { Id = 300 }\n }\n \ + \ },\n Limit = 10\n },\n new DiscoverPoints\n {\n \ + \ CollectionName = \"{collection_name}\",\n Target = new TargetVector\n\ + \ {\n Single = new VectorExample { Vector = new float[]\ + \ { 0.5f, 0.3f, 0.2f, 0.3f }, }\n },\n Context =\n \ + \ {\n new ContextExamplePair()\n {\n \ + \ Positive = new VectorExample { Id = 342 },\n Negative\ + \ = new VectorExample { Id = 213 }\n },\n new ContextExamplePair()\n\ + \ {\n Positive = new VectorExample { Id = 100\ + \ },\n Negative = new VectorExample { Id = 200 }\n \ + \ }\n },\n Limit = 10\n }\n};\nawait client.DiscoverBatchAsync(\"\ + {collection_name}\", discoverPoints);\n" + language: csharp /collections/{collection_name}/points/payload: post: description: Sets payload values for specified points. @@ -1611,13 +1611,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.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: "use qdrant_client::qdrant::{PointsIdsList, SetPayloadPointsBuilder};\n\ use qdrant_client::{Qdrant, Payload};\nuse serde_json::json;\n\nlet client\ @@ -1629,6 +1622,13 @@ paths: \ 3.into(), 10.into()],\n })\n .wait(true),\n \ \ )\n .await?;\n" language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.set_payload(\n collection_name=\"\ + {collection_name}\",\n payload={\n \"property1\": \"string\"\ + ,\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n\ + )\n" + language: python - code-samples: - code: "# Set payload by ID\ncurl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/payload'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -1644,22 +1644,12 @@ paths: property3\": true\n }\n}'" language: curl - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.set_payload(\n collection_name=\"\ - {collection_name}\",\n payload={\n \"property1\": \"string\"\ - ,\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n\ - )\n" - language: python - - code-samples: - - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ - \ io.qdrant.client.ValueFactory.value;\n\nimport java.util.List;\nimport\ - \ java.util.Map;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .setPayloadAsync(\n\ - \ \"{collection_name}\",\n Map.of(\"property1\", value(\"\ - string\"), \"property2\", value(\"string\")),\n List.of(id(0),\ - \ id(3), id(10)),\n true,\n null,\n null)\n .get();\n" - language: java + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\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: "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\ @@ -1673,25 +1663,28 @@ paths: \ \", results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.setPayload(\"{collection_name}\", {\n payload: {\n property1:\ - \ \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n\ - });\n" - language: typescript + - 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: "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 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: "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: "use qdrant_client::qdrant::{\n points_selector::PointsSelectorOneOf,\ \ PointsIdsList, SetPayloadPointsBuilder,\n};\nuse qdrant_client::{Qdrant,\ @@ -1703,6 +1696,13 @@ paths: \ {\n ids: vec![0.into(), 3.into(), 10.into()],\n \ \ }))\n .wait(true),\n )\n .await?;\n" language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.overwrite_payload(\n collection_name=\"\ + {collection_name}\",\n payload={\n \"property1\": \"string\"\ + ,\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n\ + )\n" + language: python - 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:\ @@ -1717,22 +1717,12 @@ paths: : {\n \"value\": \"red\"\n }\n }\n ]\n }\n}'" language: curl - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.overwrite_payload(\n collection_name=\"\ - {collection_name}\",\n payload={\n \"property1\": \"string\"\ - ,\n \"property2\": \"string\",\n },\n points=[0, 3, 10],\n\ - )\n" - language: python - - code-samples: - - code: "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: "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: "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\ @@ -1745,12 +1735,22 @@ paths: \t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.overwritePayload(\"{collection_name}\", {\n payload: {\n property1:\ - \ \"string\",\n property2: \"string\",\n },\n points: [0, 3, 10],\n\ - });\n" - language: typescript + - 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: "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 /collections/{collection_name}/points/payload/clear: post: description: Removes the entire payload for specified points. @@ -1758,17 +1758,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.ClearPayloadAsync("{collection_name}", [0, 3, 10]); - - ' - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{ClearPayloadPointsBuilder, PointsIdsList};\n\ use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ @@ -1776,6 +1765,11 @@ paths: {collection_name}\").points(\n PointsIdsList {\n ids:\ \ vec![0.into(), 3.into(), 100.into()],\n },\n ))\n .await?;\n" language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.clear_payload(\n collection_name=\"\ + {collection_name}\",\n points_selector=[0, 3, 100],\n)\n" + language: python - 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:\ @@ -1783,17 +1777,11 @@ paths: \ 100\n ]\n}'" language: curl - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.clear_payload(\n collection_name=\"\ - {collection_name}\",\n points_selector=[0, 3, 100],\n)\n" - language: python - - code-samples: - - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.clearPayloadAsync(\"{collection_name}\"\ - , List.of(id(0), id(3), id(100)), null, null, null)\n .get();\n" - language: java + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.clearPayload(\"{collection_name}\", {\n points: [0, 3, 100],\n\ + });\n" + language: typescript - code-samples: - code: "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\ @@ -1805,18 +1793,12 @@ paths: \t}\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.clearPayload(\"{collection_name}\", {\n points: [0, 3, 100],\n\ - });\n" - language: typescript - /collections/{collection_name}/points/payload/delete: - post: - description: Deletes a specified key payload for points. - summary: Delete payload - tags: - - Points - x-fern-examples: + - 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: 'using Qdrant.Client; @@ -1824,11 +1806,17 @@ paths: var client = new QdrantClient("localhost", 6334); - await client.DeletePayloadAsync("{collection_name}", ["color", "price"], - [0, 3, 10]); + await client.ClearPayloadAsync("{collection_name}", [0, 3, 10]); ' language: csharp + /collections/{collection_name}/points/payload/delete: + post: + description: Deletes a specified key payload for points. + summary: Delete payload + tags: + - Points + x-fern-examples: - code-samples: - code: "use qdrant_client::qdrant::{DeletePayloadPointsBuilder, PointsIdsList};\n\ use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ @@ -1838,6 +1826,12 @@ paths: \ {\n ids: vec![0.into(), 3.into(), 100.into()],\n })\n\ \ .wait(true),\n )\n .await?;\n" language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.delete_payload(\n collection_name=\"\ + {collection_name}\",\n keys=[\"color\", \"price\"],\n points=[0,\ + \ 3, 100],\n)\n" + language: python - 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:\ @@ -1851,20 +1845,11 @@ paths: : \"red\"\n }\n }\n ]\n }\n}'" language: curl - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.delete_payload(\n collection_name=\"\ - {collection_name}\",\n keys=[\"color\", \"price\"],\n points=[0,\ - \ 3, 100],\n)\n" - language: python - - code-samples: - - code: "import java.util.List;\n\nimport static io.qdrant.client.PointIdFactory.id;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .deletePayloadAsync(\n\ - \ \"{collection_name}\",\n List.of(\"color\", \"price\"\ - ),\n List.of(id(0), id(3), id(100)),\n true,\n null,\n\ - \ null)\n .get();\n" - language: java + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.deletePayload(\"{collection_name}\", {\n keys: [\"color\", \"\ + price\"],\n points: [0, 3, 100],\n});\n" + language: typescript - code-samples: - code: "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\ @@ -1876,11 +1861,26 @@ paths: },\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.deletePayload(\"{collection_name}\", {\n keys: [\"color\", \"\ - price\"],\n points: [0, 3, 100],\n});\n" - language: typescript + - 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: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.DeletePayloadAsync("{collection_name}", ["color", "price"], + [0, 3, 10]); + + ' + language: csharp /collections/{collection_name}/points/query: post: description: Universally query points. This endpoint covers all capabilities @@ -1890,49 +1890,6 @@ paths: tags: - Search x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\n// Query nearest by ID\nawait\ - \ client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tquery:\ - \ Guid.Parse(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")\n);\n\n// Recommend\ - \ on the average of these vectors\nawait client.QueryAsync(\n\tcollectionName:\ - \ \"{collection_name}\",\n\tquery: new RecommendInput\n\t{\n\t\tPositive\ - \ =\n\t\t{\n\t\t\tGuid.Parse(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\ - ),\n\t\t\tnew float[] { 0.11f, 0.35f, 0.6f }\n\t\t},\n\t\tNegative = {\ - \ new float[] { 0.01f, 0.45f, 0.67f } }\n\t}\n);\n\n// Fusion query\n\ - await client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\t\ - prefetch: new List\n\t{\n\t\tnew()\n\t\t{\n\t\t\tQuery\ - \ = new (float, uint)[] { (0.22f, 1), (0.8f, 42), },\n\t\t\tUsing = \"\ - sparse\",\n\t\t\tLimit = 20\n\t\t},\n\t\tnew()\n\t\t{\n\t\t\tQuery = new\ - \ float[] { 0.01f, 0.45f, 0.67f },\n\t\t\tUsing = \"dense\",\n\t\t\tLimit\ - \ = 20\n\t\t}\n\t},\n\tquery: Fusion.Rrf\n);\n\n// 2-stage query\nawait\ - \ client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tprefetch:\ - \ new List\n\t{\n\t\tnew() { Query = new float[] { 0.01f,\ - \ 0.45f, 0.67f }, Limit = 100 }\n\t},\n\tquery: new float[][] { [0.1f,\ - \ 0.2f], [0.2f, 0.1f], [0.8f, 0.9f] },\n\tusingVector: \"colbert\",\n\t\ - limit: 10\n);\n\n// Random sampling (as of 1.11.0)\nawait client.QueryAsync(\n\ - \ collectionName: \"{collection_name}\",\n query: Sample.Random\n\ - );\n\n// Score boost depending on payload conditions (as of 1.14.0)\n\ - await client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\t\ - prefetch:\n\t[\n\t\tnew PrefetchQuery { Query = new float[] { 0.01f, 0.45f,\ - \ 0.67f }, Limit = 100 },\n\t],\n\tquery: new Formula\n\t{\n\t\tExpression\ - \ = new SumExpression\n\t\t{\n\t\t\tSum =\n\t\t\t{\n\t\t\t\t\"$score\"\ - ,\n\t\t\t\tnew MultExpression\n\t\t\t\t{\n\t\t\t\t\tMult = { 0.5f, Match(\"\ - tag\", [\"h1\", \"h2\", \"h3\", \"h4\"]) },\n\t\t\t\t},\n\t\t\t\tnew MultExpression\ - \ { Mult = { 0.25f, Match(\"tag\", [\"p\", \"li\"]) } },\n\t\t\t},\n\t\ - \t},\n\t},\n\tlimit: 10\n);\n\n// Score boost geographically closer points\ - \ (as of 1.14.0)\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\"\ - ,\n\tprefetch:\n\t[\n\t\tnew PrefetchQuery { Query = new float[] { 0.01f,\ - \ 0.45f, 0.67f }, Limit = 100 },\n\t],\n\tquery: new Formula\n\t{\n\t\t\ - Expression = new SumExpression\n\t\t{\n\t\t\tSum =\n\t\t\t{\n\t\t\t\t\"\ - $score\",\n\t\t\t\tWithExpDecay(\n\t\t\t\t\tnew()\n\t\t\t\t\t{\n\t\t\t\ - \t\t\tX = new GeoDistance\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tOrigin = new GeoPoint\ - \ { Lat = 52.504043, Lon = 13.393236 },\n\t\t\t\t\t\t\tTo = \"geo.location\"\ - ,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tScale = 5000,\n\t\t\t\t\t}\n\t\t\t\t),\n\ - \t\t\t},\n\t\t},\n\t\tDefaults =\n\t\t{\n\t\t\t[\"geo.location\"] = new\ - \ Dictionary\n\t\t\t{\n\t\t\t\t[\"lat\"] = 48.137154,\n\ - \t\t\t\t[\"lon\"] = 11.576124,\n\t\t\t},\n\t\t},\n\t}\n);\n" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{\n Condition, DecayParamsExpressionBuilder,\ \ Expression, FormulaBuilder, Fusion, GeoPoint,\n PointId, PrefetchQueryBuilder,\ @@ -1986,6 +1943,53 @@ paths: \ lon: 11.576124 }),\n )\n .limit(10),\n )\n\ \ .await?;\n" language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\n# Query nearest by ID\nnearest = client.query_points(\n\ + \ collection_name=\"{collection_name}\",\n query=\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\ + ,\n)\n\n# Recommend on the average of these vectors\nrecommended = client.query_points(\n\ + \ collection_name=\"{collection_name}\",\n query=models.RecommendQuery(recommend=models.RecommendInput(\n\ + \ positive=[\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\", [0.11, 0.35,\ + \ 0.6, ...]],\n negative=[[0.01, 0.45, 0.67, ...]]\n ))\n)\n\ + \n# Fusion query\nhybrid = client.query_points(\n collection_name=\"\ + {collection_name}\",\n prefetch=[\n models.Prefetch(\n \ + \ query=models.SparseVector(indices=[1, 42], values=[0.22, 0.8]),\n\ + \ using=\"sparse\",\n limit=20,\n ),\n \ + \ models.Prefetch(\n query=[0.01, 0.45, 0.67, ...], #\ + \ <-- dense vector\n using=\"dense\",\n limit=20,\n\ + \ ),\n ],\n query=models.FusionQuery(fusion=models.Fusion.RRF),\n\ + )\n\n# 2-stage query\nrefined = client.query_points(\n collection_name=\"\ + {collection_name}\",\n prefetch=models.Prefetch(\n query=[0.01,\ + \ 0.45, 0.67, ...], # <-- dense vector\n limit=100,\n ),\n\ + \ query=[\n [0.1, 0.2, ...], # <\u2500\u2510\n [0.2,\ + \ 0.1, ...], # < \u251C\u2500 multi-vector\n [0.8, 0.9, ...],\ + \ # < \u2518\n ],\n using=\"colbert\",\n limit=10,\n)\n\n# Random\ + \ sampling (as of 1.11.0)\nsampled = client.query_points(\n collection_name=\"\ + {collection_name}\",\n query=models.SampleQuery(sample=models.Sample.RANDOM)\n\ + )\n\n# Score boost depending on payload conditions (as of 1.14.0)\ntag_boosted\ + \ = client.query_points(\n collection_name=\"{collection_name}\",\n\ + \ prefetch=models.Prefetch(\n query=[0.2, 0.8, ...], # <--\ + \ dense vector\n limit=50\n ),\n query=models.FormulaQuery(\n\ + \ formula=models.SumExpression(sum=[\n \"$score\",\n\ + \ models.MultExpression(mult=[0.5, models.FieldCondition(key=\"\ + tag\", match=models.MatchAny(any=[\"h1\", \"h2\", \"h3\", \"h4\"]))]),\n\ + \ models.MultExpression(mult=[0.25, models.FieldCondition(key=\"\ + tag\", match=models.MatchAny(any=[\"p\", \"li\"]))])\n ]\n ))\n\ + )\n\n# Score boost geographically closer points (as of 1.14.0)\ngeo_boosted\ + \ = client.query_points(\n collection_name=\"{collection_name}\",\n\ + \ prefetch=models.Prefetch(\n query=[0.2, 0.8, ...], # <--\ + \ dense vector\n limit=50\n ),\n query=models.FormulaQuery(\n\ + \ formula=models.SumExpression(sum=[\n \"$score\",\n\ + \ models.GaussDecayExpression(\n gauss_decay=models.DecayParamsExpression(\n\ + \ x=models.GeoDistance(\n geo_distance=models.GeoDistanceParams(\n\ + \ origin=models.GeoPoint(\n \ + \ lat=52.504043,\n lon=13.393236\n\ + \ ), # Berlin\n \ + \ to=\"geo.location\"\n )\n \ + \ ),\n scale=5000 # 5km\n )\n \ + \ )\n ]),\n defaults={\"geo.location\": models.GeoPoint(lat=48.137154,\ + \ lon=11.576124)} # Munich\n )\n)\n" + language: python - 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:\ @@ -2044,52 +2048,107 @@ paths: : {\"lat\": 48.137154, \"lon\": 11.576124} } // Munich\n }\n}'\n" language: curl - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\n# Query nearest by ID\nnearest = client.query_points(\n\ - \ collection_name=\"{collection_name}\",\n query=\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\ - ,\n)\n\n# Recommend on the average of these vectors\nrecommended = client.query_points(\n\ - \ collection_name=\"{collection_name}\",\n query=models.RecommendQuery(recommend=models.RecommendInput(\n\ - \ positive=[\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\", [0.11, 0.35,\ - \ 0.6, ...]],\n negative=[[0.01, 0.45, 0.67, ...]]\n ))\n)\n\ - \n# Fusion query\nhybrid = client.query_points(\n collection_name=\"\ - {collection_name}\",\n prefetch=[\n models.Prefetch(\n \ - \ query=models.SparseVector(indices=[1, 42], values=[0.22, 0.8]),\n\ - \ using=\"sparse\",\n limit=20,\n ),\n \ - \ models.Prefetch(\n query=[0.01, 0.45, 0.67, ...], #\ - \ <-- dense vector\n using=\"dense\",\n limit=20,\n\ - \ ),\n ],\n query=models.FusionQuery(fusion=models.Fusion.RRF),\n\ - )\n\n# 2-stage query\nrefined = client.query_points(\n collection_name=\"\ - {collection_name}\",\n prefetch=models.Prefetch(\n query=[0.01,\ - \ 0.45, 0.67, ...], # <-- dense vector\n limit=100,\n ),\n\ - \ query=[\n [0.1, 0.2, ...], # <\u2500\u2510\n [0.2,\ - \ 0.1, ...], # < \u251C\u2500 multi-vector\n [0.8, 0.9, ...],\ - \ # < \u2518\n ],\n using=\"colbert\",\n limit=10,\n)\n\n# Random\ - \ sampling (as of 1.11.0)\nsampled = client.query_points(\n collection_name=\"\ - {collection_name}\",\n query=models.SampleQuery(sample=models.Sample.RANDOM)\n\ - )\n\n# Score boost depending on payload conditions (as of 1.14.0)\ntag_boosted\ - \ = client.query_points(\n collection_name=\"{collection_name}\",\n\ - \ prefetch=models.Prefetch(\n query=[0.2, 0.8, ...], # <--\ - \ dense vector\n limit=50\n ),\n query=models.FormulaQuery(\n\ - \ formula=models.SumExpression(sum=[\n \"$score\",\n\ - \ models.MultExpression(mult=[0.5, models.FieldCondition(key=\"\ - tag\", match=models.MatchAny(any=[\"h1\", \"h2\", \"h3\", \"h4\"]))]),\n\ - \ models.MultExpression(mult=[0.25, models.FieldCondition(key=\"\ - tag\", match=models.MatchAny(any=[\"p\", \"li\"]))])\n ]\n ))\n\ - )\n\n# Score boost geographically closer points (as of 1.14.0)\ngeo_boosted\ - \ = client.query_points(\n collection_name=\"{collection_name}\",\n\ - \ prefetch=models.Prefetch(\n query=[0.2, 0.8, ...], # <--\ - \ dense vector\n limit=50\n ),\n query=models.FormulaQuery(\n\ - \ formula=models.SumExpression(sum=[\n \"$score\",\n\ - \ models.GaussDecayExpression(\n gauss_decay=models.DecayParamsExpression(\n\ - \ x=models.GeoDistance(\n geo_distance=models.GeoDistanceParams(\n\ - \ origin=models.GeoPoint(\n \ - \ lat=52.504043,\n lon=13.393236\n\ - \ ), # Berlin\n \ - \ to=\"geo.location\"\n )\n \ - \ ),\n scale=5000 # 5km\n )\n \ - \ )\n ]),\n defaults={\"geo.location\": models.GeoPoint(lat=48.137154,\ - \ lon=11.576124)} # Munich\n )\n)\n" - language: python + - code: "import { 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: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc query() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\t// Query nearest by ID\n\tpoints, err := client.Query(context.Background(),\ + \ &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ + \tQuery: qdrant.NewQueryID(qdrant.NewID(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\ + )),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query\ + \ results: \", points)\n\n\t// Recommend on the average of these vectors\n\ + \tpoints, err = client.Query(context.Background(), &qdrant.QueryPoints{\n\ + \t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\ + \t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewID(\"\ + 43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")),\n\t\t\t\tqdrant.NewVectorInput(0.11,\ + \ 0.35, 0.6),\n\t\t\t},\n\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\ + \tqdrant.NewVectorInput(0.01, 0.45, 0.67),\n\t\t\t},\n\t\t}),\n\t})\n\t\ + if err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \"\ + , points)\n\n\t// Fusion query\n\tpoints, err = client.Query(context.Background(),\ + \ &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ + \tPrefetch: []*qdrant.PrefetchQuery{\n\t\t\t{\n\t\t\t\tQuery: qdrant.NewQuerySparse([]uint32{1,\ + \ 42}, []float32{0.22, 0.8}),\n\t\t\t\tUsing: qdrant.PtrOf(\"sparse\"\ + ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\ + \t\t\t\tUsing: qdrant.PtrOf(\"dense\"),\n\t\t\t},\n\t\t},\n\t\tQuery:\ + \ qdrant.NewQueryFusion(qdrant.Fusion_RRF),\n\t})\n\tif err != nil {\n\ + \t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", points)\n\n\t\ + // 2-stage query\n\tpoints, err = client.Query(context.Background(), &qdrant.QueryPoints{\n\ + \t\tCollectionName: \"{collection_name}\",\n\t\tPrefetch: []*qdrant.PrefetchQuery{\n\ + \t\t\t{\n\t\t\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\t\t},\n\ + \t\t},\n\t\tQuery: qdrant.NewQueryMulti([][]float32{\n\t\t\t{0.1, 0.2},\n\ + \t\t\t{0.2, 0.1},\n\t\t\t{0.8, 0.9},\n\t\t}),\n\t\tUsing: qdrant.PtrOf(\"\ + colbert\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"\ + Query results: \", points)\n\n\t// Random sampling (as of 1.11.0)\n\t\ + points, err = client.Query(context.Background(), &qdrant.QueryPoints{\n\ + \t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQuerySample(qdrant.Sample_Random),\n\ + \t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results:\ + \ \", points)\n\n\t// Score boost depending on payload conditions (as\ + \ of 1.14.0)\n\tpoints, err = client.Query(context.Background(), &qdrant.QueryPoints{\n\ + \t\tCollectionName: \"{collection_name}\",\n\t\tPrefetch: []*qdrant.PrefetchQuery{\n\ + \t\t\t{\n\t\t\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\t\t},\n\ + \t\t},\n\t\tQuery: qdrant.NewQueryFormula(&qdrant.Formula{\n\t\t\tExpression:\ + \ qdrant.NewExpressionSum(&qdrant.SumExpression{\n\t\t\t\tSum: []*qdrant.Expression{\n\ + \t\t\t\t\tqdrant.NewExpressionVariable(\"$score\"),\n\t\t\t\t\tqdrant.NewExpressionMult(&qdrant.MultExpression{\n\ + \t\t\t\t\t\tMult: []*qdrant.Expression{\n\t\t\t\t\t\t\tqdrant.NewExpressionConstant(0.5),\n\ + \t\t\t\t\t\t\tqdrant.NewExpressionCondition(qdrant.NewMatchKeywords(\"\ + tag\", \"h1\", \"h2\", \"h3\", \"h4\")),\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\ + \t\t\t\t\tqdrant.NewExpressionMult(&qdrant.MultExpression{\n\t\t\t\t\t\ + \tMult: []*qdrant.Expression{\n\t\t\t\t\t\t\tqdrant.NewExpressionConstant(0.25),\n\ + \t\t\t\t\t\t\tqdrant.NewExpressionCondition(qdrant.NewMatchKeywords(\"\ + tag\", \"p\", \"li\")),\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\ + \t\t}),\n\t\t}),\n\t})\n\n\t// Score boost geographically closer points\ + \ (as of 1.14.0)\n\tclient.Query(context.Background(), &qdrant.QueryPoints{\n\ + \t\tCollectionName: \"{collection_name}\",\n\t\tPrefetch: []*qdrant.PrefetchQuery{\n\ + \t\t\t{\n\t\t\t\tQuery: qdrant.NewQuery(0.2, 0.8),\n\t\t\t},\n\t\t},\n\ + \t\tQuery: qdrant.NewQueryFormula(&qdrant.Formula{\n\t\t\tExpression:\ + \ qdrant.NewExpressionSum(&qdrant.SumExpression{\n\t\t\t\tSum: []*qdrant.Expression{\n\ + \t\t\t\t\tqdrant.NewExpressionVariable(\"$score\"),\n\t\t\t\t\tqdrant.NewExpressionExpDecay(&qdrant.DecayParamsExpression{\n\ + \t\t\t\t\t\tX: qdrant.NewExpressionGeoDistance(&qdrant.GeoDistance{\n\t\ + \t\t\t\t\t\tOrigin: &qdrant.GeoPoint{\n\t\t\t\t\t\t\t\tLat: 52.504043,\n\ + \t\t\t\t\t\t\t\tLon: 13.393236,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tTo: \"\ + geo.location\",\n\t\t\t\t\t\t}),\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t}),\n\ + \t\t\tDefaults: qdrant.NewValueMap(map[string]any{\n\t\t\t\t\"geo.location\"\ + : map[string]any{\n\t\t\t\t\t\"lat\": 48.137154,\n\t\t\t\t\t\"lon\": 11.576124,\n\ + \t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t})\n}\n" + language: go - code-samples: - code: "import static io.qdrant.client.QueryFactory.fusion;\nimport static\ \ io.qdrant.client.QueryFactory.nearest;\nimport static io.qdrant.client.QueryFactory.recommend;\n\ @@ -2189,107 +2248,48 @@ paths: \ .build()))\n .build())\n .get();\n" language: java - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc query() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\t// Query nearest by ID\n\tpoints, err := client.Query(context.Background(),\ - \ &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ - \tQuery: qdrant.NewQueryID(qdrant.NewID(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\ - )),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query\ - \ results: \", points)\n\n\t// Recommend on the average of these vectors\n\ - \tpoints, err = client.Query(context.Background(), &qdrant.QueryPoints{\n\ - \t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQueryRecommend(&qdrant.RecommendInput{\n\ - \t\t\tPositive: []*qdrant.VectorInput{\n\t\t\t\tqdrant.NewVectorInputID(qdrant.NewID(\"\ - 43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")),\n\t\t\t\tqdrant.NewVectorInput(0.11,\ - \ 0.35, 0.6),\n\t\t\t},\n\t\t\tNegative: []*qdrant.VectorInput{\n\t\t\t\ - \tqdrant.NewVectorInput(0.01, 0.45, 0.67),\n\t\t\t},\n\t\t}),\n\t})\n\t\ - if err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \"\ - , points)\n\n\t// Fusion query\n\tpoints, err = client.Query(context.Background(),\ - \ &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ - \tPrefetch: []*qdrant.PrefetchQuery{\n\t\t\t{\n\t\t\t\tQuery: qdrant.NewQuerySparse([]uint32{1,\ - \ 42}, []float32{0.22, 0.8}),\n\t\t\t\tUsing: qdrant.PtrOf(\"sparse\"\ - ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\ - \t\t\t\tUsing: qdrant.PtrOf(\"dense\"),\n\t\t\t},\n\t\t},\n\t\tQuery:\ - \ qdrant.NewQueryFusion(qdrant.Fusion_RRF),\n\t})\n\tif err != nil {\n\ - \t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results: \", points)\n\n\t\ - // 2-stage query\n\tpoints, err = client.Query(context.Background(), &qdrant.QueryPoints{\n\ - \t\tCollectionName: \"{collection_name}\",\n\t\tPrefetch: []*qdrant.PrefetchQuery{\n\ - \t\t\t{\n\t\t\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\t\t},\n\ - \t\t},\n\t\tQuery: qdrant.NewQueryMulti([][]float32{\n\t\t\t{0.1, 0.2},\n\ - \t\t\t{0.2, 0.1},\n\t\t\t{0.8, 0.9},\n\t\t}),\n\t\tUsing: qdrant.PtrOf(\"\ - colbert\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"\ - Query results: \", points)\n\n\t// Random sampling (as of 1.11.0)\n\t\ - points, err = client.Query(context.Background(), &qdrant.QueryPoints{\n\ - \t\tCollectionName: \"{collection_name}\",\n\t\tQuery: qdrant.NewQuerySample(qdrant.Sample_Random),\n\ - \t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Query results:\ - \ \", points)\n\n\t// Score boost depending on payload conditions (as\ - \ of 1.14.0)\n\tpoints, err = client.Query(context.Background(), &qdrant.QueryPoints{\n\ - \t\tCollectionName: \"{collection_name}\",\n\t\tPrefetch: []*qdrant.PrefetchQuery{\n\ - \t\t\t{\n\t\t\t\tQuery: qdrant.NewQuery(0.01, 0.45, 0.67),\n\t\t\t},\n\ - \t\t},\n\t\tQuery: qdrant.NewQueryFormula(&qdrant.Formula{\n\t\t\tExpression:\ - \ qdrant.NewExpressionSum(&qdrant.SumExpression{\n\t\t\t\tSum: []*qdrant.Expression{\n\ - \t\t\t\t\tqdrant.NewExpressionVariable(\"$score\"),\n\t\t\t\t\tqdrant.NewExpressionMult(&qdrant.MultExpression{\n\ - \t\t\t\t\t\tMult: []*qdrant.Expression{\n\t\t\t\t\t\t\tqdrant.NewExpressionConstant(0.5),\n\ - \t\t\t\t\t\t\tqdrant.NewExpressionCondition(qdrant.NewMatchKeywords(\"\ - tag\", \"h1\", \"h2\", \"h3\", \"h4\")),\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\ - \t\t\t\t\tqdrant.NewExpressionMult(&qdrant.MultExpression{\n\t\t\t\t\t\ - \tMult: []*qdrant.Expression{\n\t\t\t\t\t\t\tqdrant.NewExpressionConstant(0.25),\n\ - \t\t\t\t\t\t\tqdrant.NewExpressionCondition(qdrant.NewMatchKeywords(\"\ - tag\", \"p\", \"li\")),\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\ - \t\t}),\n\t\t}),\n\t})\n\n\t// Score boost geographically closer points\ - \ (as of 1.14.0)\n\tclient.Query(context.Background(), &qdrant.QueryPoints{\n\ - \t\tCollectionName: \"{collection_name}\",\n\t\tPrefetch: []*qdrant.PrefetchQuery{\n\ - \t\t\t{\n\t\t\t\tQuery: qdrant.NewQuery(0.2, 0.8),\n\t\t\t},\n\t\t},\n\ - \t\tQuery: qdrant.NewQueryFormula(&qdrant.Formula{\n\t\t\tExpression:\ - \ qdrant.NewExpressionSum(&qdrant.SumExpression{\n\t\t\t\tSum: []*qdrant.Expression{\n\ - \t\t\t\t\tqdrant.NewExpressionVariable(\"$score\"),\n\t\t\t\t\tqdrant.NewExpressionExpDecay(&qdrant.DecayParamsExpression{\n\ - \t\t\t\t\t\tX: qdrant.NewExpressionGeoDistance(&qdrant.GeoDistance{\n\t\ - \t\t\t\t\t\tOrigin: &qdrant.GeoPoint{\n\t\t\t\t\t\t\t\tLat: 52.504043,\n\ - \t\t\t\t\t\t\t\tLon: 13.393236,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tTo: \"\ - geo.location\",\n\t\t\t\t\t\t}),\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t}),\n\ - \t\t\tDefaults: qdrant.NewValueMap(map[string]any{\n\t\t\t\t\"geo.location\"\ - : map[string]any{\n\t\t\t\t\t\"lat\": 48.137154,\n\t\t\t\t\t\"lon\": 11.576124,\n\ - \t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t})\n}\n" - language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - // Query nearest by ID\nlet _nearest = client.query(\"{collection_name\"\ - , {\n query: \"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\n});\n\n// Recommend\ - \ on the average of these vectors\nlet _recommendations = client.query(\"\ - {collection_name}\", {\n query: {\n recommend: {\n \ - \ positive: [\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\", [0.11, 0.35,\ - \ 0.6]],\n negative: [0.01, 0.45, 0.67]\n }\n }\n\ - });\n\n// Fusion query\nlet _hybrid = client.query(\"{collection_name}\"\ - , {\n prefetch: [\n {\n query: {\n \ - \ values: [0.22, 0.8],\n indices: [1, 42],\n \ - \ },\n using: 'sparse',\n limit: 20,\n \ - \ },\n {\n query: [0.01, 0.45, 0.67],\n using:\ - \ 'dense',\n limit: 20,\n },\n ],\n query: {\n\ - \ fusion: 'rrf',\n },\n});\n\n// 2-stage query\nlet _refined\ - \ = client.query(\"{collection_name}\", {\n prefetch: {\n query:\ - \ [1, 23, 45, 67],\n limit: 100,\n },\n query: [\n \ - \ [0.1, 0.2],\n [0.2, 0.1],\n [0.8, 0.9],\n ],\n \ - \ using: 'colbert',\n limit: 10,\n});\n\n// Random sampling (as of\ - \ 1.11.0)\nlet _sampled = client.query(\"{collection_name}\", {\n query:\ - \ { sample: \"random\" },\n});\n\n// Score boost depending on payload\ - \ conditions (as of 1.14.0)\nconst tag_boosted = await client.query(\"\ - {collection_name}\", {\n prefetch: {\n query: [0.2, 0.8, 0.1, 0.9],\n\ - \ limit: 50\n },\n query: {\n formula: {\n sum: [\n \ - \ \"$score\",\n {\n mult: [ 0.5, { key: \"tag\", match:\ - \ { any: [\"h1\", \"h2\", \"h3\", \"h4\"] }} ]\n },\n {\n\ - \ mult: [ 0.25, { key: \"tag\", match: { any: [\"p\", \"li\"\ - ] }} ]\n }\n ]\n }\n }\n});\n\n// Score boost geographically\ - \ closer points (as of 1.14.0)\nconst distance_boosted = await client.query(\"\ - {collection_name}\", {\n prefetch: {\n query: [0.2, 0.8, ...],\n \ - \ limit: 50\n },\n query: {\n formula: {\n sum: [\n \ - \ \"$score\",\n {\n gauss_decay: {\n x: {\n\ - \ geo_distance: {\n origin: { lat: 52.504043,\ - \ lon: 13.393236 }, // Berlin\n to: \"geo.location\"\n\ - \ }\n },\n scale: 5000 // 5km\n \ - \ }\n }\n ]\n },\n defaults: { \"geo.location\"\ - : { lat: 48.137154, lon: 11.576124 } } // Munich\n }\n});\n" - language: typescript + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\n// Query nearest by ID\nawait\ + \ client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tquery:\ + \ Guid.Parse(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")\n);\n\n// Recommend\ + \ on the average of these vectors\nawait client.QueryAsync(\n\tcollectionName:\ + \ \"{collection_name}\",\n\tquery: new RecommendInput\n\t{\n\t\tPositive\ + \ =\n\t\t{\n\t\t\tGuid.Parse(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"\ + ),\n\t\t\tnew float[] { 0.11f, 0.35f, 0.6f }\n\t\t},\n\t\tNegative = {\ + \ new float[] { 0.01f, 0.45f, 0.67f } }\n\t}\n);\n\n// Fusion query\n\ + await client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\t\ + prefetch: new List\n\t{\n\t\tnew()\n\t\t{\n\t\t\tQuery\ + \ = new (float, uint)[] { (0.22f, 1), (0.8f, 42), },\n\t\t\tUsing = \"\ + sparse\",\n\t\t\tLimit = 20\n\t\t},\n\t\tnew()\n\t\t{\n\t\t\tQuery = new\ + \ float[] { 0.01f, 0.45f, 0.67f },\n\t\t\tUsing = \"dense\",\n\t\t\tLimit\ + \ = 20\n\t\t}\n\t},\n\tquery: Fusion.Rrf\n);\n\n// 2-stage query\nawait\ + \ client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tprefetch:\ + \ new List\n\t{\n\t\tnew() { Query = new float[] { 0.01f,\ + \ 0.45f, 0.67f }, Limit = 100 }\n\t},\n\tquery: new float[][] { [0.1f,\ + \ 0.2f], [0.2f, 0.1f], [0.8f, 0.9f] },\n\tusingVector: \"colbert\",\n\t\ + limit: 10\n);\n\n// Random sampling (as of 1.11.0)\nawait client.QueryAsync(\n\ + \ collectionName: \"{collection_name}\",\n query: Sample.Random\n\ + );\n\n// Score boost depending on payload conditions (as of 1.14.0)\n\ + await client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\t\ + prefetch:\n\t[\n\t\tnew PrefetchQuery { Query = new float[] { 0.01f, 0.45f,\ + \ 0.67f }, Limit = 100 },\n\t],\n\tquery: new Formula\n\t{\n\t\tExpression\ + \ = new SumExpression\n\t\t{\n\t\t\tSum =\n\t\t\t{\n\t\t\t\t\"$score\"\ + ,\n\t\t\t\tnew MultExpression\n\t\t\t\t{\n\t\t\t\t\tMult = { 0.5f, Match(\"\ + tag\", [\"h1\", \"h2\", \"h3\", \"h4\"]) },\n\t\t\t\t},\n\t\t\t\tnew MultExpression\ + \ { Mult = { 0.25f, Match(\"tag\", [\"p\", \"li\"]) } },\n\t\t\t},\n\t\ + \t},\n\t},\n\tlimit: 10\n);\n\n// Score boost geographically closer points\ + \ (as of 1.14.0)\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\"\ + ,\n\tprefetch:\n\t[\n\t\tnew PrefetchQuery { Query = new float[] { 0.01f,\ + \ 0.45f, 0.67f }, Limit = 100 },\n\t],\n\tquery: new Formula\n\t{\n\t\t\ + Expression = new SumExpression\n\t\t{\n\t\t\tSum =\n\t\t\t{\n\t\t\t\t\"\ + $score\",\n\t\t\t\tWithExpDecay(\n\t\t\t\t\tnew()\n\t\t\t\t\t{\n\t\t\t\ + \t\t\tX = new GeoDistance\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tOrigin = new GeoPoint\ + \ { Lat = 52.504043, Lon = 13.393236 },\n\t\t\t\t\t\t\tTo = \"geo.location\"\ + ,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tScale = 5000,\n\t\t\t\t\t}\n\t\t\t\t),\n\ + \t\t\t},\n\t\t},\n\t\tDefaults =\n\t\t{\n\t\t\t[\"geo.location\"] = new\ + \ Dictionary\n\t\t\t{\n\t\t\t\t[\"lat\"] = 48.137154,\n\ + \t\t\t\t[\"lon\"] = 11.576124,\n\t\t\t},\n\t\t},\n\t}\n);\n" + language: csharp /collections/{collection_name}/points/query/batch: post: description: Universally query points in batch. This endpoint covers all capabilities @@ -2299,13 +2299,6 @@ paths: tags: - Search x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.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: "use qdrant_client::{Qdrant, QdrantError};\nuse qdrant_client::qdrant::{Query,\ \ QueryPointsBuilder, QueryBatchPointsBuilder};\n\nlet request = QueryBatchPointsBuilder::new(\"\ @@ -2315,6 +2308,13 @@ paths: \ vec![0.3; 8],\n )).into(),\n]);\n\nlet response =\ \ client.query_batch(request).await?;" language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nnearest = client.query_batch_points(\n \ + \ collection_name=\"{collection_name}\",\n requests=[\n models.QueryRequest(\n\ + \ query=[0.01, 0.45, 0.67, ...],\n ),\n models.QueryRequest(\n\ + \ query=[0.11, 0.35, 0.6, ...],\n ),\n ]\n)" + language: python - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query/batch'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -2325,22 +2325,12 @@ paths: \ \"using\": \"image-vector\"\n }\n ]\n}'" language: curl - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nnearest = client.query_batch_points(\n \ - \ collection_name=\"{collection_name}\",\n requests=[\n models.QueryRequest(\n\ - \ query=[0.01, 0.45, 0.67, ...],\n ),\n models.QueryRequest(\n\ - \ query=[0.11, 0.35, 0.6, ...],\n ),\n ]\n)" - language: python - - code-samples: - - code: "import static io.qdrant.client.QueryFactory.nearest;\n\nimport java.util.List;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - import io.qdrant.client.grpc.Points.QueryPoints;\n\nQdrantClient client\ - \ =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334,\ - \ false).build());\n\nclient\n .queryBatchAsync(\n \"{collection_name}\"\ - ,\n List.of(\n QueryPoints.newBuilder().setQuery(nearest(0.1f,\ - \ 0.2f, 0.3f)).build(),\n QueryPoints.newBuilder().setQuery(nearest(0.4f,\ - \ 0.5f, 0.6f)).build()))\n .get();\n" - language: java + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.queryBatch(\"{collection_name\", {\n searches: [{\n query:\ + \ [0.01, 0.45, 0.67]\n },\n {\n query: [0.11, 0.35, 0.6]\n\ + \ }]\n});\n" + language: typescript - code-samples: - code: "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\ @@ -2355,12 +2345,22 @@ paths: Query results: \", results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.queryBatch(\"{collection_name\", {\n searches: [{\n query:\ - \ [0.01, 0.45, 0.67]\n },\n {\n query: [0.11, 0.35, 0.6]\n\ - \ }]\n});\n" - language: typescript + - 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: "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 /collections/{collection_name}/points/query/groups: post: description: Universally query points and group results by a specified payload @@ -2370,12 +2370,6 @@ paths: tags: - Search x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\"\ - , 6334);\n\nawait client.QueryGroupsAsync(\n collectionName: \"{collection_name}\"\ - ,\n groupBy: \"document_id\",\n groupSize: 5,\n limit: 10,\n query:\ - \ new float[] {\n 0.01f, 0.45f, 0.67f\n }\n);\n" - language: csharp - code-samples: - code: "use qdrant_client::Qdrant;\nuse qdrant_client::qdrant::{Query, QueryPointGroupsBuilder};\n\ \nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\ @@ -2383,6 +2377,12 @@ paths: , \"document_id\")\n .query(Query::from(vec![0.01, 0.45, 0.67]))\n\ \ .limit(10u64)\n .group_size(5u64)\n).await?;\n" language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.query_points_groups(\n collection_name=\"\ + {collection_name}\",\n query=[0.01, 0.45, 0.67],\n group_by=\"document_id\"\ + ,\n limit=10,\n group_size=5,\n)" + language: python - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/query/groups'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -2391,21 +2391,12 @@ paths: : 1,\n \"group_size\": 5\n}'" language: curl - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.query_points_groups(\n collection_name=\"\ - {collection_name}\",\n query=[0.01, 0.45, 0.67],\n group_by=\"document_id\"\ - ,\n limit=10,\n group_size=5,\n)" - language: python - - code-samples: - - code: "import java.util.List;\n\nimport static io.qdrant.client.QueryFactory.nearest;\n\ - \nimport io.qdrant.client.grpc.Points.QueryPointGroups;\nimport io.qdrant.client.grpc.Points.QueryPoints;\n\ - \n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .queryGroupsAsync(\n\ - \ QueryPointGroups.newBuilder()\n .setCollectionName(\"\ - {collection_name}\")\n .setGroupBy(\"document_id\")\n \ - \ .setGroupSize(5)\n .setLimit(10)\n .setQuery(nearest(List.of(0.01f,\ - \ 0.45f, 0.67f)))\n .build())\n .get();\n" - language: java + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.queryGroups(\"{collection_name}\", {\n query: [0.01, 0.45, 0.67],\n\ + \ group_by: \"document_id\",\n limit: 10,\n group_size: 5,\n\ + });\n" + language: typescript - code-samples: - code: "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\ @@ -2418,12 +2409,21 @@ paths: , results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.queryGroups(\"{collection_name}\", {\n query: [0.01, 0.45, 0.67],\n\ - \ group_by: \"document_id\",\n limit: 10,\n group_size: 5,\n\ - });\n" - language: typescript + - 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: "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 /collections/{collection_name}/points/recommend: post: description: Retrieves points that are closer to stored positive examples and @@ -2432,13 +2432,6 @@ paths: tags: - Search x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\ - \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendAsync(\n\ - \ \"{collection_name}\",\n positive: new ulong[] { 100, 231 },\n\ - \ negative: new ulong[] { 718 },\n filter: MatchKeyword(\"city\"\ - , \"London\"),\n limit: 3\n);\n" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{Condition, Filter, RecommendPointsBuilder,\ \ RecommendStrategy};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"\ @@ -2451,16 +2444,6 @@ paths: \ \"city\",\n \"London\".to_string(),\n )])),\n\ \ )\n .await?;\n" language: rust - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"positive\": [\n 100,\n\ - \ 231\n ],\n \"negative\": [\n \"3a6e2150-f7b7-496e-92cd-687e63e215fd\"\ - ,\n [\n 0.2,\n 0.3,\n 0.4,\n 0.5\n ]\n ],\n\ - \ \"filter\": {\n \"must\": [\n {\n \"key\": \"city\"\ - ,\n \"match\": {\n \"value\": \"London\"\n }\n\ - \ }\n ]\n },\n \"limit\": 1\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.recommend(\n collection_name=\"\ @@ -2472,21 +2455,25 @@ paths: \ )\n ]\n ),\n limit=3,\n)\n" language: python - code-samples: - - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ - import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.RecommendPoints;\n\ - import io.qdrant.client.grpc.Points.RecommendStrategy;\n\nQdrantClient\ - \ client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\"\ - , 6334, false).build());\n\nclient\n .recommendAsync(\n RecommendPoints.newBuilder()\n\ - \ .setCollectionName(\"{collection_name}\")\n .addAllPositive(List.of(id(100),\ - \ id(200)))\n .addAllPositiveVectors(List.of(vector(100.0f,\ - \ 231.0f)))\n .addAllNegative(List.of(id(718)))\n \ - \ .addAllPositiveVectors(List.of(vector(0.2f, 0.3f, 0.4f, 0.5f)))\n\ - \ .setStrategy(RecommendStrategy.AverageVector)\n \ - \ .setFilter(Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\"\ - )))\n .setLimit(3)\n .build())\n .get();\n" - language: java + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"positive\": [\n 100,\n\ + \ 231\n ],\n \"negative\": [\n \"3a6e2150-f7b7-496e-92cd-687e63e215fd\"\ + ,\n [\n 0.2,\n 0.3,\n 0.4,\n 0.5\n ]\n ],\n\ + \ \"filter\": {\n \"must\": [\n {\n \"key\": \"city\"\ + ,\n \"match\": {\n \"value\": \"London\"\n }\n\ + \ }\n ]\n },\n \"limit\": 1\n}'" + language: curl + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.recommend(\"{collection_name}\", {\n positive: [100, 231],\n\ + \ negative: [718, [0.2, 0.3, 0.4, 0.5]],\n strategy: \"average_vector\"\ + ,\n filter: {\n must: [\n {\n key:\ + \ \"city\",\n match: {\n value: \"London\"\ + ,\n },\n },\n ],\n },\n limit:\ + \ 3,\n});\n" + language: typescript - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc recommend() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2504,15 +2491,28 @@ paths: panic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.recommend(\"{collection_name}\", {\n positive: [100, 231],\n\ - \ negative: [718, [0.2, 0.3, 0.4, 0.5]],\n strategy: \"average_vector\"\ - ,\n filter: {\n must: [\n {\n key:\ - \ \"city\",\n match: {\n value: \"London\"\ - ,\n },\n },\n ],\n },\n limit:\ - \ 3,\n});\n" - language: typescript + - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ + import static io.qdrant.client.PointIdFactory.id;\nimport static io.qdrant.client.VectorFactory.vector;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.RecommendPoints;\n\ + import io.qdrant.client.grpc.Points.RecommendStrategy;\n\nQdrantClient\ + \ client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\"\ + , 6334, false).build());\n\nclient\n .recommendAsync(\n RecommendPoints.newBuilder()\n\ + \ .setCollectionName(\"{collection_name}\")\n .addAllPositive(List.of(id(100),\ + \ id(200)))\n .addAllPositiveVectors(List.of(vector(100.0f,\ + \ 231.0f)))\n .addAllNegative(List.of(id(718)))\n \ + \ .addAllPositiveVectors(List.of(vector(0.2f, 0.3f, 0.4f, 0.5f)))\n\ + \ .setStrategy(RecommendStrategy.AverageVector)\n \ + \ .setFilter(Filter.newBuilder().addMust(matchKeyword(\"city\", \"London\"\ + )))\n .setLimit(3)\n .build())\n .get();\n" + language: java + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\ + \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendAsync(\n\ + \ \"{collection_name}\",\n positive: new ulong[] { 100, 231 },\n\ + \ negative: new ulong[] { 718 },\n filter: MatchKeyword(\"city\"\ + , \"London\"),\n limit: 3\n);\n" + language: csharp /collections/{collection_name}/points/recommend/batch: post: description: Retrieves points in batches that are closer to stored positive @@ -2521,19 +2521,6 @@ paths: tags: - Search x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\ - \nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter =\ - \ MatchKeyword(\"city\", \"london\");\n\nawait client.RecommendBatchAsync(\n\ - \ collectionName: \"{collection_name}\",\n recommendSearches:\n [\n\ - \ new()\n {\n CollectionName = \"{collection_name}\",\n \ - \ Positive = { new PointId[] { 100, 231 } },\n Negative = { new\ - \ PointId[] { 718 } },\n Limit = 3,\n Filter = filter,\n \ - \ },\n new()\n {\n CollectionName = \"{collection_name}\",\n\ - \ Positive = { new PointId[] { 200, 67 } },\n Negative = { new\ - \ PointId[] { 300 } },\n Limit = 3,\n Filter = filter,\n \ - \ }\n ]\n);\n" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{\n Condition, Filter, RecommendBatchPointsBuilder,\ \ RecommendPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\nlet client\ @@ -2548,16 +2535,6 @@ paths: \ \"{collection_name}\",\n recommend_queries,\n ))\n\ \ .await?;\n" language: rust - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend/batch'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \ - \ \"positive\": [\n 100,\n 231\n ],\n \"negative\"\ - : [\n \"9ad0884a-7bfe-43c0-b88f-c1d9a588b7e1\"\n ],\n \ - \ \"limit\": 1\n },\n {\n \"positive\": [\n 200,\n\ - \ 67\n ],\n \"negative\": [\n 300\n ],\n\ - \ \"limit\": 5\n }\n ]\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nrecommend_queries = [\n models.RecommendRequest(\n\ @@ -2567,22 +2544,23 @@ paths: , requests=recommend_queries)\n" language: python - code-samples: - - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ - import static io.qdrant.client.PointIdFactory.id;\n\nimport io.qdrant.client.QdrantClient;\n\ - import io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\n\ - import io.qdrant.client.grpc.Points.RecommendPoints;\n\nQdrantClient client\ - \ =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334,\ - \ false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"\ - city\", \"London\")).build();\n\nList recommendQueries\ - \ =\n List.of(\n RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(100),\ - \ id(231)))\n .addAllNegative(List.of(id(718)))\n \ - \ .setFilter(filter)\n .setLimit(3)\n .build(),\n\ - \ RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(200),\ - \ id(67)))\n .addAllNegative(List.of(id(300)))\n \ - \ .setFilter(filter)\n .setLimit(3)\n .build());\n\ - \nclient.recommendBatchAsync(\"{collection_name}\", recommendQueries,\ - \ null).get();\n" - language: java + - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend/batch'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"searches\": [\n {\n \ + \ \"positive\": [\n 100,\n 231\n ],\n \"negative\"\ + : [\n \"9ad0884a-7bfe-43c0-b88f-c1d9a588b7e1\"\n ],\n \ + \ \"limit\": 1\n },\n {\n \"positive\": [\n 200,\n\ + \ 67\n ],\n \"negative\": [\n 300\n ],\n\ + \ \"limit\": 5\n }\n ]\n}'" + language: curl + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + const searches = [\n {\n positive: [100, 231],\n negative:\ + \ [718],\n limit: 3,\n },\n {\n positive: [200, 67],\n\ + \ negative: [300],\n limit: 3,\n },\n];\n\nclient.recommend_batch(\"\ + {collection_name}\", {\n searches,\n});\n" + language: typescript - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc recommendBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2603,13 +2581,35 @@ paths: \t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - const searches = [\n {\n positive: [100, 231],\n negative:\ - \ [718],\n limit: 3,\n },\n {\n positive: [200, 67],\n\ - \ negative: [300],\n limit: 3,\n },\n];\n\nclient.recommend_batch(\"\ - {collection_name}\", {\n searches,\n});\n" - language: typescript + - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ + import static io.qdrant.client.PointIdFactory.id;\n\nimport io.qdrant.client.QdrantClient;\n\ + import io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.Filter;\n\ + import io.qdrant.client.grpc.Points.RecommendPoints;\n\nQdrantClient client\ + \ =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334,\ + \ false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"\ + city\", \"London\")).build();\n\nList recommendQueries\ + \ =\n List.of(\n RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(100),\ + \ id(231)))\n .addAllNegative(List.of(id(718)))\n \ + \ .setFilter(filter)\n .setLimit(3)\n .build(),\n\ + \ RecommendPoints.newBuilder()\n .addAllPositive(List.of(id(200),\ + \ id(67)))\n .addAllNegative(List.of(id(300)))\n \ + \ .setFilter(filter)\n .setLimit(3)\n .build());\n\ + \nclient.recommendBatchAsync(\"{collection_name}\", recommendQueries,\ + \ null).get();\n" + language: java + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\ + \nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter =\ + \ MatchKeyword(\"city\", \"london\");\n\nawait client.RecommendBatchAsync(\n\ + \ collectionName: \"{collection_name}\",\n recommendSearches:\n [\n\ + \ new()\n {\n CollectionName = \"{collection_name}\",\n \ + \ Positive = { new PointId[] { 100, 231 } },\n Negative = { new\ + \ PointId[] { 718 } },\n Limit = 3,\n Filter = filter,\n \ + \ },\n new()\n {\n CollectionName = \"{collection_name}\",\n\ + \ Positive = { new PointId[] { 200, 67 } },\n Negative = { new\ + \ PointId[] { 300 } },\n Limit = 3,\n Filter = filter,\n \ + \ }\n ]\n);\n" + language: csharp /collections/{collection_name}/points/recommend/groups: post: description: Retrieves points that are closer to stored positive examples and @@ -2619,14 +2619,6 @@ paths: tags: - Search x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\ - \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendGroupsAsync(\n\ - \ \"{collection_name}\",\n \"document_id\",\n groupSize: 3,\n\ - \ positive: new ulong[] { 100, 231 },\n negative: new ulong[] {\ - \ 718 },\n filter: MatchKeyword(\"city\", \"London\"),\n limit:\ - \ 3\n);\n" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{RecommendPointGroupsBuilder, RecommendStrategy};\n\ use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ @@ -2635,6 +2627,12 @@ paths: \ .add_positive(200)\n .add_negative(718)\n \ \ .strategy(RecommendStrategy::AverageVector),\n )\n .await?;\n" language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.recommend_groups(\n collection_name=\"\ + {collection_name}\",\n positive=[100, 231],\n negative=[718],\n\ + \ group_by=\"document_id\",\n limit=3,\n group_size=2,\n)\n" + language: python - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/recommend/groups'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -2643,23 +2641,12 @@ paths: ,\n \"limit\": 3,\n \"group_size\": 2\n}'" language: curl - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.recommend_groups(\n collection_name=\"\ - {collection_name}\",\n positive=[100, 231],\n negative=[718],\n\ - \ group_by=\"document_id\",\n limit=3,\n group_size=2,\n)\n" - language: python - - code-samples: - - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Points.RecommendPointGroups;\nimport io.qdrant.client.grpc.Points.RecommendStrategy;\n\ - \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.recommendGroupsAsync(RecommendPointGroups.newBuilder()\n\ - \ .setCollectionName(\"{collection_name}\")\n \ - \ .setGroupBy(\"document_id\")\n .setGroupSize(2)\n\ - \ .addAllPositive(List.of(id(100), id(200)))\n \ - \ .addAllNegative(List.of(id(718)))\n .setStrategy(RecommendStrategy.AverageVector)\n\ - \ .setLimit(3)\n .build());\n" - language: java + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.recommendPointGroups(\"{collection_name}\", {\n positive: [100,\ + \ 231],\n negative: [718],\n group_by: \"document_id\",\n limit:\ + \ 3,\n group_size: 2,\n});\n" + language: typescript - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc recommendGroups() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2675,12 +2662,25 @@ paths: \ \", results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.recommendPointGroups(\"{collection_name}\", {\n positive: [100,\ - \ 231],\n negative: [718],\n group_by: \"document_id\",\n limit:\ - \ 3,\n group_size: 2,\n});\n" - language: typescript + - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.RecommendPointGroups;\nimport io.qdrant.client.grpc.Points.RecommendStrategy;\n\ + \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient.recommendGroupsAsync(RecommendPointGroups.newBuilder()\n\ + \ .setCollectionName(\"{collection_name}\")\n \ + \ .setGroupBy(\"document_id\")\n .setGroupSize(2)\n\ + \ .addAllPositive(List.of(id(100), id(200)))\n \ + \ .addAllNegative(List.of(id(718)))\n .setStrategy(RecommendStrategy.AverageVector)\n\ + \ .setLimit(3)\n .build());\n" + language: java + - code-samples: + - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\ + \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.RecommendGroupsAsync(\n\ + \ \"{collection_name}\",\n \"document_id\",\n groupSize: 3,\n\ + \ positive: new ulong[] { 100, 231 },\n negative: new ulong[] {\ + \ 718 },\n filter: MatchKeyword(\"city\", \"London\"),\n limit:\ + \ 3\n);\n" + language: csharp /collections/{collection_name}/points/scroll: post: description: 'Returns all points in a page-by-page manner. @@ -2696,12 +2696,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\ - \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.ScrollAsync(\n\ - \ collectionName: \"{collection_name}\",\n filter: MatchKeyword(\"color\"\ - , \"red\"),\n limit: 1,\n payloadSelector: true\n);\n" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{Condition, Filter, ScrollPointsBuilder};\n\ use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ @@ -2711,6 +2705,13 @@ paths: \ )]))\n .limit(1)\n .with_payload(true)\n\ \ .with_vectors(false),\n )\n .await?;\n" language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.scroll(\n collection_name=\"{collection_name}\"\ + ,\n scroll_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"\ + color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n\ + \ limit=1,\n with_payload=True,\n with_vectors=False,\n)\n" + language: python - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/scroll'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -2721,24 +2722,14 @@ paths: : false\n}'" language: curl - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.scroll(\n collection_name=\"{collection_name}\"\ - ,\n scroll_filter=models.Filter(\n must=[\n models.FieldCondition(key=\"\ - color\", match=models.MatchValue(value=\"red\")),\n ]\n ),\n\ - \ limit=1,\n with_payload=True,\n with_vectors=False,\n)\n" - language: python - - code-samples: - - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\nimport\ - \ static io.qdrant.client.WithPayloadSelectorFactory.enable;\n\nimport\ - \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.ScrollPoints;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .scrollAsync(\n \ - \ ScrollPoints.newBuilder()\n .setCollectionName(\"{collection_name}\"\ - )\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"\ - color\", \"red\")).build())\n .setLimit(1)\n .setWithPayload(enable(true))\n\ - \ .build())\n .get();\n" - language: java + - code: "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: "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\ @@ -2752,14 +2743,23 @@ paths: \ {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.scroll(\"{collection_name}\", {\n filter: {\n must: [\n\ - \ {\n key: \"color\",\n match:\ - \ {\n value: \"red\",\n },\n \ - \ },\n ],\n },\n limit: 1,\n with_payload: true,\n\ - \ with_vector: false,\n});\n" - language: typescript + - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\nimport\ + \ static io.qdrant.client.WithPayloadSelectorFactory.enable;\n\nimport\ + \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.ScrollPoints;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .scrollAsync(\n \ + \ ScrollPoints.newBuilder()\n .setCollectionName(\"{collection_name}\"\ + )\n .setFilter(Filter.newBuilder().addMust(matchKeyword(\"\ + color\", \"red\")).build())\n .setLimit(1)\n .setWithPayload(enable(true))\n\ + \ .build())\n .get();\n" + language: java + - code-samples: + - code: "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 /collections/{collection_name}/points/search: post: description: Retrieves the closest points based on vector similarity and given @@ -2768,13 +2768,6 @@ paths: tags: - Search x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\ - \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchAsync(\n\ - \ collectionName: \"{collection_name}\",\n vector: new float[] { 0.2f,\ - \ 0.1f, 0.9f, 0.7f },\n filter: MatchKeyword(\"city\", \"London\"),\n\ - \ limit: 3\n);\n" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{Condition, Filter, SearchParamsBuilder,\ \ SearchPointsBuilder};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"\ @@ -2785,6 +2778,15 @@ paths: \ )]))\n .params(SearchParamsBuilder::default().hnsw_ef(128).exact(false)),\n\ \ )\n .await?;\n" language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.search(\n collection_name=\"{collection_name}\"\ + ,\n query_filter=models.Filter(\n must=[\n models.FieldCondition(\n\ + \ key=\"city\",\n match=models.MatchValue(\n\ + \ value=\"London\",\n ),\n \ + \ )\n ]\n ),\n query_vector=[0.2, 0.1, 0.9, 0.7],\n \ + \ limit=3,\n)\n" + language: python - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -2795,14 +2797,25 @@ paths: }'" language: curl - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.search(\n collection_name=\"{collection_name}\"\ - ,\n query_filter=models.Filter(\n must=[\n models.FieldCondition(\n\ - \ key=\"city\",\n match=models.MatchValue(\n\ - \ value=\"London\",\n ),\n \ - \ )\n ]\n ),\n query_vector=[0.2, 0.1, 0.9, 0.7],\n \ - \ limit=3,\n)\n" - language: python + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.search(\"{collection_name}\", {\n filter: {\n must: [\n\ + \ {\n key: \"city\",\n match:\ + \ {\n value: \"London\",\n },\n \ + \ },\n ],\n },\n vector: [0.2, 0.1, 0.9, 0.7],\n \ + \ limit: 3,\n});\n" + language: typescript + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc search() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\tlimit := uint64(3)\n\tresults, err := client.Query(context.Background(),\ + \ &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ + \tQuery: qdrant.NewQuery(0.2, 0.1, 0.9, 0.7),\n\t\tFilter: &qdrant.Filter{\n\ + \t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"city\", \"\ + London\"),\n\t\t\t},\n\t\t},\n\t\tLimit: &limit,\n\t})\n\tif err != nil\ + \ {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" + language: go - code-samples: - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -2816,25 +2829,12 @@ paths: \ .get();\n" language: java - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc search() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\tlimit := uint64(3)\n\tresults, err := client.Query(context.Background(),\ - \ &qdrant.QueryPoints{\n\t\tCollectionName: \"{collection_name}\",\n\t\ - \tQuery: qdrant.NewQuery(0.2, 0.1, 0.9, 0.7),\n\t\tFilter: &qdrant.Filter{\n\ - \t\t\tMust: []*qdrant.Condition{\n\t\t\t\tqdrant.NewMatch(\"city\", \"\ - London\"),\n\t\t\t},\n\t\t},\n\t\tLimit: &limit,\n\t})\n\tif err != nil\ - \ {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"Results: \", results)\n}\n" - language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.search(\"{collection_name}\", {\n filter: {\n must: [\n\ - \ {\n key: \"city\",\n match:\ - \ {\n value: \"London\",\n },\n \ - \ },\n ],\n },\n vector: [0.2, 0.1, 0.9, 0.7],\n \ - \ limit: 3,\n});\n" - language: typescript + - code: "using Qdrant.Client;\nusing static Qdrant.Client.Grpc.Conditions;\n\ + \nvar client = new QdrantClient(\"localhost\", 6334);\n\nawait client.SearchAsync(\n\ + \ collectionName: \"{collection_name}\",\n vector: new float[] { 0.2f,\ + \ 0.1f, 0.9f, 0.7f },\n filter: MatchKeyword(\"city\", \"London\"),\n\ + \ limit: 3\n);\n" + language: csharp /collections/{collection_name}/points/search/batch: post: description: Retrieves the closest points in batches based on vector similarity @@ -2843,16 +2843,6 @@ paths: tags: - Search x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\ - \nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter =\ - \ MatchKeyword(\"city\", \"London\");\n\nvar searches = new List\n\ - {\n new()\n {\n Vector = { new float[] { 0.2f, 0.1f, 0.9f, 0.7f }\ - \ },\n Filter = filter,\n Limit = 3\n },\n new()\n {\n Vector\ - \ = { new float[] { 0.5f, 0.3f, 0.2f, 0.3f } },\n Filter = filter,\n\ - \ Limit = 3\n }\n};\n\nawait client.SearchBatchAsync(collectionName:\ - \ \"{collection_name}\", searches: searches);\n" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{\n Condition, Filter, SearchBatchPointsBuilder,\ \ SearchPointsBuilder,\n};\nuse qdrant_client::Qdrant;\n\nlet client =\ @@ -2865,6 +2855,16 @@ paths: ];\n\nclient\n .search_batch_points(SearchBatchPointsBuilder::new(\"\ {collection_name}\", searches))\n .await?;\n" language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nfilter_ = models.Filter(\n must=[\n \ + \ models.FieldCondition(\n key=\"city\",\n match=models.MatchValue(\n\ + \ value=\"London\",\n ),\n )\n ]\n\ + )\n\nsearch_queries = [\n models.SearchRequest(vector=[0.2, 0.1, 0.9,\ + \ 0.7], filter=filter_, limit=3),\n models.SearchRequest(vector=[0.5,\ + \ 0.3, 0.2, 0.3], filter=filter_, limit=3),\n]\n\nclient.search_batch(collection_name=\"\ + {collection_name}\", requests=search_queries)\n" + language: python - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search/batch'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -2878,29 +2878,16 @@ paths: : 3\n }\n ]\n}'" language: curl - code-samples: - - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nfilter_ = models.Filter(\n must=[\n \ - \ models.FieldCondition(\n key=\"city\",\n match=models.MatchValue(\n\ - \ value=\"London\",\n ),\n )\n ]\n\ - )\n\nsearch_queries = [\n models.SearchRequest(vector=[0.2, 0.1, 0.9,\ - \ 0.7], filter=filter_, limit=3),\n models.SearchRequest(vector=[0.5,\ - \ 0.3, 0.2, 0.3], filter=filter_, limit=3),\n]\n\nclient.search_batch(collection_name=\"\ - {collection_name}\", requests=search_queries)\n" - language: python - - code-samples: - - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\ - \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"\ - city\", \"London\")).build();\nList searches =\n List.of(\n\ - \ SearchPoints.newBuilder()\n .addAllVector(List.of(0.2f,\ - \ 0.1f, 0.9f, 0.7f))\n .setFilter(filter)\n .setLimit(3)\n\ - \ .build(),\n SearchPoints.newBuilder()\n \ - \ .addAllVector(List.of(0.5f, 0.3f, 0.2f, 0.3f))\n .setFilter(filter)\n\ - \ .setLimit(3)\n .build());\nclient.searchBatchAsync(\"\ - {collection_name}\", searches, null).get();\n" - language: java + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + const filter = {\n must: [\n {\n key: \"city\",\n\ + \ match: {\n value: \"London\",\n \ + \ },\n },\n ],\n};\n\nconst searches = [\n {\n vector:\ + \ [0.2, 0.1, 0.9, 0.7],\n filter,\n limit: 3,\n },\n\ + \ {\n vector: [0.5, 0.3, 0.2, 0.3],\n filter,\n \ + \ limit: 3,\n },\n];\n\nclient.searchBatch(\"{collection_name}\"\ + , {\n searches,\n});\n" + language: typescript - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc searchBatch() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2919,16 +2906,29 @@ paths: Query results: \", results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - const filter = {\n must: [\n {\n key: \"city\",\n\ - \ match: {\n value: \"London\",\n \ - \ },\n },\n ],\n};\n\nconst searches = [\n {\n vector:\ - \ [0.2, 0.1, 0.9, 0.7],\n filter,\n limit: 3,\n },\n\ - \ {\n vector: [0.5, 0.3, 0.2, 0.3],\n filter,\n \ - \ limit: 3,\n },\n];\n\nclient.searchBatch(\"{collection_name}\"\ - , {\n searches,\n});\n" - language: typescript + - code: "import java.util.List;\n\nimport static io.qdrant.client.ConditionFactory.matchKeyword;\n\ + \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ + \nimport io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchPoints;\n\ + \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nFilter filter = Filter.newBuilder().addMust(matchKeyword(\"\ + city\", \"London\")).build();\nList searches =\n List.of(\n\ + \ SearchPoints.newBuilder()\n .addAllVector(List.of(0.2f,\ + \ 0.1f, 0.9f, 0.7f))\n .setFilter(filter)\n .setLimit(3)\n\ + \ .build(),\n SearchPoints.newBuilder()\n \ + \ .addAllVector(List.of(0.5f, 0.3f, 0.2f, 0.3f))\n .setFilter(filter)\n\ + \ .setLimit(3)\n .build());\nclient.searchBatchAsync(\"\ + {collection_name}\", searches, null).get();\n" + language: java + - code-samples: + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\nusing static Qdrant.Client.Grpc.Conditions;\n\ + \nvar client = new QdrantClient(\"localhost\", 6334);\n\nvar filter =\ + \ MatchKeyword(\"city\", \"London\");\n\nvar searches = new List\n\ + {\n new()\n {\n Vector = { new float[] { 0.2f, 0.1f, 0.9f, 0.7f }\ + \ },\n Filter = filter,\n Limit = 3\n },\n new()\n {\n Vector\ + \ = { new float[] { 0.5f, 0.3f, 0.2f, 0.3f } },\n Filter = filter,\n\ + \ Limit = 3\n }\n};\n\nawait client.SearchBatchAsync(collectionName:\ + \ \"{collection_name}\", searches: searches);\n" + language: csharp /collections/{collection_name}/points/search/groups: post: description: Retrieves the closest points based on vector similarity and given @@ -2937,12 +2937,6 @@ paths: tags: - Search x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\"\ - , 6334);\n\nawait client.SearchGroupsAsync(\n collectionName: \"{collection_name}\"\ - ,\n vector: new float[] { 1.1f },\n groupBy: \"document_id\",\n limit:\ - \ 4,\n groupSize: 2\n);\n" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::SearchPointGroupsBuilder;\nuse qdrant_client::Qdrant;\n\ \nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\ @@ -2950,6 +2944,12 @@ paths: {collection_name}\",\n vec![1.1],\n 4,\n \"document_id\"\ ,\n 2,\n ))\n .await?;\n" language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.search_groups(\n collection_name=\"\ + {collection_name}\",\n query_vector=[1.1],\n group_by=\"document_id\"\ + ,\n limit=4,\n group_size=2,\n)\n" + language: python - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/points/search/groups'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ @@ -2958,21 +2958,11 @@ paths: \ \"limit\": 4,\n \"group_size\": 2\n}'" language: curl - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.search_groups(\n collection_name=\"\ - {collection_name}\",\n query_vector=[1.1],\n group_by=\"document_id\"\ - ,\n limit=4,\n group_size=2,\n)\n" - language: python - - code-samples: - - code: "import java.util.List;\n\nimport io.qdrant.client.QdrantClient;\n\ - import io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.SearchPointGroups;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .searchGroupsAsync(\n\ - \ SearchPointGroups.newBuilder()\n .setCollectionName(\"\ - {collection_name}\")\n .addAllVector(List.of(1.1f))\n \ - \ .setGroupBy(\"document_id\")\n .setLimit(4)\n \ - \ .setGroupSize(2)\n .build())\n .get();\n" - language: java + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.searchPointGroups(\"{collection_name}\", {\n vector: [1.1],\n\ + \ group_by: \"document_id\",\n limit: 4,\n group_size: 2,\n});\n" + language: typescript - code-samples: - code: "package client\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ \n)\n\nfunc searchGroups() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ @@ -2985,11 +2975,21 @@ paths: , results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.searchPointGroups(\"{collection_name}\", {\n vector: [1.1],\n\ - \ group_by: \"document_id\",\n limit: 4,\n group_size: 2,\n});\n" - language: typescript + - code: "import java.util.List;\n\nimport io.qdrant.client.QdrantClient;\n\ + import io.qdrant.client.QdrantGrpcClient;\n\nimport io.qdrant.client.grpc.Points.SearchPointGroups;\n\ + \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .searchGroupsAsync(\n\ + \ SearchPointGroups.newBuilder()\n .setCollectionName(\"\ + {collection_name}\")\n .addAllVector(List.of(1.1f))\n \ + \ .setGroupBy(\"document_id\")\n .setLimit(4)\n \ + \ .setGroupSize(2)\n .build())\n .get();\n" + language: java + - code-samples: + - code: "using Qdrant.Client;\n\nvar client = new QdrantClient(\"localhost\"\ + , 6334);\n\nawait client.SearchGroupsAsync(\n collectionName: \"{collection_name}\"\ + ,\n vector: new float[] { 1.1f },\n groupBy: \"document_id\",\n limit:\ + \ 4,\n groupSize: 2\n);\n" + language: csharp /collections/{collection_name}/points/search/matrix/offsets: post: description: Retrieves sparse matrix of pairwise distances between points sampled @@ -2999,12 +2999,6 @@ paths: tags: - Search x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.SearchMatrixOffsetsAsync(\n\ - \ \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"\ - ),\n sample: 100,\n limit: 5\n);" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{Condition, SearchMatrixPointsBuilder,\ \ Filter};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"\ @@ -3023,17 +3017,14 @@ paths: \ ]\n ),\n)" language: python - code-samples: - - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ - import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - import io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchMatrixPoints;\n\ - \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .searchMatrixOffsetsAsync(\n\ - \ SearchMatrixPoints.newBuilder()\n .setCollectionName(\"\ - {collection_name}\")\n .setFilter(\n Filter.newBuilder()\n\ - \ .addMust(matchKeyword(\"color\", \"red\"))\n \ - \ .build()\n )\n .setSample(100)\n\ - \ .setLimit(5)\n .build())\n .get();\n" - language: java + - code: "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: "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\ @@ -3047,14 +3038,23 @@ paths: Query results: \", results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.searchMatrixOffsets(\"{collection_name}\", {\n filter: {\n \ - \ must: [\n {\n key: \"color\",\n \ - \ match: {\n value: \"red\",\n \ - \ },\n },\n ],\n },\n sample: 100,\n \ - \ limit: 5,\n});\n" - language: typescript + - 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.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchMatrixPoints;\n\ + \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .searchMatrixOffsetsAsync(\n\ + \ SearchMatrixPoints.newBuilder()\n .setCollectionName(\"\ + {collection_name}\")\n .setFilter(\n Filter.newBuilder()\n\ + \ .addMust(matchKeyword(\"color\", \"red\"))\n \ + \ .build()\n )\n .setSample(100)\n\ + \ .setLimit(5)\n .build())\n .get();\n" + language: java + - code-samples: + - code: "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 /collections/{collection_name}/points/search/matrix/pairs: post: description: Retrieves sparse matrix of pairwise distances between points sampled @@ -3063,12 +3063,6 @@ paths: tags: - Search x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.SearchMatrixPairsAsync(\n\ - \ \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"\ - ),\n sample: 100,\n limit: 5\n);" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{Condition, SearchMatrixPointsBuilder,\ \ Filter};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"\ @@ -3087,17 +3081,14 @@ paths: \ ]\n ),\n)" language: python - code-samples: - - code: "import static io.qdrant.client.ConditionFactory.matchKeyword;\n\n\ - import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - import io.qdrant.client.grpc.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchMatrixPoints;\n\ - \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .searchMatrixPairsAsync(\n\ - \ SearchMatrixPoints.newBuilder()\n .setCollectionName(\"\ - {collection_name}\")\n .setFilter(\n Filter.newBuilder()\n\ - \ .addMust(matchKeyword(\"color\", \"red\"))\n \ - \ .build()\n )\n .setSample(100)\n\ - \ .setLimit(5)\n .build())\n .get();\n" - language: java + - code: "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: "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\ @@ -3111,31 +3102,31 @@ paths: Query results: \", results)\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.searchMatrixPairs(\"{collection_name}\", {\n filter: {\n \ - \ must: [\n {\n key: \"color\",\n \ - \ match: {\n value: \"red\",\n \ - \ },\n },\n ],\n },\n sample: 100,\n limit:\ - \ 5,\n});" - language: typescript - /collections/{collection_name}/points/vectors: - put: - description: Updates specified vectors on points. All other unspecified vectors - will stay intact. - summary: Update vectors - tags: - - Points - x-fern-examples: + - 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.Points.Filter;\nimport io.qdrant.client.grpc.Points.SearchMatrixPoints;\n\ + \nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"\ + localhost\", 6334, false).build());\n\nclient\n .searchMatrixPairsAsync(\n\ + \ SearchMatrixPoints.newBuilder()\n .setCollectionName(\"\ + {collection_name}\")\n .setFilter(\n Filter.newBuilder()\n\ + \ .addMust(matchKeyword(\"color\", \"red\"))\n \ + \ .build()\n )\n .setSample(100)\n\ + \ .setLimit(5)\n .build())\n .get();\n" + language: java - code-samples: - code: "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" + \ QdrantClient(\"localhost\", 6334);\n\nawait client.SearchMatrixPairsAsync(\n\ + \ \"{collection_name}\",\n filter: MatchKeyword(\"color\", \"red\"\ + ),\n sample: 100,\n limit: 5\n);" language: csharp + /collections/{collection_name}/points/vectors: + put: + description: Updates specified vectors on points. All other unspecified vectors + will stay intact. + summary: Update vectors + tags: + - Points + x-fern-examples: - code-samples: - code: "use qdrant_client::qdrant::{PointVectors, UpdatePointVectorsBuilder};\n\ use qdrant_client::Qdrant;\nuse std::collections::HashMap;\n\nlet client\ @@ -3154,15 +3145,6 @@ paths: \ },\n ],\n )\n .wait(true),\n )\n \ \ .await?;\n" language: rust - - code-samples: - - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points/vectors?wait=true'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"points\": [\n {\n \ - \ \"id\": 1,\n \"vector\": [\n 0.0984,\n 0.1406,\n\ - \ 0.8973\n ]\n },\n {\n \"id\": 2,\n \"vector\"\ - : {\n \"vector-name\": [\n 0.9,\n 0.8,\n \ - \ 0.7,\n 0.6\n ]\n }\n }\n ]\n}'" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient, models\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.update_vectors(\n collection_name=\"\ @@ -3173,6 +3155,39 @@ paths: \ 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n ),\n \ \ ],\n)\n" language: python + - code-samples: + - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/points/vectors?wait=true'\ + \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ + \ application/json' \\\n --data-raw '{\n \"points\": [\n {\n \ + \ \"id\": 1,\n \"vector\": [\n 0.0984,\n 0.1406,\n\ + \ 0.8973\n ]\n },\n {\n \"id\": 2,\n \"vector\"\ + : {\n \"vector-name\": [\n 0.9,\n 0.8,\n \ + \ 0.7,\n 0.6\n ]\n }\n }\n ]\n}'" + language: curl + - code-samples: + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.updateVectors(\"{collection_name}\", {\n points: [\n \ + \ {\n id: 1,\n vector: {\n image:\ + \ [0.1, 0.2, 0.3, 0.4],\n },\n },\n {\n \ + \ id: 2,\n vector: {\n text: [0.9, 0.8,\ + \ 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n },\n ],\n\ + });\n" + language: typescript + - code-samples: + - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc updateVectors() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\t_, err = client.UpdateVectors(context.Background(),\ + \ &qdrant.UpdatePointVectors{\n\t\tCollectionName: \"{collection_name}\"\ + ,\n\t\tPoints: []*qdrant.PointVectors{\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(1),\n\ + \t\t\t\tVectors: qdrant.NewVectorsMap(map[string]*qdrant.Vector{\n\t\t\ + \t\t\t\"image\": qdrant.NewVector(0.1, 0.2, 0.3, 0.4),\n\t\t\t\t}),\n\t\ + \t\t},\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(2),\n\t\t\t\tVectors: qdrant.NewVectorsMap(map[string]*qdrant.Vector{\n\ + \t\t\t\t\t\"text\": qdrant.NewVector(0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3,\ + \ 0.2),\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\t\ + panic(err)\n\t}\n}\n" + language: go - code-samples: - code: "import static io.qdrant.client.PointIdFactory.id;\nimport static\ \ io.qdrant.client.VectorFactory.vector;\nimport static io.qdrant.client.VectorsFactory.namedVectors;\n\ @@ -3190,29 +3205,14 @@ paths: \ .get();\n" language: java - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc updateVectors() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\t_, err = client.UpdateVectors(context.Background(),\ - \ &qdrant.UpdatePointVectors{\n\t\tCollectionName: \"{collection_name}\"\ - ,\n\t\tPoints: []*qdrant.PointVectors{\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(1),\n\ - \t\t\t\tVectors: qdrant.NewVectorsMap(map[string]*qdrant.Vector{\n\t\t\ - \t\t\t\"image\": qdrant.NewVector(0.1, 0.2, 0.3, 0.4),\n\t\t\t\t}),\n\t\ - \t\t},\n\t\t\t{\n\t\t\t\tId: qdrant.NewIDNum(2),\n\t\t\t\tVectors: qdrant.NewVectorsMap(map[string]*qdrant.Vector{\n\ - \t\t\t\t\t\"text\": qdrant.NewVector(0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3,\ - \ 0.2),\n\t\t\t\t}),\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\t\ - panic(err)\n\t}\n}\n" - language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.updateVectors(\"{collection_name}\", {\n points: [\n \ - \ {\n id: 1,\n vector: {\n image:\ - \ [0.1, 0.2, 0.3, 0.4],\n },\n },\n {\n \ - \ id: 2,\n vector: {\n text: [0.9, 0.8,\ - \ 0.7, 0.6, 0.5, 0.4, 0.3, 0.2],\n },\n },\n ],\n\ - });\n" - language: typescript + - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ + \ QdrantClient(\"localhost\", 6334);\n\nawait client.UpdateVectorsAsync(\n\ + \ collectionName: \"{collection_name}\",\n points: new List\n\ + \ {\n new() { Id = 1, Vectors = (\"image\", new float[] { 0.1f, 0.2f,\ + \ 0.3f, 0.4f }) },\n new()\n {\n Id = 2,\n Vectors = (\"\ + text\", new float[] { 0.9f, 0.8f, 0.7f, 0.6f, 0.5f, 0.4f, 0.3f, 0.2f })\n\ + \ }\n }\n);\n" + language: csharp /collections/{collection_name}/points/vectors/delete: post: description: Deletes specified vectors from points. All other unspecified vectors @@ -3221,18 +3221,6 @@ paths: tags: - Points x-fern-examples: - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.DeleteVectorsAsync("{collection_name}", ["text", "image"], - [0, 3, 10]); - - ' - language: csharp - code-samples: - code: "use qdrant_client::qdrant::{DeletePointVectorsBuilder, PointsIdsList,\ \ VectorsSelector};\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"\ @@ -3243,6 +3231,12 @@ paths: \ {\n names: vec![\"text\".into(), \"image\".into()],\n\ \ })\n .wait(true),\n )\n .await?;\n" language: rust + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.delete_vectors(\n collection_name=\"\ + {collection_name}\",\n points=[0, 3, 100],\n vectors=[\"text\",\ + \ \"image\"],\n)\n" + language: python - 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:\ @@ -3256,19 +3250,11 @@ paths: : [\n \"text\",\n \"image\"\n ]\n}'" language: curl - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.delete_vectors(\n collection_name=\"\ - {collection_name}\",\n points=[0, 3, 100],\n vectors=[\"text\",\ - \ \"image\"],\n)\n" - language: python - - code-samples: - - code: "import static io.qdrant.client.PointIdFactory.id;\n\nimport java.util.List;\n\ - \nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient\n .deleteVectorsAsync(\n\ - \ \"{collection_name}\", List.of(\"text\", \"image\"), List.of(id(0),\ - \ id(3), id(10)))\n .get();\n" - language: java + - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ + \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ + client.deleteVectors(\"{collection_name}\", {\n points: [0, 3, 10],\n\ + \ vectors: [\"text\", \"image\"],\n});\n" + language: typescript - code-samples: - code: "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\ @@ -3281,11 +3267,25 @@ paths: \t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ - client.deleteVectors(\"{collection_name}\", {\n points: [0, 3, 10],\n\ - \ vectors: [\"text\", \"image\"],\n});\n" - language: typescript + - 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: 'using Qdrant.Client; + + + var client = new QdrantClient("localhost", 6334); + + + await client.DeleteVectorsAsync("{collection_name}", ["text", "image"], + [0, 3, 10]); + + ' + language: csharp /collections/{collection_name}/points/{id}: get: description: Retrieves all details from a single point. @@ -3299,12 +3299,6 @@ paths: tags: - Distributed x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.CreateShardKeyAsync(\n\ - \ \"{collection_name}\",\n new CreateShardKey { ShardKey = new ShardKey\ - \ { Keyword = \"{shard_key}\", } }\n);\n" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::shard_key::Key;\nuse qdrant_client::qdrant::{CreateShardKeyBuilder,\ \ CreateShardKeyRequestBuilder};\nuse qdrant_client::Qdrant;\n\nlet client\ @@ -3314,12 +3308,6 @@ paths: \ .shard_key(Key::Keyword(\"{shard_key}\".to_string())),\n\ \ ),\n )\n .await?;\n" language: rust - - code-samples: - - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/shards'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"shard_key\": \"{shard_key}\"\ - \n}'" - language: curl - code-samples: - code: 'from qdrant_client import QdrantClient @@ -3331,6 +3319,26 @@ 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: "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: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc createShardKey() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\terr = client.CreateShardKey(context.Background(),\ + \ \"{collection_name}\", &qdrant.CreateShardKey{\n\t\tShardKey: qdrant.NewShardKey(\"\ + {shard_key}\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go - code-samples: - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport\ \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -3343,19 +3351,11 @@ paths: \ .build())\n .build()).get();\n" language: java - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc createShardKey() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\terr = client.CreateShardKey(context.Background(),\ - \ \"{collection_name}\", &qdrant.CreateShardKey{\n\t\tShardKey: qdrant.NewShardKey(\"\ - {shard_key}\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n\ - });\n\nclient.createShardKey(\"{collection_name}\", {\n shard_key:\ - \ \"{shard_key}\"\n});\n" - language: typescript + - 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 /collections/{collection_name}/shards/delete: post: description: Deletes one or more shard keys for a specified collection. @@ -3363,12 +3363,6 @@ paths: tags: - Distributed x-fern-examples: - - code-samples: - - code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new\ - \ QdrantClient(\"localhost\", 6334);\n\nawait client.DeleteShardKeyAsync(\n\ - \ \"{collection_name}\",\n new DeleteShardKey { ShardKey = new ShardKey\ - \ { Keyword = \"shard_key\", } }\n);\n" - language: csharp - code-samples: - code: "use qdrant_client::qdrant::shard_key::Key;\nuse qdrant_client::qdrant::DeleteShardKeyRequestBuilder;\n\ use qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://localhost:6334\"\ @@ -3376,12 +3370,6 @@ paths: {collection_name}\")\n .key(Key::Keyword(\"{shard_key}\".to_string())),\n\ \ )\n .await?;\n" language: rust - - code-samples: - - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/shards/delete'\ - \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ - \ application/json' \\\n --data-raw '{\n \"shard_key\": \"{shard_key}\"\ - \n}'" - language: curl - code-samples: - code: 'from qdrant_client import QdrantClient @@ -3393,6 +3381,26 @@ 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: "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: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ + \n)\n\nfunc deleteShardKey() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ + \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ + \tpanic(err)\n\t}\n\n\terr = client.DeleteShardKey(context.Background(),\ + \ \"{collection_name}\", &qdrant.DeleteShardKey{\n\t\tShardKey: qdrant.NewShardKey(\"\ + {shard_key}\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" + language: go - code-samples: - code: "import static io.qdrant.client.ShardKeyFactory.shardKey;\n\nimport\ \ io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ @@ -3405,19 +3413,11 @@ paths: \ .build())\n .build()).get();\n" language: java - code-samples: - - code: "package client\n\nimport (\n\t\"context\"\n\n\t\"github.com/qdrant/go-client/qdrant\"\ - \n)\n\nfunc deleteShardKey() {\n\tclient, err := qdrant.NewClient(&qdrant.Config{\n\ - \t\tHost: \"localhost\",\n\t\tPort: 6334,\n\t})\n\tif err != nil {\n\t\ - \tpanic(err)\n\t}\n\n\terr = client.DeleteShardKey(context.Background(),\ - \ \"{collection_name}\", &qdrant.DeleteShardKey{\n\t\tShardKey: qdrant.NewShardKey(\"\ - {shard_key}\"),\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" - language: go - - code-samples: - - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ - \ client = new QdrantClient({\n host: \"localhost\",\n port: 6333\n\ - });\n\nclient.deleteShardKey(\"{collection_name}\", {\n shard_key:\ - \ \"{shard_key}\"\n});\n" - language: typescript + - 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 /collections/{collection_name}/shards/{shard_id}/snapshots: get: description: Returns a list of all snapshots for a shard from a collection. @@ -3463,48 +3463,42 @@ paths: - Snapshots x-fern-examples: - code-samples: - - code: 'using Qdrant.Client; + - code: 'use qdrant_client::Qdrant; - var client = new QdrantClient("localhost", 6334); + let client = Qdrant::from_url("http://localhost:6334").build()?; - await client.ListSnapshotsAsync("{collection_name}"); + client.list_snapshots("{collection_name}").await?; ' - language: csharp + language: rust - code-samples: - - code: 'use qdrant_client::Qdrant; + - code: 'from qdrant_client import QdrantClient - let client = Qdrant::from_url("http://localhost:6334").build()?; + client = QdrantClient(url="http://localhost:6333") - client.list_snapshots("{collection_name}").await?; + client.list_snapshots(collection_name="{collection_name}") ' - language: rust + language: python - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/collections/collection_name/snapshots'\ \ \\\n --header 'api-key: '" language: curl - code-samples: - - code: 'from qdrant_client import QdrantClient + - 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 - - 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 + language: typescript - 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\ @@ -3514,16 +3508,22 @@ paths: Snapshots: \", snapshots)\n}\n" language: go - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - 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: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.listSnapshots("{collection_name}"); + await client.ListSnapshotsAsync("{collection_name}"); ' - language: typescript + language: csharp post: description: Creates a new snapshot for a specified collection. summary: Create a snapshot (collection) @@ -3531,48 +3531,42 @@ paths: - Snapshots x-fern-examples: - code-samples: - - code: 'using Qdrant.Client; + - code: 'use qdrant_client::Qdrant; - var client = new QdrantClient("localhost", 6334); + let client = Qdrant::from_url("http://localhost:6334").build()?; - await client.CreateSnapshotAsync("{collection_name}"); + client.create_snapshot("{collection_name}").await?; ' - language: csharp + language: rust - code-samples: - - code: 'use qdrant_client::Qdrant; + - code: 'from qdrant_client import QdrantClient - let client = Qdrant::from_url("http://localhost:6334").build()?; + client = QdrantClient(url="http://localhost:6333") - client.create_snapshot("{collection_name}").await?; + client.create_snapshot(collection_name="{collection_name}") ' - language: rust + language: python - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/collections/collection_name/snapshots'\ \ \\\n --header 'api-key: '" language: curl - 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 - - code-samples: - - code: "import io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\n\ - \nQdrantClient client = new QdrantClient(\n QdrantGrpcClient.newBuilder(\"\ - localhost\", 6334, false).build());\n\nclient.createSnapshotAsync(\"{collection_name}\"\ - ).get();\n" - language: java + language: typescript - 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\ @@ -3582,16 +3576,22 @@ paths: Snapshot created: \", snapshot.Name)\n}\n" language: go - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - 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: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.createSnapshot("{collection_name}"); + await client.CreateSnapshotAsync("{collection_name}"); ' - language: typescript + language: csharp /collections/{collection_name}/snapshots/recover: put: description: Recovers local collection data from a snapshot. This will overwrite @@ -3601,17 +3601,17 @@ paths: tags: - Snapshots x-fern-examples: + - code-samples: + - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ + http://localhost:6333\")\n\nclient.recover_snapshot(\n \"{collection_name}\"\ + ,\n \"http://example.com/path/to/snapshot.shapshot\",\n)\n" + language: python - code-samples: - code: "curl -X PUT \\\n 'http://localhost:6333/collections/collection_name/snapshots/recover'\ \ \\\n --header 'api-key: ' \\\n --header 'Content-Type:\ \ application/json' \\\n --data-raw '{\n \"location\": \"http://example.com/path/to/snapshot.shapshot\"\ \n}'" language: curl - - code-samples: - - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ - http://localhost:6333\")\n\nclient.recover_snapshot(\n \"{collection_name}\"\ - ,\n \"http://example.com/path/to/snapshot.shapshot\",\n)\n" - language: python - code-samples: - code: "import { QdrantClient } from \"@qdrant/js-client-rest\";\n\nconst\ \ client = new QdrantClient({ host: \"localhost\", port: 6333 });\n\n\ @@ -3638,17 +3638,6 @@ paths: tags: - Snapshots x-fern-examples: - - code-samples: - - code: 'using Qdrant.Client; - - - var client = new QdrantClient("localhost", 6334); - - - await client.DeleteSnapshotAsync("{collection_name}", "{snapshot_name}"); - - ' - language: csharp - code-samples: - code: "use qdrant_client::qdrant::DeleteSnapshotRequestBuilder;\nuse qdrant_client::Qdrant;\n\ \nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\ @@ -3656,21 +3645,26 @@ paths: \ \"{collection_name}\",\n \"{snapshot_name}\",\n ))\n\ \ .await?;\n" language: rust - - code-samples: - - code: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/snapshots/snapshot_name'\ - \ \\\n --header 'api-key: '" - language: curl - code-samples: - code: "from qdrant_client import QdrantClient\n\nclient = QdrantClient(url=\"\ http://localhost:6333\")\n\nclient.delete_snapshot(\n collection_name=\"\ {collection_name}\", snapshot_name=\"{snapshot_name}\"\n)\n" language: python - code-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: "curl -X DELETE \\\n 'http://localhost:6333/collections/collection_name/snapshots/snapshot_name'\ + \ \\\n --header 'api-key: '" + language: curl + - code-samples: + - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + + + const client = new QdrantClient({ host: "localhost", port: 6333 }); + + + client.deleteSnapshot("{collection_name}", "{snapshot_name}"); + + ' + language: typescript - code-samples: - code: "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\ @@ -3680,16 +3674,22 @@ paths: panic(err)\n\t}\n}\n" language: go - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - 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: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.deleteSnapshot("{collection_name}", "{snapshot_name}"); + await client.DeleteSnapshotAsync("{collection_name}", "{snapshot_name}"); ' - language: typescript + language: csharp get: description: Downloads the specified snapshot file from a collection. summary: Download a snapshot (collection) @@ -3752,47 +3752,42 @@ paths: - Snapshots x-fern-examples: - code-samples: - - code: 'using Qdrant.Client; + - code: 'use qdrant_client::Qdrant; - var client = new QdrantClient("localhost", 6334); + let client = Qdrant::from_url("http://localhost:6334").build()?; - await client.ListFullSnapshotsAsync(); + client.list_full_snapshots().await?; ' - language: csharp + language: rust - code-samples: - - code: 'use qdrant_client::Qdrant; + - code: 'from qdrant_client import QdrantClient - let client = Qdrant::from_url("http://localhost:6334").build()?; + client = QdrantClient(url="http://localhost:6333") - client.list_full_snapshots().await?; + client.list_full_snapshots() ' - language: rust + language: python - code-samples: - code: "curl -X GET \\\n 'http://localhost:6333/snapshots' \\\n --header\ \ 'api-key: '" language: curl - code-samples: - - code: 'from qdrant_client import QdrantClient + - 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 - - 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 + language: typescript - 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\ @@ -3802,16 +3797,21 @@ paths: \ \", snapshots)\n}\n" language: go - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - 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: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.listFullSnapshots(); + await client.ListFullSnapshotsAsync(); ' - language: typescript + language: csharp post: description: Creates a new snapshot of the entire storage. summary: Create a snapshot (storage) @@ -3819,47 +3819,42 @@ paths: - Snapshots x-fern-examples: - code-samples: - - code: 'using Qdrant.Client; + - code: 'use qdrant_client::Qdrant; - var client = new QdrantClient("localhost", 6334); + let client = Qdrant::from_url("http://localhost:6334").build()?; - await client.CreateFullSnapshotAsync(); + client.create_full_snapshot().await?; ' - language: csharp + language: rust - code-samples: - - code: 'use qdrant_client::Qdrant; + - code: 'from qdrant_client import QdrantClient - let client = Qdrant::from_url("http://localhost:6334").build()?; + client = QdrantClient(url="http://localhost:6333") - client.create_full_snapshot().await?; + client.create_full_snapshot() ' - language: rust + language: python - code-samples: - code: "curl -X POST \\\n 'http://localhost:6333/snapshots' \\\n --header\ \ 'api-key: '" language: curl - 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 - - 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 + language: typescript - 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\ @@ -3869,16 +3864,21 @@ paths: \ \", snapshot.Name)\n}\n" language: go - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - 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: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.createFullSnapshot(); + await client.CreateFullSnapshotAsync(); ' - language: typescript + language: csharp /snapshots/{snapshot_name}: delete: description: Deletes the specified snapshot of the entire storage. @@ -3887,48 +3887,42 @@ paths: - Snapshots x-fern-examples: - code-samples: - - code: 'using Qdrant.Client; + - code: 'use qdrant_client::Qdrant; - var client = new QdrantClient("localhost", 6334); + let client = Qdrant::from_url("http://localhost:6334").build()?; - await client.DeleteFullSnapshotAsync("{snapshot_name}"); + client.delete_full_snapshot("{snapshot_name}").await?; ' - language: csharp + language: rust - code-samples: - - code: 'use qdrant_client::Qdrant; + - code: 'from qdrant_client import QdrantClient - let client = Qdrant::from_url("http://localhost:6334").build()?; + client = QdrantClient(url="http://localhost:6333") - client.delete_full_snapshot("{snapshot_name}").await?; + client.delete_full_snapshot(snapshot_name="{snapshot_name}") ' - language: rust + language: python - code-samples: - code: "curl -X DELETE \\\n 'http://localhost:6333/snapshots/snapshot_name'\ \ \\\n --header 'api-key: '" language: curl - 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 - - 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 + language: typescript - 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\ @@ -3937,16 +3931,22 @@ paths: \ \"{snapshot_name}\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n" language: go - code-samples: - - code: 'import { QdrantClient } from "@qdrant/js-client-rest"; + - 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: 'using Qdrant.Client; - const client = new QdrantClient({ host: "localhost", port: 6333 }); + var client = new QdrantClient("localhost", 6334); - client.deleteFullSnapshot("{snapshot_name}"); + await client.DeleteFullSnapshotAsync("{snapshot_name}"); ' - language: typescript + language: csharp get: description: Downloads the specified snapshot of the entire storage as a file. summary: Download a snapshot (storage)