writer.close();
IndexReader reader = IndexReader.open(ramDir);
String queryString = QUERY;
QueryParser parser=new QueryParser(FIELD_NAME, /*new StandardAnalyzer()/*/XFactory.getWriterAnalyzer());
Query query = parser.parse(queryString);
System.out.println(query);
Searcher searcher = new IndexSearcher(ramDir);
query = query.rewrite(reader);
System.out.println(query);
System.out.println("Searching for: " + query.toString(FIELD_NAME));
Hits hits = searcher.search(query);
BoldFormatter formatter = new BoldFormatter();
Highlighter highlighter =new Highlighter(formatter,new QueryScorer(query));
highlighter.setTextFragmenter(new SimpleFragmenter(50));