}
public int index(File wikipediaXML, int numDocs, int batchSize) throws Exception {
int result = 0;
if (wikipediaXML != null && wikipediaXML.exists()) {
EnwikiContentSource contentSource = new EnwikiContentSource();
Properties properties = new Properties();
//fileName = config.get("docs.file", null);
String filePath = wikipediaXML.getAbsolutePath();
properties.setProperty("docs.file", filePath);
properties.setProperty("doc.maker.forever", "false");
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);