2
Licensed to the Apache Software Foundation (ASF) under one or more
3
contributor license agreements. See the NOTICE file distributed with
4
this work for additional information regarding copyright ownership.
5
The ASF licenses this file to You under the Apache License, Version 2.0
6
(the "License"); you may not use this file except in compliance with
7
the License. You may obtain a copy of the License at
9
http://www.apache.org/licenses/LICENSE-2.0
11
Unless required by applicable law or agreed to in writing, software
12
distributed under the License is distributed on an "AS IS" BASIS,
13
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
See the License for the specific language governing permissions and
15
limitations under the License.
17
<%@ page import="org.apache.solr.core.SolrConfig,
18
org.apache.solr.core.SolrCore,
19
org.apache.solr.schema.IndexSchema,
21
<%@ page import="java.net.InetAddress"%>
22
<%@ page import="java.io.StringWriter"%>
23
<%@ page import="org.apache.solr.core.Config"%>
24
<%@ page import="org.apache.solr.common.util.XML"%>
25
<%@ page import="org.apache.solr.common.SolrException"%>
26
<%@ page import="org.apache.lucene.LucenePackage"%>
27
<%@ page import="java.net.UnknownHostException" %>
30
// only try to figure out the hostname once in a static block so
31
// we don't have a potentially slow DNS lookup on every admin request
32
static InetAddress addr = null;
33
static String hostname = "unknown";
36
addr = InetAddress.getLocalHost();
37
hostname = addr.getCanonicalHostName();
38
} catch (UnknownHostException e) {
46
SolrCore core = (SolrCore) request.getAttribute("org.apache.solr.SolrCore");
48
response.sendError( 404, "missing core name in path" );
52
SolrConfig solrConfig = core.getSolrConfig();
53
int port = request.getServerPort();
54
IndexSchema schema = core.getSchema();
56
// enabled/disabled is purely from the point of a load-balancer
57
// and has no effect on local server function. If there is no healthcheck
58
// configured, don't put any status on the admin pages.
59
String enabledStatus = null;
60
String enabledFile = solrConfig.get("admin/healthcheck/text()",null);
61
boolean isEnabled = false;
62
if (enabledFile!=null) {
63
isEnabled = new File(enabledFile).exists();
66
String collectionName = schema!=null ? schema.getName():"unknown";
68
String defaultSearch = "";
70
StringWriter tmp = new StringWriter();
72
(solrConfig.get("admin/defaultQuery/text()", ""), tmp);
73
defaultSearch = tmp.toString();
76
String solrImplVersion = "";
77
String solrSpecVersion = "";
78
String luceneImplVersion = "";
79
String luceneSpecVersion = "";
85
p = SolrCore.class.getPackage();
87
tmp = new StringWriter();
88
solrImplVersion = p.getImplementationVersion();
89
if (null != solrImplVersion) {
90
XML.escapeCharData(solrImplVersion, tmp);
91
solrImplVersion = tmp.toString();
93
tmp = new StringWriter();
94
solrSpecVersion = p.getSpecificationVersion() ;
95
if (null != solrSpecVersion) {
96
XML.escapeCharData(solrSpecVersion, tmp);
97
solrSpecVersion = tmp.toString();
100
p = LucenePackage.class.getPackage();
102
tmp = new StringWriter();
103
luceneImplVersion = p.getImplementationVersion();
104
if (null != luceneImplVersion) {
105
XML.escapeCharData(luceneImplVersion, tmp);
106
luceneImplVersion = tmp.toString();
108
tmp = new StringWriter();
109
luceneSpecVersion = p.getSpecificationVersion() ;
110
if (null != luceneSpecVersion) {
111
XML.escapeCharData(luceneSpecVersion, tmp);
112
luceneSpecVersion = tmp.toString();
116
String cwd=System.getProperty("user.dir");
117
String solrHome= solrConfig.getInstanceDir();
119
boolean cachingEnabled = !solrConfig.getHttpCachingConfig().isNever304();