同时从两个索引库中读取索引

IndexReader reader1 = IndexReader.open("directory1");

 

IndexReader reader2 = IndexReader.open("directory2");

 

MultiReader multiReader = new MultiReader(new IndexReader[]{reader1 , reader2});

 

IndexSearcher searcher = new IndexSearcher(multiReader);

 

后面的就不用说了

你可能感兴趣的:(索引)