Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

war now contains the solr jar, instead of the direct class files ... this also allows us to display the MANIFEST.MF version info on registry.jsp (it can't read from the WAR's manifest for some reason)

Chris M. Hostetterdb54dcf8905d
diff --git a/CHANGES.txt b/CHANGES.txt
index 0d27129d763..b99f40bccd7 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -169,5 +169,6 @@ Other Changes
specific params, and adding an option to pick the output type. (hossman)
12. Added new numeric build property "specversion" to allow clean
MANIFEST.MF files (hossman)
+13. Added Solr/Lucene versions to "Info" page (hossman)
2006/01/17 Solr open sourced, moves to Apache Incubator
diff --git a/build.xml b/build.xml
index e49c06a0f20..5a067d2f746 100644
--- a/build.xml
+++ b/build.xml
@@ -323,16 +323,18 @@
<!-- Creates the Solr WAR file. -->
<target name="dist-war"
description="Creates the demo WAR file."
- depends="compile, make-manifest">
+ depends="compile, make-manifest, dist-jar">
<mkdir dir="${dist}" />
<war destfile="${dist}/${fullnamever}.war"
webxml="${src}/webapp/WEB-INF/web.xml"
filesetmanifest="skip"
manifest="${dest}/META-INF/MANIFEST.MF">
- <classes dir="${dest}" includes="org/apache/**" />
<lib dir="${lib}">
<exclude name="servlet-api*.jar" />
</lib>
+ <lib dir="${dist}">
+ <include name="${fullnamever}.jar" />
+ </lib>
<fileset dir="${src}/webapp/resources" />
<metainf dir="${basedir}" includes="LICENSE.txt,NOTICE.txt"/>
</war>
diff --git a/src/webapp/resources/admin/_info.jsp b/src/webapp/resources/admin/_info.jsp
index 762a0bca4a5..79f4d4639d0 100644
--- a/src/webapp/resources/admin/_info.jsp
+++ b/src/webapp/resources/admin/_info.jsp
@@ -22,6 +22,7 @@
<%@ page import="java.io.StringWriter"%>
<%@ page import="org.apache.solr.core.Config"%>
<%@ page import="org.apache.solr.util.XML"%>
+<%@ page import="org.apache.lucene.LucenePackage"%>
<%
SolrCore core = SolrCore.getSolrCore();
@@ -42,10 +43,45 @@
InetAddress addr = InetAddress.getLocalHost();
String hostname = addr.getCanonicalHostName();
- StringWriter tmp = new StringWriter();
+ StringWriter tmp;
+
+ tmp = new StringWriter();
XML.escapeCharData(SolrConfig.config.get("admin/defaultQuery/text()", null),
tmp);
String defaultSearch = tmp.toString();
+
+ Package p;
+
+ p = SolrCore.class.getPackage();
+
+ tmp = new StringWriter();
+ String solrImplVersion = p.getImplementationVersion();
+ if (null != solrImplVersion) {
+ XML.escapeCharData(solrImplVersion, tmp);
+ solrImplVersion = tmp.toString();
+ }
+ tmp = new StringWriter();
+ String solrSpecVersion = p.getSpecificationVersion() ;
+ if (null != solrSpecVersion) {
+ XML.escapeCharData(solrSpecVersion, tmp);
+ solrSpecVersion = tmp.toString();
+ }
+
+ p = LucenePackage.class.getPackage();
+
+ tmp = new StringWriter();
+ String luceneImplVersion = p.getImplementationVersion();
+ if (null != luceneImplVersion) {
+ XML.escapeCharData(luceneImplVersion, tmp);
+ luceneImplVersion = tmp.toString();
+ }
+ tmp = new StringWriter();
+ String luceneSpecVersion = p.getSpecificationVersion() ;
+ if (null != luceneSpecVersion) {
+ XML.escapeCharData(luceneSpecVersion, tmp);
+ luceneSpecVersion = tmp.toString();
+ }
+
String cwd=System.getProperty("user.dir");
String solrHome= Config.getInstanceDir();
%>
diff --git a/src/webapp/resources/admin/registry.jsp b/src/webapp/resources/admin/registry.jsp
index 2f97ca3af86..e79949459fa 100644
--- a/src/webapp/resources/admin/registry.jsp
+++ b/src/webapp/resources/admin/registry.jsp
@@ -29,6 +29,10 @@
<host><%= hostname %></host>
<now><%= new Date().toString() %></now>
<start><%= new Date(core.getStartTime()) %></start>
+ <solr-spec-version><%= solrSpecVersion %></solr-spec-version>
+ <solr-impl-version><%= solrImplVersion %></solr-impl-version>
+ <lucene-spec-version><%= luceneSpecVersion %></lucene-spec-version>
+ <lucene-impl-version><%= luceneImplVersion %></lucene-impl-version>
<solr-info>
<%
for (SolrInfoMBean.Category cat : SolrInfoMBean.Category.values()) {
diff --git a/src/webapp/resources/admin/registry.xsl b/src/webapp/resources/admin/registry.xsl
index bc0a39a6b5e..53ff775cc3b 100644
--- a/src/webapp/resources/admin/registry.xsl
+++ b/src/webapp/resources/admin/registry.xsl
@@ -67,6 +67,26 @@
[<a href="#other">Other</a>]
</td>
</tr>
+ <tr><td></td>
+ <td>Solr Specification Version:
+ <xsl:value-of select="solr-spec-version" />
+ </td>
+ </tr>
+ <tr><td></td>
+ <td>Solr Implementation Version:
+ <xsl:value-of select="solr-impl-version" />
+ </td>
+ </tr>
+ <tr><td></td>
+ <td>Lucene Specification Version:
+ <xsl:value-of select="lucene-spec-version" />
+ </td>
+ </tr>
+ <tr><td></td>
+ <td>Lucene Implementation Version:
+ <xsl:value-of select="lucene-impl-version" />
+ </td>
+ </tr>
<tr>
<td>
</td>
@@ -85,13 +105,7 @@
<xsl:apply-templates/>
</xsl:template>
- <xsl:template match="solr/schema" />
-
- <xsl:template match="solr/host" />
-
- <xsl:template match="solr/now" />
-
- <xsl:template match="solr/start" />
+ <xsl:template match="solr/*" priority="-1" />
<xsl:template match="solr/solr-info">
<xsl:apply-templates/>