本文整理汇总了Java中org.apache.lucene.benchmark.quality.utils.SubmissionReport.flush方法的典型用法代码示例。如果您正苦于以下问题:Java SubmissionReport.flush方法的具体用法?Java SubmissionReport.flush怎么用?Java SubmissionReport.flush使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.lucene.benchmark.quality.utils.SubmissionReport
的用法示例。
在下文中一共展示了SubmissionReport.flush方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.apache.lucene.benchmark.quality.utils.SubmissionReport; //导入方法依赖的package包/类
/**
* Run the quality benchmark.
* @param judge the judge that can tell if a certain result doc is relevant for a certain quality query.
* If null, no judgements would be made. Usually null for a submission run.
* @param submitRep submission report is created if non null.
* @param qualityLog If not null, quality run data would be printed for each query.
* @return QualityStats of each quality query that was executed.
* @throws Exception if quality benchmark failed to run.
*/
public QualityStats [] execute(Judge judge, SubmissionReport submitRep,
PrintWriter qualityLog) throws Exception {
int nQueries = Math.min(maxQueries, qualityQueries.length);
QualityStats stats[] = new QualityStats[nQueries];
for (int i=0; i<nQueries; i++) {
QualityQuery qq = qualityQueries[i];
// generate query
Query q = qqParser.parse(qq);
// search with this query
long t1 = System.currentTimeMillis();
TopDocs td = searcher.search(q,null,maxResults);
long searchTime = System.currentTimeMillis()-t1;
//most likely we either submit or judge, but check both
if (judge!=null) {
stats[i] = analyzeQueryResults(qq, q, td, judge, qualityLog, searchTime);
}
if (submitRep!=null) {
submitRep.report(qq,td,docNameField,searcher);
}
}
if (submitRep!=null) {
submitRep.flush();
}
return stats;
}