Solr DataImportHandler example with FileDataSource
Join the DZone community and get the full member experience.Join For Free
This imports each line of a text file as a single document, probably about the simplest thing you can do. The schema has a single attribute, “name,” which is defined as a unique attribute.
<dataConfig> <dataSource name=”ds1″ type=”FileDataSource” /> <document> <entity name=”entity” processor=”LineEntityProcessor” url=”E:/Projects/Data/wlist_all/wlist_match10.txt” dataSource=”ds1″> <field column=”rawLine” name=”name” /> </entity> </document> </dataConfig>
Published at DZone with permission of Gary Sieling, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.