简体   繁体   English

使用Postman将数据索引到Solr Core中

[英]Index Data into Solr Core using Postman

I have created a Solr core. 我已经创建了一个Solr核心。 Now i want to insert data into it using Postman. 现在,我想使用Postman将数据插入其中。 Can we do that and how can we insert data to solr core using Postman. 我们可以做到这一点,以及如何使用Postman将数据插入solr核心。 Is there any REST API in Apache SOLR which can be directly called from Postman and insert data to Solr Core. Apache SOLR中是否有任何REST API,可以直接从Postman调用并将其插入到Solr Core中。

This is my JSON data which i want to insert. 这是我要插入的JSON数据。 I am getting this exception 我收到这个例外

Exception writing document id 6 to the index; 将文档ID 6写入索引的异常; possible analysis error: For input string: \\"\\"","code":400}} 可能的分析错误:对于输入字符串:\\“ \\”“,” code“:400}}

 [{
      "id":6,
      "AssetId": 123456,
      "Availability": "Up"
   },
   {
         "id":7,
       "AssetId": 223456,
        "Availability": "Up"
    },
   {
         "id":8,
         "AssetId": 987456,
         "Availability": "Up"
    },
   {
          "id":9,
        "AssetId": 122726,
        "Availability": "Up"

     }]

I want to insert this data to my SOLR Core names as asset. 我想将此数据作为资产插入到我的SOLR Core名称中。 But I am getting exception. 但是我越来越例外了。

As you can see in the docs , you should be able to index that directly: 正如您在docs中看到的那样,您应该能够直接将其编入索引:

curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/my_collection/update' --data-binary '
[
 {
"id" : "978-0641723445",
 "cat" : ["book","hardcover"],
 "name" : "The Lightning Thief",
 "author" : "Rick Riordan",
 "series_t" : "Percy Jackson and the Olympians", 
 "sequence_i" : 1,
 "genre_s" : "fantasy",
 "inStock" : true,
 "price" : 12.50,
 "pages_i" : 384
  },
  {
  ...
  }
]'

If you need to further transform the data, you should look into this 如果您需要进一步的转换数据,你应该看看这个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM