Platinum Partner
architects,bigdata,tool,tools & methods,big data

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>

Published at DZone with permission of {{ articles[0].authors[0].realName }}, DZone MVB. (source)

Opinions expressed by DZone contributors are their own.

{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}