writer.close();
IndexReader reader = IndexReader.open(directory, true);
Weight weight = new TFIDF();
TermInfo termInfo = new CachedTermInfo(reader, "content", 1, 100);
VectorMapper mapper = new TFDFMapper(reader, weight, termInfo);
LuceneIterable iterable = new LuceneIterable(reader, "id", "content", mapper);
int i = 0;
for (Vector vector : iterable) {
Assert.assertNotNull(vector);
System.out.println("Vector[" + i++ + "]=" + formatVector(vector));