@BeforeClass
public static void cleanDatabaseAndInit() throws Exception {
MongoClient mongo = TestHelper.getMongo();
mongo.dropDatabase(TestHelper.TEST_DATABASE_NAME);
directory = new DistributedDirectory(new MongoDirectory(mongo, TestHelper.TEST_DATABASE_NAME, STORAGE_TEST_INDEX, false));
StandardAnalyzer analyzer = new StandardAnalyzer();
IndexWriterConfig config = new IndexWriterConfig(analyzer);
IndexWriter w = new IndexWriter(directory, config);
addDoc(w, "Random perl Title that is long", "id-1");
addDoc(w, "Random java Title that is long", "id-1");
addDoc(w, "MongoDB is awesome", "id-2");
addDoc(w, "This is a long title with nothing interesting", "id-3");
addDoc(w, "Java is awesome", "id-4");
addDoc(w, "Really big fish", "id-5");
w.commit();
w.close();
}