Gary Sieling

Solr DataImportHandler example with FileDataSource

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>

Exit mobile version