php连接qdrant进行向量数据插入和相似查询代码
代码语言:php
所属分类:其他
代码描述:php连接qdrant进行向量数据插入和相似查询代码
代码标签: php 连接 qdrant 进行 向量 数据 插入 相似 查询 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<?php // 创建集合 function createCollection() { $url = 'http://localhost:6333/collections/test'; $data = array( "vectors" => array( "size" => 4, "distance" => "Dot" ) ); $ch = curl_init($url); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); $response = curl_ex.........完整代码请登录后点击上方下载按钮下载查看
网友评论0