@Override public void doInitialize(UimaContext aContext) throws ResourceInitializationException {
  DB db=mongoResource.getDB();
  entitiesCollection=db.getCollection(entitiesCollectionName);
  relationsCollection=db.getCollection(relationsCollectionName);
  documentsCollection=db.getCollection(documentsCollectionName);
  documentsCollection.createIndex(new BasicDBObject(fields.getExternalId(),1));
  entitiesCollection.createIndex(new BasicDBObject(fields.getExternalId(),1));
  relationsCollection.createIndex(new BasicDBObject(fields.getExternalId(),1));
  relationsCollection.createIndex(new BasicDBObject(FIELD_DOCUMENT_ID,1));
  entitiesCollection.createIndex(new BasicDBObject(FIELD_DOCUMENT_ID,1));
  stopFeatures=new HashSet<>();
  stopFeatures.add("uima.cas.AnnotationBase:sofa");
  stopFeatures.add("uk.gov.dstl.baleen.types.BaleenAnnotation:internalId");
}

@ Override public void doInitialize ( UimaContext aContext ) throws ResourceInitializationException { DB db = mongoResource . getDB ( ) ; entitiesCollection = db . getCollection ( entitiesCollectionName ) ; relationsCollection = db . getCollection ( relationsCollectionName ) ; documentsCollection = db . getCollection ( documentsCollectionName ) ; documentsCollection . createIndex ( new BasicDBObject ( fields . getExternalId ( ) , 1 ) ) ; entitiesCollection . createIndex ( new BasicDBObject ( fields . getExternalId ( ) , 1 ) ) ; relationsCollection . createIndex ( new BasicDBObject ( fields . getExternalId ( ) , 1 ) ) ; relationsCollection . createIndex ( new BasicDBObject ( FIELD_DOCUMENT_ID , 1 ) ) ; entitiesCollection . createIndex ( new BasicDBObject ( FIELD_DOCUMENT_ID , 1 ) ) ; stopFeatures = new HashSet < > ( ) ; stopFeatures . add ( "uima.cas.AnnotationBase:sofa" ) ; stopFeatures . add ( "uk.gov.dstl.baleen.types.BaleenAnnotation:internalId" ) ; }
get the mongo db , collection and create some indexes
