LUCENE-1809: make highlihter vs vector highlighter comparison more fair

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@804447 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2009-08-15 10:01:50 +00:00
parent b16e0aa31b
commit 316ce42d99
3 changed files with 9 additions and 2 deletions

View File

@ -35,7 +35,10 @@ content.source=org.apache.lucene.benchmark.byTask.feeds.EnwikiContentSource
docs.file=temp/enwiki-20070527-pages-articles.xml
query.maker=org.apache.lucene.benchmark.byTask.feeds.EnwikiQueryMaker
#query.maker=org.apache.lucene.benchmark.byTask.feeds.ReutersQueryMaker
enwikiQueryMaker.disableSpanQueries=true
max.field.length=2147483647
highlighter.maxDocCharsToAnalyze=2147483647
# task at this depth or less would print when they start
task.max.depth.log=2

View File

@ -127,7 +127,8 @@ public class EnwikiQueryMaker extends AbstractQueryMaker implements
List queryList = new ArrayList(20);
queryList.addAll(Arrays.asList(STANDARD_QUERIES));
queryList.addAll(Arrays.asList(getPrebuiltQueries(DocMaker.BODY_FIELD)));
if(!config.get("enwikiQueryMaker.disableSpanQueries", false))
queryList.addAll(Arrays.asList(getPrebuiltQueries(DocMaker.BODY_FIELD)));
return createQueries(queryList, anlzr);
}

View File

@ -67,6 +67,7 @@ public class SearchTravRetHighlightTask extends SearchTravTask {
protected int maxFrags = 2;
protected Set paramFields = Collections.EMPTY_SET;
protected Highlighter highlighter;
protected int maxDocCharsToAnalyze;
public SearchTravRetHighlightTask(PerfRunData runData) {
super(runData);
@ -79,6 +80,7 @@ public class SearchTravRetHighlightTask extends SearchTravTask {
if (data.getConfig().get("doc.stored", false) == false){
throw new Exception("doc.stored must be set to true");
}
maxDocCharsToAnalyze = data.getConfig().get("highlighter.maxDocCharsToAnalyze", Highlighter.DEFAULT_MAX_CHARS_TO_ANALYZE);
}
public boolean withRetrieve() {
@ -91,6 +93,7 @@ public class SearchTravRetHighlightTask extends SearchTravTask {
protected BenchmarkHighlighter getBenchmarkHighlighter(Query q){
highlighter = new Highlighter(new SimpleHTMLFormatter(), new QueryScorer(q));
highlighter.setMaxDocCharsToAnalyze(maxDocCharsToAnalyze);
return new BenchmarkHighlighter(){
public int doHighlight(IndexReader reader, int doc, String field,
Document document, Analyzer analyzer, String text) throws Exception {