~slub.team/goobi-indexserver/3.x

« back to all changes in this revision

Viewing changes to solr/webapp/web/admin/_info.jsp

  • Committer: Sebastian Meyer
  • Date: 2012-08-03 09:12:40 UTC
  • Revision ID: sebastian.meyer@slub-dresden.de-20120803091240-x6861b0vabq1xror
Remove Lucene and Solr source code and add patches instead
Fix Bug #985487: Auto-suggestion for the search interface

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<%--
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
8
 
 
9
 
     http://www.apache.org/licenses/LICENSE-2.0
10
 
 
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.
16
 
--%>
17
 
<%@ page import="org.apache.solr.core.SolrConfig,
18
 
                 org.apache.solr.core.SolrCore,
19
 
                 org.apache.solr.schema.IndexSchema,
20
 
                 java.io.File"%>
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" %>
28
 
 
29
 
<%!
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";
34
 
  static {
35
 
    try {
36
 
      addr = InetAddress.getLocalHost();
37
 
      hostname = addr.getCanonicalHostName();
38
 
    } catch (UnknownHostException e) {
39
 
      //default to unknown
40
 
    }
41
 
  }
42
 
%>
43
 
 
44
 
<%
45
 
  // 
46
 
  SolrCore  core = (SolrCore) request.getAttribute("org.apache.solr.SolrCore");
47
 
  if (core == null) {
48
 
    response.sendError( 404, "missing core name in path" );
49
 
    return;
50
 
  }
51
 
    
52
 
  SolrConfig solrConfig = core.getSolrConfig();
53
 
  int port = request.getServerPort();
54
 
  IndexSchema schema = core.getSchema();
55
 
 
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();
64
 
  }
65
 
 
66
 
  String collectionName = schema!=null ? schema.getName():"unknown";
67
 
 
68
 
  String defaultSearch = "";
69
 
  { 
70
 
    StringWriter tmp = new StringWriter();
71
 
    XML.escapeCharData
72
 
      (solrConfig.get("admin/defaultQuery/text()", ""), tmp);
73
 
    defaultSearch = tmp.toString();
74
 
  }
75
 
 
76
 
  String solrImplVersion = "";
77
 
  String solrSpecVersion = "";
78
 
  String luceneImplVersion = "";
79
 
  String luceneSpecVersion = "";
80
 
 
81
 
  { 
82
 
    Package p;
83
 
    StringWriter tmp;
84
 
 
85
 
    p = SolrCore.class.getPackage();
86
 
 
87
 
    tmp = new StringWriter();
88
 
    solrImplVersion = p.getImplementationVersion();
89
 
    if (null != solrImplVersion) {
90
 
      XML.escapeCharData(solrImplVersion, tmp);
91
 
      solrImplVersion = tmp.toString();
92
 
    }
93
 
    tmp = new StringWriter();
94
 
    solrSpecVersion = p.getSpecificationVersion() ;
95
 
    if (null != solrSpecVersion) {
96
 
      XML.escapeCharData(solrSpecVersion, tmp);
97
 
      solrSpecVersion = tmp.toString();
98
 
    }
99
 
  
100
 
    p = LucenePackage.class.getPackage();
101
 
 
102
 
    tmp = new StringWriter();
103
 
    luceneImplVersion = p.getImplementationVersion();
104
 
    if (null != luceneImplVersion) {
105
 
      XML.escapeCharData(luceneImplVersion, tmp);
106
 
      luceneImplVersion = tmp.toString();
107
 
    }
108
 
    tmp = new StringWriter();
109
 
    luceneSpecVersion = p.getSpecificationVersion() ;
110
 
    if (null != luceneSpecVersion) {
111
 
      XML.escapeCharData(luceneSpecVersion, tmp);
112
 
      luceneSpecVersion = tmp.toString();
113
 
    }
114
 
  }
115
 
  
116
 
  String cwd=System.getProperty("user.dir");
117
 
  String solrHome= solrConfig.getInstanceDir();
118
 
  
119
 
  boolean cachingEnabled = !solrConfig.getHttpCachingConfig().isNever304(); 
120
 
%>