A Solr CSV DataImportHandler Sample
Join the DZone community and get the full member experience.
Join For FreeThe 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=”^"(.*)"\t(.*)$” groupNames=”name,count” /> </entity> </document> </dataConfig>
CSV
Published at DZone with permission of Gary Sieling, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments