简体   繁体   中英

Why tab seperated file is giving error in solr during being inserted

When below command is run in solr 4.7.2

C:\dev\tools\solr-4.7.2\apache-tomcat-6.0.37\bin>curl "http://localhost:8080/solr-4.7.2/update/csv?commit=true&rowid=id&fieldnames=interfaceseq,extractnumber&separator=%09&stream.file=C:\
opt\invoices\input\5924usage_data1.dat&stream.contentType=text/csv&header=false&trim=true"

I get below error which i can not understand the reason.

<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">400</int><int name="QTime">1</int></lst><lst name="error"><str name="msg">ERROR: [doc=0] unknown field 'interfaceseq'</str><int name="code">400</int></lst>
</response>

The file content is as below

10000000001 5923

unknown field 'interfaceseq'

The field 'interfaceseq' needs to be defined in Solr's schema. If you don't want to modify the schema, you could use dynamic fields (where the name of the field, normally the suffix, implicitly defines the field type).

For example, if this is an integer, name the field interfaceseq_i (since all fields ending with _i will be treated as integer fields).

if it's a string, name it interfaceseq_s

if it's a double, name it interfaceseq_d

and so on...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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