[英]Solr update with Rest API Json data
I'm using solr 6.5.1. 我正在使用solr 6.5.1。 I have json data in Rest url;
我在Rest网址中有json数据;
For example: 例如:
POST : http://localhost:8484/api/cloud/list-users
is_user: xxx
is_key : pqxqxaweqweqx14123
I can able to fetch data via postman rest client. 我可以通过邮递员休息客户端获取数据。 Is there anyway to post data to solr collection via above rest post url?
无论如何,是否有通过上述剩余发布网址将数据发布到Solr集合的信息? Please tell me how do i implement this feature in solr.
请告诉我如何在solr中实现此功能。
Try this: 尝试这个:
POST /api/cloud/list-users/update/json/docs?commit=true HTTP/1.1 Host: localhost:8484 Content-Type: application/json { "is_user": "xxx", "is_key": "pqxqxaweqweqx14123" }
And if you want to import it into Postman, here's a json (save it to a .json and then import it as a collection into Postman) 如果要将其导入Postman,请使用json(将其保存为.json,然后将其作为集合导入Postman)。
{
"variables": [],
"info": {
"name": "Solr Post New Document",
"_postman_id": "291f6b0e-6aad-7778-c29d-f194ce45c5de",
"description": "",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
"name": "Solr Post New Document",
"request": {
"url": "http://localhost:8983/solr/test/update/json/docs?commit=true",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": ""
}
],
"body": {
"mode": "raw",
"raw": "{\n\"is_user\": \"xxx\",\n\"is_key\": \"pqxqxaweqweqx14123\"\n}\n"
},
"description": ""
},
"response": []
}
]}
For more details, see the solr documentation: 有关更多详细信息,请参见solr文档:
https://cwiki.apache.org/confluence/display/solr/Uploading+Data+with+Index+Handlers#UploadingDatawithIndexHandlers-JSONFormattedIndexUpdates https://cwiki.apache.org/confluence/display/solr/Uploading+Data+with+Index+Handlers#UploadingDatawithIndexHandlers-JSONFormattedIndexUpdates
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.