private void index() throws IOException {
System.out.println("Indexing Frankenstein");
InputStream stream = getClass().getClassLoader().getResourceAsStream("frankenstein-gutenberg.txt");
BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
//let's index paragraphs at a time
IndexWriterConfig conf = new IndexWriterConfig(Version.LUCENE_36, new StandardAnalyzer(Version.LUCENE_36));
directory = new RAMDirectory();
IndexWriter iw = new IndexWriter(directory, conf);
String line;
StringBuilder paraBuffer = new StringBuilder(2048);
int lines = 0;