我正在尝试将CVS文件数据导入远程solr。
我的命令是:
curl "http://mydomain.io/solr/#/qacheck/update?commit=true" --data-binary "d:maincat.csv" -H "Content-type:application/csv"
我得到这样的输出:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 405 HTTP method POST is not supported by this URL</title>
</head>
<body><h2>HTTP ERROR 405</h2>
<p>Problem accessing /solr/index.html. Reason:
<pre> HTTP method POST is not supported by this URL</pre></p>
</body>
</html>
我尝试过这样的尝试:
curl "http://proxy.sip.solr.qacheck1.test9.mcc.gb-lon1.metroscales.io/solr/qacheck/update?commit=true" --data-binary "d:maincat.csv" -H "Content-type:application/csv"
现在我得到了这个回应。我验证了,没有导入数据。
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">0</int><int name="QTime">3</int></
lst>
</response>
#
在URL中指示本地锚。该值永远不会暴露于服务器,并且仅在浏览器内部用于链接到页面的特定部分 - 或在许多现代Web应用程序中,以保持有关当前JavaScript上下文的某些局部状态。在上面的第一个URL中,您已包含URL的浏览器部分,而不是将实际URL用于更新处理程序。
在第二次尝试中,您不包括文件,只是逐字文本d:maincat.csv
。如果要卷曲读取文件并提交其内容(而不是提交逐字记录(,则必须将值以@
前缀为前缀。因此--data-binary "@d:maincat.csv"
应该做您想做的。