This commit is contained in:
yfujita 2014-01-28 01:26:51 +09:00
parent 0ce981c907
commit f580069578
3 changed files with 27 additions and 3 deletions

View file

@ -18,6 +18,7 @@ package jp.sf.fess.action.admin;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -65,6 +66,9 @@ public class SystemAction implements Serializable {
@Resource
protected SolrGroupManager solrGroupManager;
@Resource
protected SolrGroup suggestSolrGroup;
@Resource
protected WebManagementHelper webManagementHelper;
@ -92,9 +96,24 @@ public class SystemAction implements Serializable {
groupPropMap.put(groupName, props);
}
}
final DynamicProperties suggestProps = ComponentUtil
.getSolrGroupProperties(suggestSolrGroup.getGroupName());
if (suggestProps != null) {
groupPropMap.put(suggestSolrGroup.getGroupName(), suggestProps);
}
final String[] serverNames = solrGroupManager.getSolrServerNames();
for (final String name : serverNames) {
final String[] suggestServerNames = suggestSolrGroup.getServerNames();
for (int i = 0; i < suggestServerNames.length; i++) {
if (StringUtil.isNotBlank(suggestServerNames[i])) {
suggestServerNames[i] = suggestSolrGroup.getGroupName() + ":"
+ suggestServerNames[i];
}
}
final List<String> serverNameList = new ArrayList<String>();
serverNameList.addAll(Arrays.asList(serverNames));
serverNameList.addAll(Arrays.asList(suggestServerNames));
for (final String name : serverNameList) {
final String[] names = name.split(":");
if (names.length == 2) {
final Map<String, String> map = new HashMap<String, String>(4);
@ -172,6 +191,11 @@ public class SystemAction implements Serializable {
groupPropMap.put(groupName, props);
}
}
final DynamicProperties suggestProps = ComponentUtil
.getSolrGroupProperties(suggestSolrGroup.getGroupName());
if (suggestProps != null) {
groupPropMap.put(suggestSolrGroup.getGroupName(), suggestProps);
}
try {
// server status

View file

@ -61,7 +61,7 @@ public class SearchService implements Serializable {
protected SolrGroupManager solrGroupManager;
@Resource
SolrGroup suggestSolrGroup;
protected SolrGroup suggestSolrGroup;
@Resource
protected QueryHelper queryHelper;

View file

@ -51,7 +51,7 @@
<component name="suggestSolrGroup" class="org.codelibs.solr.lib.SolrGroup">
<!-- Note: groupName cannot include ".". -->
<property name="groupName">"suggestSolrServer"</property>
<property name="groupName">"suggestSolrGroup"</property>
<property name="statusPolicy">
<component class="jp.sf.fess.solr.policy.FessStatusPolicy">
<property name="solrGroupProperties">suggestSolrGroupProperties</property>