javascript - Push Data with API REST in Algolia
问题描述
I'm learning to use angolia, but I have a question about it. Is it possible to push data to an index with API REST?
I have only seen to use API CLIENT, installed for Javascript with npm, but I don't want to install it.
what I want it's something like that:
curl -X POST 'https://places-dsn.algolia.net/1/places/query' \
-H 'X-Algolia-Application-Id: YourApplicationId' \
-H 'X-Algolia-API-Key: YourAPIKey' \
--data '{"query": "Paris"}
解决方案
There is a RESTful API available, but there is no SLA when using it directly.
Here's an example:
curl -X POST \
-H "X-Algolia-API-Key: ${API_KEY}" \
-H "X-Algolia-Application-Id: ${APPLICATION_ID}" \
--data-binary '{ "params": "query=Paris" }' \
"https://${APPLICATION_ID}-dsn.algolia.net/1/indexes/${INDEX_NAME}/query"
推荐阅读
- linux - 等待来自父母的信号并再次完成工作和阻塞
- data-structures - 用于计数组合出现的数据结构
- common-lisp - 有没有办法捕捉定义 Common Lisp 包的时刻?
- machine-learning - 如何从智能电表客户的负载曲线中找到峰值数量?
- android - 如何在android中挂钩opengl es以获取draw call的数量?
- latex - 强制 Sphinx 使用 longtable 指令,在长表中正确添加分页符
- javascript - 表单验证检查后不显示模态框
- data-structures - 树中根节点的级别是多少?
- airflow - 如何从环境变量创建气流变量
- react-native - 如何在 react-native 中更新 Tab Navigator 中徽章计数器的状态