【少女人妻的30天Elastic】Day 29 : App Search_API 介绍与应用_Curations

Aloha!我是少女人妻 Uerica!这个周末朋友要求婚了~朋友前阵子喝了一点然後问我婚姻的感觉是什麽?我回他你想要婚姻是什麽样子,那就会是什麽样子。人与人相处终究都是强迫认识自己的过程,不过结婚也好单身也好,无论什麽样的状态,我都还是自己啊~价值不因外在改变而改变,人生才会过得快乐呢~~

Curations API

有关Curations的运用与介绍

Curations 隐藏与提升搜寻结果的内容
Curations 的翻译是策展,其实就是专门管理搜寻结果的推广 Promoted 与隐藏 Hidden。

认证方式为 Private API Key

curl -X GET '{API_Endpoint}/api/as/v1/engines/{ENGINE_NAME}/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxx' \

List Curations 列出策展 GET

Listing All Curations 列出所有策展

回传所有调整过的策展内容

page (optional) : 回传当前页面 current 、结果总页数 total_pages 、结果总笔数 total_results 、每页最大笔数限制 size (预设为25笔)

用 GET 方法,不带参数回传所有策展结果

curl -X GET '{API_Endpoint}/api/as/v1/engines/{ENGINE_NAME}/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxx' \
-d ''

Listing All Curations with Pagination

指定回传的页数与笔数

curl -X GET '{API_Endpoint}/api/as/v1/engines/{ENGINE_NAME}/curations' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxx' \
-d '{
  "page": {
    "size": 20,
    "current": 2
  }
}'

Listing a Single Curation

回传指定id的策展资料

用 GET 方法,带入id不需参数,回传指定的策展资料

curl -X GET '{API_Endpoint}/api/as/v1/engines/{ENGINE_NAME}/curations/[CURATION_ID]' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxx' \
-d ''

Create Curations 创建新策展 POST

  • queries (required) : 可以提供一个或多个同义字查询,但一次只能创建一种字词的查询
  • promoted (optional) : 提供要 promoted 的资料
  • hidden (optional) : 提供要 hidden 的资料

用 POST 创建新策展

curl -X POST '{API_Endpoint}/api/as/v1/engines/{ENGINE_NAME}/curations/[CURATION_ID]' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxx' \
-d '{
  "queries": [
    "banana", "bananana", "bonana", "nanner"
  ],
  "promoted": [
    "doc-123", "doc-234", "doc-345"
  ],
  "hidden": [
    "doc-987", "doc-a8b7c6", "doc-765"
  ]
}'

范例回传结果

{
  "id": "cur-a1b2c3"
}

Update Curations 更新策展 PUT

用 PUT 更新策展资讯

curl -X PUT '{API_Endpoint}/api/as/v1/engines/{ENGINE_NAME}/curations/[CURATION_ID]' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxx' \
-d '{
  "queries": [
    "banana", "bananza", "bananas", "bonana"
  ],
  "promoted": [
    "doc-a1b2c3", "doc-a3b3c4", "doc-445"
  ],
  "hidden": [
    "doc-a9b8c7"
  ]
}'

Delete Curations 删除策展 DELETE

用 DELETE 删除指定id的策展

curl -X DELETE '{API_Endpoint}/api/as/v1/engines/{ENGINE_NAME}/curations/[CURATION_ID]' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxx' \
-d ''

感谢阅读,今天就到这边拉~明天就是最後一篇文章了,真是让人舍不得啊!


<<:  [29] 30 天从 Swift 学会 Objective-C:Swift friendly 的 进阶 C 语言部分与 modulemap

>>:  二、教你怎麽看source code,找到核心程序码 ep.22:Deeplab的model 部署

MyBatis 实际测试

MyBatis 实际测试 ...

右键卡卡转圈圈…Delphi执行外部程序 ShellExec API习作

右键卡卡转圈圈…Delphi执行外部程序 ShellExec API习作 前言动机: 电脑内软件愈灌...

[Day 29]老师我学逻辑推论做什麽(4)

36:所以老师我学逻辑推论到底要做什麽呢 RN:我觉得只是因为学校一味的叫你们证明东证明西所以才让你...

行动商务系统设计与开发!

职训局的课程目前已上了3天课,目前还是在新手学习阶段,初接触visual studio程序,试着使用...

软件测试类型

-测试类型 .静态测试是一种测试,其中被测软件 (software under test:SUT)...