我有这样的现有代码:finalTermt=/*...*/;finalIteratori=searcher.search(newTermQuery(t)).iterator();while(i.hasNext()){Hithit=(Hit)i.next();//"FILE"isthefieldthatrecordedtheoriginalfileindexedFilef=newFile(hit.get("FILE"));//...}我不清楚如何使用TopDocs/TopDocCollector重写代码以及如何迭代所有结果。 最佳答案