当前位置: 首页 > news >正文

网站开发课程改革广东企业网站建设公司价格

网站开发课程改革,广东企业网站建设公司价格,wordpress 上下篇,西安小程序开发的公司本文介绍如何通过HTTP API向Collection中插入或更新Doc。 说明 若调用本接口时Doc Id已存在,则等同于更新Doc;Doc Id不存在,则等同于插入Doc。 若调用本接口时不指定Doc Id,则等同于插入Doc,DashVector会自动生成Doc …

本文介绍如何通过HTTP API向Collection中插入或更新Doc。


说明

  1. 若调用本接口时Doc Id已存在,则等同于更新Doc;Doc Id不存在,则等同于插入Doc。

  2. 若调用本接口时不指定Doc Id,则等同于插入Doc,DashVector会自动生成Doc Id,并在返回结果中携带id信息。

前提条件

  • 已创建Cluster:创建Cluster。

  • 已获得API-KEY:API-KEY管理。

Method与URL

HTTP

POST https://{Endpoint}/v1/collections/{CollectionName}/docs/upsert

使用示例

说明

  1. 需要使用您的api-key替换示例中的YOUR_API_KEY、您的Cluster Endpoint替换示例中的YOUR_CLUSTER_ENDPOINT,代码才能正常运行。

  2. 本示例需要参考新建Collection-使用示例提前创建好名称为quickstart的Collection

插入或更新Doc

Shell

curl -XPOST \-H 'dashvector-auth-token: YOUR_API_KEY' \-H 'Content-Type: application/json' \-d '{"docs": [{"id": "1", "vector": [0.1, 0.2, 0.3, 0.4]}]}' https://YOUR_CLUSTER_ENDPOINT/v1/collections/quickstart/docs/upsert# example output:
# {"request_id":"1b8b4ada-1148-49ce-82e3-f7f521bb6f3b","code":0,"message":"Success","output":[{"doc_op":"insert","id":"1","code":0,"message":""}]}

插入或更新不带有Id的Doc

Shell

curl -XPOST \-H 'dashvector-auth-token: YOUR_API_KEY' \-H 'Content-Type: application/json' \-d '{"docs": [{"vector": [0.1, 0.2, 0.3, 0.4]}]}' https://YOUR_CLUSTER_ENDPOINT/v1/collections/quickstart/docs/upsert# example output:
# {"request_id":"9c3f2441-c47b-43a0-bb84-127ff6a88711","code":0,"message":"Success","output":[{"doc_op":"insert","id":"6176745980928","code":0,"message":""}]}

插入或更新带有Fields的Doc

Shell

curl -XPOST \-H 'dashvector-auth-token: YOUR_API_KEY' \-H 'Content-Type: application/json' \-d '{"docs": [{"id": "2", "vector": [0.2, 0.3, 0.4, 0.5], "fields": {"age": 70, "name": "zhangshan","anykey1": "str-value","anykey2": 1,"anykey3": true,"anykey4": 3.1415926}}]}' https://YOUR_CLUSTER_ENDPOINT/v1/collections/quickstart/docs/upsert# example output:
# {"request_id":"e1467d91-f4fd-4944-9ec0-1634de426db1","code":0,"message":"Success","output":[{"doc_op":"insert","id":"2","code":0,"message":""}]}

批量插入或更新Doc

Shell

curl -XPOST \-H 'dashvector-auth-token: YOUR_API_KEY' \-H 'Content-Type: application/json' \-d '{ "docs": [ {"id": "3", "vector": [0.3, 0.4, 0.5, 0.6]},{"id": "4", "vector": [0.4, 0.5, 0.6, 0.7], "fields": {"age": 20, "name": "zhangsan"}},{"id": "5", "vector": [0.5, 0.6, 0.7, 0.8], "fields": {"anykey": "anyvalue"}}]}' https://YOUR_CLUSTER_ENDPOINT/v1/collections/quickstart/docs/upsert# example output:
# {"request_id":"113d221b-ec79-4fde-b546-58db5154e49d","code":0,"message":"Success","output":[{"doc_op":"insert","id":"3","code":0,"message":""},{"doc_op":"insert","id":"4","code":0,"message":""},{"doc_op":"insert","id":"5","code":0,"message":""}]}

插入或更新带有Sparse Vector的Doc

Shell

curl -XPOST \-H 'dashvector-auth-token: YOUR_API_KEY' \-H 'Content-Type: application/json' \-d '{"docs": [{"id": "6", "vector": [0.1, 0.2, 0.3, 0.4], "sparse_vector":{"1":0.4, "10000":0.6, "222222":0.8}}]}' https://YOUR_CLUSTER_ENDPOINT/v1/collections/quickstart/docs/upsert# example output:
# {"request_id":"c401e51d-430e-4c49-9d07-c944ec94de7b","code":0,"message":"Success","output":[{"doc_op":"insert","id":"6","code":0,"message":""}]}

入参描述

参数

Location

类型

必填

说明

{Endpoint}

path

str

Cluster的Endpoint,可在控制台Cluster详情中查看

{CollectionName}

path

str

Collection名称

dashvector-auth-token

header

str

api-key

docs

body

array

待更新或插入的Doc列表

partition

body

str

Partition名称

出参描述

字段

类型

描述

示例

code

int

返回值,参考返回状态码说明

0

message

str

返回消息

success

request_id

str

请求唯一id

19215409-ea66-4db9-8764-26ce2eb5bb99

output

array

返回插入或更新Doc的结果,DocOpResult列表

usage

map

对Serverless实例(按量付费)集合的Doc插入或更新请求,成功后返回实际消耗的写请求单元数

{Usage: {write_units: 4}
}
http://www.yayakq.cn/news/406775/

相关文章:

  • 正规的外包加工订单网有哪些网站seo关键词排名查询
  • seo网站优化服务合同wordpress google字体 插件
  • 美术馆网站建设总体要求网站配色案例分析
  • 网站如何做担保交易交易平台app下载
  • 阿里云做网站用哪个镜像wordpress首页翻页
  • 东莞ppt免费模板下载网站网站的具体内容
  • 购物网站开发实例网上注册公司流程视频
  • 如何在别人网站挂黑链wordpress h1 h2
  • 团购网站建设报价网站建设软文推广
  • 学校资源网站建设方案蓝色网站素材
  • 珠海移动网站建设公司排名网站服务器网络
  • 网站数据怎么会丢失展开网站建设
  • 新闻cms静态网站模板广州品牌设计工作室
  • 微信菜单怎么做微网站株洲网站定制
  • 网站备案核验点 上海泰州住房和城乡建设厅网站首页
  • 在线字体设计谷歌优化教程
  • 12380网站的建设情况做网站的软件淘汰史
  • 做网络主播网站违法吗no7wordpress
  • 公司网站是怎么做的建设网站应该注意的地方
  • 汕头教育学会网站建设房地产开发网站建设
  • 赫山区住房和城乡建设局网站wordpress大家都用什么主题
  • 网站建设图片大全wordpress财务会计系统
  • 宁乡网站开发电商网站 模板
  • 石家庄网站排名优化哪家好怎么在抖音上卖东西
  • 国内专门做旅游攻略的网站在长沙阳光医院做网站编辑
  • 电子商务与网站建设实践论文网站地图怎么生成
  • 网站开发php学校企业网站推广渠道
  • 网站开发电子书石材公司网站源码
  • 优化网站关键词如何查询网站的域名注册
  • 贵州最好的网站建设推广公司哪家好微信怎么弄小程序卖东西