From 0f62586398ee7ec55c7169af17a5a9ce1615fa93 Mon Sep 17 00:00:00 2001 From: Noble Paul <noble@apache.org> Date: Fri, 4 Sep 2009 08:36:19 +0000 Subject: [PATCH] SOLR-1198. QueryConverter was missed git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@811281 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/solr/core/SolrConfig.java | 4 ++++ .../solr/handler/component/SpellCheckComponent.java | 8 +------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/java/org/apache/solr/core/SolrConfig.java b/src/java/org/apache/solr/core/SolrConfig.java index 833b69dd85e..8e495d675a8 100644 --- a/src/java/org/apache/solr/core/SolrConfig.java +++ b/src/java/org/apache/solr/core/SolrConfig.java @@ -207,6 +207,7 @@ public class SolrConfig extends Config { valueSourceParserInfo = loadPluginInfo("valueSourceParser",true); queryParserInfo = loadPluginInfo("queryParser",true); searchComponentInfo = loadPluginInfo("searchComponent",true); + queryConverterInfo = loadPluginInfo("queryConverter",true); directoryfactoryInfo = loadSinglePlugin("directoryFactory"); deletionPolicyInfo = loadSinglePlugin("mainIndex/deletionPolicy"); indexReaderFactoryInfo = loadSinglePlugin("indexReaderFactory"); @@ -303,6 +304,7 @@ public class SolrConfig extends Config { protected PluginInfo deletionPolicyInfo; protected PluginInfo indexReaderFactoryInfo; protected List<PluginInfo> newSearcherListenerInfo; + private List<PluginInfo> queryConverterInfo; protected PluginInfo directoryfactoryInfo; protected Map<String ,List<PluginInfo>> updateProcessorChainInfo ; protected UpdateHandlerInfo updateHandlerInfo ; @@ -484,6 +486,8 @@ public class SolrConfig extends Config { public Map<String, List<PluginInfo>> getUpdateProcessorChainInfo() { return updateProcessorChainInfo; } + public List<PluginInfo> getQueryConverterInfo() { return queryConverterInfo; } + public UpdateHandlerInfo getUpdateHandlerInfo() { return updateHandlerInfo; } public PluginInfo getIndexReaderFactoryInfo() { return indexReaderFactoryInfo; } diff --git a/src/java/org/apache/solr/handler/component/SpellCheckComponent.java b/src/java/org/apache/solr/handler/component/SpellCheckComponent.java index 8a03a1b78f0..6e732cf330e 100644 --- a/src/java/org/apache/solr/handler/component/SpellCheckComponent.java +++ b/src/java/org/apache/solr/handler/component/SpellCheckComponent.java @@ -293,15 +293,9 @@ public class SpellCheckComponent extends SearchComponent implements SolrCoreAwar } } } - String xpath = "queryConverter"; - SolrConfig solrConfig = core.getSolrConfig(); - NodeList nodes = (NodeList) solrConfig.evaluate(xpath, XPathConstants.NODESET); Map<String, QueryConverter> queryConverters = new HashMap<String, QueryConverter>(); - NamedListPluginLoader<QueryConverter> loader = - new NamedListPluginLoader<QueryConverter>("[solrconfig.xml] " + xpath, queryConverters); - - loader.load(solrConfig.getResourceLoader(), nodes); + core.initPlugins(core.getSolrConfig().getQueryConverterInfo(), queryConverters,QueryConverter.class); //ensure that there is at least one query converter defined if (queryConverters.size() == 0) {