contentSource.setConfig(new Config(properties));
contentSource.resetInputs();
// docMaker.openFile();
List<SolrInputDocument> docs = new ArrayList<SolrInputDocument>(1000);
int i = 0;
SolrInputDocument sDoc = null;
long start = System.currentTimeMillis();
try {
DocData docData = new DocData();
while ((docData = contentSource.getNextDocData(docData)) != null
&& i < numDocs) {
int mod = i % batchSize;
sDoc = new SolrInputDocument();
docs.add(sDoc);
sDoc.addField("file", filePath + "_" + i);
sDoc.addField("docid", String.valueOf(docData.getID()));
sDoc.addField("body", docData.getBody());
sDoc.addField("doctitle", docData.getTitle());
sDoc.addField("name_s", docData.getName());
String[] categories = docData.getProps().getProperty("category")
.split(";;");
for (String c : categories) {
sDoc.addField("category", c);
}
if (mod == batchSize - 1) {
log.info("Sending: " + docs.size() + " docs"
+ " total sent for this file: " + i);