document.add(new SortedDocValuesField(Integer.toString(i), new BytesRef(String.valueOf(fields[i]))));
}
documents.add(document);
}
directory = newDirectory();
IndexWriter w = new IndexWriter(directory, new IndexWriterConfig(new KeywordAnalyzer()));
w.addDocuments(documents);
w.close();
reader = SlowCompositeReaderWrapper.wrap(DirectoryReader.open(directory));
}