From 316ce42d99aa32a8545bd1852846a9ba8deca99e Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Sat, 15 Aug 2009 10:01:50 +0000 Subject: [PATCH] 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 --- contrib/benchmark/conf/highlight-vs-vector-highlight.alg | 5 ++++- .../lucene/benchmark/byTask/feeds/EnwikiQueryMaker.java | 3 ++- .../benchmark/byTask/tasks/SearchTravRetHighlightTask.java | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/contrib/benchmark/conf/highlight-vs-vector-highlight.alg b/contrib/benchmark/conf/highlight-vs-vector-highlight.alg index 7de171bb2d5..a98e3217760 100644 --- a/contrib/benchmark/conf/highlight-vs-vector-highlight.alg +++ b/contrib/benchmark/conf/highlight-vs-vector-highlight.alg @@ -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 diff --git a/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiQueryMaker.java b/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiQueryMaker.java index d199431b673..a66a47af789 100644 --- a/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiQueryMaker.java +++ b/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiQueryMaker.java @@ -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); } diff --git a/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetHighlightTask.java b/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetHighlightTask.java index 89eed3f4116..b31e63ee543 100644 --- a/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetHighlightTask.java +++ b/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/SearchTravRetHighlightTask.java @@ -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 {