<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%> <%-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --%> <%@ page import="org.apache.solr.common.util.NamedList, org.apache.solr.common.util.SimpleOrderedMap, org.apache.solr.request.LocalSolrQueryRequest, org.apache.solr.request.SolrQueryResponse, org.apache.solr.request.SolrRequestHandler"%> <%@ page import="org.apache.solr.handler.ReplicationHandler" %> <% request.setCharacterEncoding("UTF-8"); %> <%@include file="../_info.jsp" %> Solr replication admin page <%! public NamedList executeCommand(String command, SolrCore core, SolrRequestHandler rh){ NamedList namedlist = new SimpleOrderedMap(); namedlist.add("command", command); LocalSolrQueryRequest solrqreq = new LocalSolrQueryRequest(core, namedlist); SolrQueryResponse rsp = new SolrQueryResponse(); core.execute(rh, solrqreq, rsp); namedlist = rsp.getValues(); return namedlist; } %> <% final SolrRequestHandler rh = core.getRequestHandler(ReplicationHandler.class); if(rh == null){ response.sendError( 404, "No ReplicationHandler registered" ); return; } NamedList namedlist = executeCommand("details",core,rh); NamedList detailsMap = (NamedList)namedlist.get("details"); if(detailsMap != null) if("true".equals((String)detailsMap.get("isSlave"))){ %> <%}%> Solr

Solr replication (<%= collectionName %>) <% if(detailsMap != null){ if( "true".equals(detailsMap.get("isMaster")) && "true".equals(detailsMap.get("isSlave"))) out.println(" Master & Slave"); else if("true".equals(detailsMap.get("isMaster"))) out.println(" Master"); else if("true".equals(detailsMap.get("isSlave"))) out.println(" Slave"); } %>

<%= hostname %>:<%= port %>
cwd=<%= cwd %> SolrHome=<%= solrHome %>