2017-05-25 104 views
0

我已经在RHEL 7中安装了solr 6.4。我创建了一个名为PLI的核心。我想用命令导入和索引csv文件:Solr索引显示错误

curl 'http://localhost:8983/solr/PLI/update?commit=true' --data-binary @tbl_PLI_stripped.csv -H 'Content-type:application/csv' 

不过是显示以下错误:

 <?xml version="1.0" encoding="UTF-8"?> 
<response> 
<lst name="responseHeader"><int name="status">400</int><int name="QTime">55</int></lst><lst name="error"><lst name="metadata"><str name="error-class">org.apache.solr.common.SolrException</str><str name="root-error-class">java.lang.NumberFormatException</str></lst><str name="msg">ERROR: [doc=02c020ee-fccc-455e-a687-278bfbc1c839] Error adding field 'StreetNo'='13/50' msg=For input string: "13/50"</str><int name="code">400</int></lst> 
</response> 

我已经在csv文件“StreetNo”申请。 我已经加入我的架构中manged-schmea这就好比:

<field name="LotPlan" type="text_general" indexed="true" stored="true"/> 
<field name="Address" type="string" indexed="true" stored="true"/> 
<field name="StreetSuburb" type="text_general" indexed="true" stored="true"/> 
<field name="StreetNo" type="string" indexed="true" stored="true"/> 
<field name="House_No" type="text_general" indexed="false" stored="false"/> 

我不能够解决这个问题。 Windows中相同版本的Solr中的相同csv文件,我可以导入和编制索引。

回答

0

你的StreetNo没有拾取“字符串”类型。如果您想自己设置字段类型,则必须从托管模式转移到经典模式。

this doc,其中是'从托管架构切换到手动编辑schema.xml',然后您应该能够使用您的自定义字段。

0

什么是档案格式?你有没有尝试在vi中打开文件并使用:set ff = unix并保存?

您可以在solr管理界面 - >日志记录的solr日志中找到更多详细信息。