public void dump() throws XMLStreamException, FactoryConfigurationError,
CorruptIndexException, IOException {
XMLStreamWriter out = XMLOutputFactory.newInstance().createXMLStreamWriter(System.out);
IndexReader reader = IndexReader.open(FSDirectory.open(new File(dir)), true);
TermEnum terms = reader.terms();
while (terms.next()) { // && (terms.docFreq() > 2)) {
if (terms.docFreq() > 1000) {
System.out.print( terms.term().text());
System.out.print(" -- ");