Error is as follows :
[root@hdqsltest1 garyTestDocs]# curl http://localhost:8983/solr/update/csv? literal.id=book2&commit --data-binary @sample.csv -H 'Content-type:text/plain; charset=utf- 8'
[1] 16541
bash: commit: command not found
响应看起来像这样 -
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 400 missing content stream</title>
</head>
<body><h2>HTTP ERROR 400</h2>
<p>Problem accessing /solr/update/csv. Reason:
<pre> missing content stream</pre></p><hr /><i><small>Powered by Jetty://</small> </i><br/>
<br/>
<br/>
</body>
</html>
sample.csv 输入 -
module,meets,question,response
General Questions,,"Please provide us a detailed company background","We are great"
schema.xml -
<field name="module" type="text" indexed="true" stored="true" />
<field name="meets" type="text" indexed="true" stored="true" />
<field name="question" type="text" indexed="true" stored="true" />
<field name="response" type="text" indexed="true" stored="true" />
solrconfig.xml
<!-- CSV update handler, loaded on demand -->
<requestHandler name="/update/csv" class="solr.CSVRequestHandler" startup="lazy">
<lst name="defaults">
<str name="separator">,</str>
<str name="header">true</str>
<str name="encapsulator">"</str>
</lst>
</requestHandler>
另一个示例.csv
module,meets,question,response
General Questions,,"Please provide us a detailed company background","Yes"
我已启用远程流式传输。我的查询是
curl http://localhost:8983/solr/update/csv?literal.id=book12&commit=true --data-binary @sample.csv -H 'Content-type:text/plain; charset=utf-8'
那我做错了什么。请指导。
solr 版本 = 3.6.2。
索引的全部意义在于能够查询字段?我还想知道是否可以提取 csv 文件以将其文本放置在各个字段中,我知道它将 csv 文件的文本放置在内容字段中。有关更新/提取的任何建议?我在这里问了2个qns。谢谢你。