From 56c2994f660576397548e6981a1ade3e8e8be4ef Mon Sep 17 00:00:00 2001 From: Steven Rowe Date: Thu, 31 Mar 2011 20:16:10 +0000 Subject: [PATCH] Added a special case for looking up KeywordAnalyzer, which alone among analyzers occupies package o.a.l.analysis.core. git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1087431 13f79535-47bb-0310-9956-ffa450edef68 --- .../benchmark/byTask/tasks/NewAnalyzerTask.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/NewAnalyzerTask.java b/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/NewAnalyzerTask.java index 6d301142229..7084125fa98 100644 --- a/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/NewAnalyzerTask.java +++ b/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/NewAnalyzerTask.java @@ -54,17 +54,16 @@ public class NewAnalyzerTask extends PerfTask { public int doLogic() throws IOException { String className = null; try { - if (current >= analyzerClassNames.size()) - { + if (current >= analyzerClassNames.size()) { current = 0; } className = analyzerClassNames.get(current++); - if (className == null || className.equals("")) - { - className = "org.apache.lucene.analysis.standard.StandardAnalyzer"; - } - if (className.indexOf(".") == -1 || className.startsWith("standard."))//there is no package name, assume o.a.l.analysis - { + if (className == null || className.equals("")) { + className = "org.apache.lucene.analysis.standard.StandardAnalyzer"; + } else if (className.equals("KeywordAnalyzer")) { + className = "org.apache.lucene.analysis.core.KeywordAnalyzer"; + } else if (className.indexOf(".") == -1 || className.startsWith("standard.")) { + //there is no package name, assume o.a.l.analysis className = "org.apache.lucene.analysis." + className; } getRunData().setAnalyzer(createAnalyzer(className));