String[] contents = {"a", "b", "c"};
HashSet<Term> termsSet = new HashSet<Term>();
for (int i = 0; i < contents.length; i++) {
initIndex(random, dir1, i+10, i==0, contents[i]);
initIndex(random, dir2, i+5, i==0, contents[i]);
termsSet.add(template.createTerm(contents[i]));
}
IndexSearcher searcher1 = new IndexSearcher(dir1, true);
IndexSearcher searcher2 = new IndexSearcher(dir2, true);
MultiSearcher multiSearcher = getMultiSearcherInstance(new Searcher[]{searcher1, searcher2});
Map<Term,Integer> docFrequencyMap = multiSearcher.createDocFrequencyMap(termsSet);