Solr CSV DataImportHandler sample

The following will import a two field CSV file into solr, assuming two columns, name and count. The name field is always quoted.

<dataConfig>
<dataSource name=”ds1″ type=”FileDataSource” />
<document>
<entity name=”ngrams”
processor=”LineEntityProcessor”
url=”E:/Projects/Data/words-txt.csv”
dataSource=”ds1″
transformer=”RegexTransformer”>
<field column=”rawLine”
regex=”^&quot;(.*)&quot;\t(.*)$”
groupNames=”name,count”
/>
</entity>
</document>
</dataConfig>

Tags: , ,

0 comments ↓

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment

Current ye@r *