【发布时间】:2009-06-10 01:47:46
【问题描述】:
我有类似的现有代码:
final Term t = /* ... */;
final Iterator i = searcher.search( new TermQuery( t ) ).iterator();
while ( i.hasNext() ) {
Hit hit = (Hit)i.next();
// "FILE" is the field that recorded the original file indexed
File f = new File( hit.get( "FILE" ) );
// ...
}
我不清楚如何使用TopDocs/TopDocCollector 重写代码以及如何迭代所有结果。
【问题讨论】: