I am trying to index a TSV file in Solr and weirdness with the TSV files I have is, they miss some fields in some lines randomly.
Sample data in my TSV
0 abc 1 The quick brown fox jumps over the lazy dog
0 abc 1 2 The quick brown fox jumps over the lazy dog
0 abc 1 2 The quick brown fox jumps over the lazy dog
0 abc 1 2 3 The quick brown fox jumps over the lazy dog
headers will be something like this
id name num_1 num_2 num_3 description
in line 1 - num_2 and num_3 are not present
in line 2 - num_3 is not present
in line 3 - all are present
How can I handle this file to index in Solr ? Can something like this be handled seamlessly with Solr or do I need to pre process the TSV and handle the missing fields for Solr to index them ?
I get below exception when trying to load this file to solr
<response>
<lst name="responseHeader"><int name="status">400</int><int name="QTime">145</int></lst><lst name="error"><str name="msg">CSVLoader: input=null, line=23,expected 8 values but got 6</str><int name="code">400</int></lst>
</response>
Update: @Fuu Thanks for response.
Another way to put the question: Does Solr provide any capabilities to understand the fields when indexing ? or edit the field before indexing ?
Say, my sample documents looks like
token:n=1 token:name=abc token:num:a=1 token:num:b=2 token:num:c=3 token:desc=...
Is it possible to edit that row to
1 abc 1 2 3 ....
before actually Solr indexing it ?