RAMDirectory directory = new RAMDirectory();
IndexWriter writer = new IndexWriter(directory, new WhitespaceAnalyzer(),
true, IndexWriter.MaxFieldLength.LIMITED);
addDoc("12345678911", writer);
addDoc("segment", writer);
writer.optimize();
writer.close();
IndexSearcher searcher = new IndexSearcher(directory);
Query query;
// term not over 10 chars, so optimization shortcuts