public void add(SurfaceForm surfaceForm, DBpediaResource resource, int nTimes) throws IndexException {
Document newDoc = mLucene.createDocument(surfaceForm, resource, nTimes);
try {
mWriter.addDocument(newDoc); //TODO ATTENTION need to merge with existing doc if URI is already in index
} catch (IOException e) {
throw new IndexException("Error adding candidate map to the index. ", e);
}
LOG.trace("Added to " + mLucene.directory().toString() + ": " + surfaceForm.toString() + " -> " + resource.toString());
}