return IndexReader.open(directory);
}
private IndexReader getReaderWithDocsHavingFamily() throws CorruptIndexException, LockObtainFailedException, IOException {
RAMDirectory directory = new RAMDirectory();
IndexWriterConfig conf = new IndexWriterConfig(LUCENE_VERSION, new KeywordAnalyzer());
IndexWriter writer = new IndexWriter(directory, conf);
Document doc = new Document();
doc.add(new Field("a", "b", Store.YES, Index.NOT_ANALYZED_NO_NORMS));
doc.add(new Field("family", "f2", Store.YES, Index.NOT_ANALYZED_NO_NORMS));