solrium 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. data/LICENSE.txt +712 -0
  2. data/README.markdown +51 -0
  3. data/Rakefile +24 -0
  4. data/VERSION.yml +4 -0
  5. data/bin/solr +9 -0
  6. data/lib/jars/jetty/ant-1.6.5.jar +0 -0
  7. data/lib/jars/jetty/commons-codec-1.3.jar +0 -0
  8. data/lib/jars/jetty/commons-fileupload-1.2.jar +0 -0
  9. data/lib/jars/jetty/jetty-7.0.0.pre5.jar +0 -0
  10. data/lib/jars/jetty/jetty-util-7.0.0.pre5.jar +0 -0
  11. data/lib/jars/jetty/jsp-2.1.jar +0 -0
  12. data/lib/jars/jetty/jsp-api-2.1.jar +0 -0
  13. data/lib/jars/jetty/servlet-api-3.0.pre4.jar +0 -0
  14. data/lib/jars/lucene/lucene-analyzers-2.4-dev.jar +0 -0
  15. data/lib/jars/lucene/lucene-core-2.4-dev.jar +0 -0
  16. data/lib/jars/lucene/lucene-highlighter-2.4-dev.jar +0 -0
  17. data/lib/jars/lucene/lucene-memory-2.4-dev.jar +0 -0
  18. data/lib/jars/lucene/lucene-queries-2.4-dev.jar +0 -0
  19. data/lib/jars/lucene/lucene-snowball-2.4-dev.jar +0 -0
  20. data/lib/jars/lucene/lucene-spellchecker-2.4-dev.jar +0 -0
  21. data/lib/jars/solr/apache-solr-common-1.3.0.jar +0 -0
  22. data/lib/jars/solr/apache-solr-core-1.3.0.jar +0 -0
  23. data/lib/jars/solr/commons-io-1.2.jar +0 -0
  24. data/lib/jars/solr/stax-1.2.0-dev.jar +0 -0
  25. data/lib/jars/solr/stax-api-1.0.jar +0 -0
  26. data/lib/jars/solr/stax-utils.jar +0 -0
  27. data/lib/jars/solr/xpp3-1.1.3.4.O.jar +0 -0
  28. data/lib/jetty.rb +83 -0
  29. data/lib/lucene.rb +33 -0
  30. data/lib/queries.rb +60 -0
  31. data/lib/remote.rb +22 -0
  32. data/lib/solr.rb +69 -0
  33. data/lib/solr_ext.rb +81 -0
  34. data/lib/webapp/admin/_info.jsp +110 -0
  35. data/lib/webapp/admin/action.jsp +116 -0
  36. data/lib/webapp/admin/analysis.jsp +456 -0
  37. data/lib/webapp/admin/analysis.xsl +179 -0
  38. data/lib/webapp/admin/distributiondump.jsp +158 -0
  39. data/lib/webapp/admin/favicon.ico +0 -0
  40. data/lib/webapp/admin/form.jsp +129 -0
  41. data/lib/webapp/admin/get-file.jsp +72 -0
  42. data/lib/webapp/admin/get-properties.jsp +24 -0
  43. data/lib/webapp/admin/header.jsp +41 -0
  44. data/lib/webapp/admin/index.jsp +154 -0
  45. data/lib/webapp/admin/jquery-1.2.3.min.js +32 -0
  46. data/lib/webapp/admin/logging.jsp +50 -0
  47. data/lib/webapp/admin/logging.xsl +91 -0
  48. data/lib/webapp/admin/meta.xsl +34 -0
  49. data/lib/webapp/admin/ping.jsp +65 -0
  50. data/lib/webapp/admin/ping.xsl +71 -0
  51. data/lib/webapp/admin/raw-schema.jsp +38 -0
  52. data/lib/webapp/admin/registry.jsp +107 -0
  53. data/lib/webapp/admin/registry.xsl +287 -0
  54. data/lib/webapp/admin/schema.jsp +661 -0
  55. data/lib/webapp/admin/solr-admin.css +206 -0
  56. data/lib/webapp/admin/solr-head.gif +0 -0
  57. data/lib/webapp/admin/solr-head.png +0 -0
  58. data/lib/webapp/admin/solr-lowercase.gif +0 -0
  59. data/lib/webapp/admin/solr-lowercase.png +0 -0
  60. data/lib/webapp/admin/stats.jsp +94 -0
  61. data/lib/webapp/admin/stats.xsl +220 -0
  62. data/lib/webapp/admin/tabular.xsl +141 -0
  63. data/lib/webapp/admin/threaddump.jsp +110 -0
  64. data/lib/webapp/admin/threaddump.xsl +103 -0
  65. data/lib/webapp/favicon.ico +0 -0
  66. data/lib/webapp/index.jsp +42 -0
  67. metadata +120 -0
@@ -0,0 +1,179 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!--
3
+ Licensed to the Apache Software Foundation (ASF) under one or more
4
+ contributor license agreements. See the NOTICE file distributed with
5
+ this work for additional information regarding copyright ownership.
6
+ The ASF licenses this file to You under the Apache License, Version 2.0
7
+ (the "License"); you may not use this file except in compliance with
8
+ the License. You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software
13
+ distributed under the License is distributed on an "AS IS" BASIS,
14
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ See the License for the specific language governing permissions and
16
+ limitations under the License.
17
+ -->
18
+ <!-- $Id$ -->
19
+ <!-- $URL$ -->
20
+
21
+ <xsl:stylesheet
22
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
23
+ version="1.0">
24
+
25
+ <xsl:output
26
+ method="html"
27
+ indent="yes"
28
+ encoding="utf-8"
29
+ media-type="text/html; charset=UTF-8"
30
+ doctype-public="-//W3C//DTD HTML 4.01//EN"
31
+ doctype-system="http://www.w3.org/TR/html4/strict.dtd" />
32
+
33
+ <xsl:template match="/">
34
+ <html>
35
+ <head>
36
+ <link rel="stylesheet" type="text/css" href="solr-admin.css"></link>
37
+ <link rel="icon" href="favicon.ico" type="image/ico"></link>
38
+ <link rel="shortcut icon" href="favicon.ico" type="image/ico"></link>
39
+ <title>SOLR Info</title>
40
+ </head>
41
+ <body>
42
+ <a href="">
43
+ <img border="0" align="right" height="61" width="142" src="solr-head.gif" alt="SOLR"/>
44
+ </a>
45
+ <h1>Solr Admin (<xsl:value-of select="solr/meta/collection" />)</h1>
46
+ <div style="margin-top: 1em;">
47
+ <h2>Field Analysis</h2>
48
+ <xsl:apply-templates/>
49
+ <a href=".">Return to Admin Page</a>
50
+ </div>
51
+ </body>
52
+ </html>
53
+ </xsl:template>
54
+
55
+ <xsl:include href="meta.xsl"/>
56
+
57
+ <xsl:template match="solr/analysis/form">
58
+ <form method="POST" action="analysis.jsp">
59
+ <table>
60
+ <tr>
61
+ <td>
62
+ <strong>Field name</strong>
63
+ </td>
64
+ <td>
65
+ <input class="std" name="name" type="text" value="{field}"/>
66
+ </td>
67
+ </tr>
68
+ <tr>
69
+ <td>
70
+ <strong>Field value (Index)</strong>
71
+ <br/>
72
+ verbose output <input name="verbose" type="checkbox" checked="true"/>
73
+ <br/>
74
+ highlight matches <input name="highlight" type="checkbox" checked="true"/>
75
+ </td>
76
+ <td>
77
+ <textarea class="std" rows="8" cols="70" name="val"><xsl:value-of select="fieldIndexValue" /></textarea>
78
+ </td>
79
+ </tr>
80
+ <tr>
81
+ <td>
82
+ <strong>Field value (Query)</strong>
83
+ <br/>
84
+ verbose output <input name="qverbose" type="checkbox" checked="true"/>
85
+ </td>
86
+ <td>
87
+ <textarea class="std" rows="1" cols="70" name="qval"><xsl:value-of select="fieldQueryValue" /></textarea>
88
+ </td>
89
+ </tr>
90
+ <tr>
91
+ <td>
92
+ </td>
93
+ <td>
94
+ <input class="stdbutton" type="submit" value="analyze"/>
95
+ </td>
96
+ </tr>
97
+ </table>
98
+ </form>
99
+ </xsl:template>
100
+
101
+ <xsl:template match="solr/analysis/results/indexAnalyzer">
102
+ <h4>Index Analyzer</h4>
103
+ <xsl:for-each select="factory">
104
+ <h5 style="margin-left: 1em;"><xsl:apply-templates select="@class"/></h5>
105
+ <xsl:apply-templates/>
106
+ </xsl:for-each>
107
+ </xsl:template>
108
+
109
+ <xsl:template match="solr/analysis/results/indexAnalyzer/factory/args">
110
+ <div style="margin-left: 2em; font-weight: bold;">{
111
+ <xsl:for-each select="arg">
112
+ <xsl:apply-templates select="@name"/>=<xsl:value-of select="."/>,
113
+ </xsl:for-each>
114
+ }</div>
115
+ </xsl:template>
116
+
117
+ <xsl:template match="solr/analysis/results/indexAnalyzer/factory/tokens">
118
+ <div style="margin-left: 2em;">
119
+ <table width="auto" class="analysis" border="1">
120
+ <tr>
121
+ <th>text</th>
122
+ <th>type</th>
123
+ <th>position</th>
124
+ <th>start</th>
125
+ <th>end</th>
126
+ </tr>
127
+ <xsl:for-each select="token">
128
+ <tr>
129
+ <td><xsl:value-of select="."/></td>
130
+ <td><xsl:apply-templates select="@type"/></td>
131
+ <td><xsl:apply-templates select="@pos"/></td>
132
+ <td><xsl:apply-templates select="@start"/></td>
133
+ <td><xsl:apply-templates select="@end"/></td>
134
+ </tr>
135
+ </xsl:for-each>
136
+ </table>
137
+ </div>
138
+ </xsl:template>
139
+
140
+ <xsl:template match="solr/analysis/results/queryAnalyzer">
141
+ <h4>Query Analyzer</h4>
142
+ <xsl:for-each select="factory">
143
+ <h5 style="margin-left: 1em;"><xsl:apply-templates select="@class"/></h5>
144
+ <xsl:apply-templates/>
145
+ </xsl:for-each>
146
+ </xsl:template>
147
+
148
+ <xsl:template match="solr/analysis/results/queryAnalyzer/factory/args">
149
+ <div style="margin-left: 2em; font-weight: bold;">{
150
+ <xsl:for-each select="arg">
151
+ <xsl:apply-templates select="@name"/>=<xsl:value-of select="."/>,
152
+ </xsl:for-each>
153
+ }</div>
154
+ </xsl:template>
155
+
156
+ <xsl:template match="solr/analysis/results/queryAnalyzer/factory/tokens">
157
+ <div style="margin-left: 2em;">
158
+ <table width="auto" class="analysis" border="1">
159
+ <tr>
160
+ <th>text</th>
161
+ <th>type</th>
162
+ <th>position</th>
163
+ <th>start</th>
164
+ <th>end</th>
165
+ </tr>
166
+ <xsl:for-each select="token">
167
+ <tr>
168
+ <td><xsl:value-of select="."/></td>
169
+ <td><xsl:apply-templates select="@type"/></td>
170
+ <td><xsl:apply-templates select="@pos"/></td>
171
+ <td><xsl:apply-templates select="@start"/></td>
172
+ <td><xsl:apply-templates select="@end"/></td>
173
+ </tr>
174
+ </xsl:for-each>
175
+ </table>
176
+ </div>
177
+ </xsl:template>
178
+
179
+ </xsl:stylesheet>
@@ -0,0 +1,158 @@
1
+ <%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
2
+ <%--
3
+ Licensed to the Apache Software Foundation (ASF) under one or more
4
+ contributor license agreements. See the NOTICE file distributed with
5
+ this work for additional information regarding copyright ownership.
6
+ The ASF licenses this file to You under the Apache License, Version 2.0
7
+ (the "License"); you may not use this file except in compliance with
8
+ the License. You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software
13
+ distributed under the License is distributed on an "AS IS" BASIS,
14
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ See the License for the specific language governing permissions and
16
+ limitations under the License.
17
+ --%>
18
+
19
+ <%@ page import="org.apache.solr.core.SolrCore,
20
+ org.apache.solr.schema.IndexSchema,
21
+ java.io.BufferedReader,
22
+ java.io.File,
23
+ java.io.FilenameFilter,
24
+ java.io.FileReader,
25
+ java.net.InetAddress,
26
+ java.net.UnknownHostException,
27
+ java.util.Date"%>
28
+
29
+ <%@include file="header.jsp" %>
30
+
31
+ <%
32
+ File slaveinfo = new File(solrHome + "logs/snappuller.status");
33
+
34
+ StringBuffer buffer = new StringBuffer();
35
+ StringBuffer buffer2 = new StringBuffer();
36
+ String mode = "";
37
+
38
+ if (slaveinfo.canRead()) {
39
+ // Slave instance
40
+ mode = "Slave";
41
+ File slavevers = new File(solrHome + "logs/snapshot.current");
42
+ BufferedReader inforeader = new BufferedReader(new FileReader(slaveinfo));
43
+ BufferedReader versreader = new BufferedReader(new FileReader(slavevers));
44
+ buffer.append("<tr>\n" +
45
+ "<td>\n" +
46
+ "Version:" +
47
+ "</td>\n" +
48
+ "<td>\n")
49
+ .append( versreader.readLine())
50
+ .append( "<td>\n" +
51
+ "</td>\n" +
52
+ "</tr>\n" +
53
+ "<tr>\n" +
54
+ "<td>\n" +
55
+ "Status:" +
56
+ "</td>\n" +
57
+ "<td>\n")
58
+ .append( inforeader.readLine())
59
+ .append( "</td>\n" +
60
+ "</tr>\n");
61
+ } else {
62
+ // Master instance
63
+ mode = "Master";
64
+ File masterdir = new File(solrHome + "logs/clients");
65
+ FilenameFilter sfilter = new FilenameFilter() {
66
+ public boolean accept(File dir, String name) {
67
+ return name.startsWith("snapshot.status");
68
+ }
69
+ };
70
+ FilenameFilter cfilter = new FilenameFilter() {
71
+ public boolean accept(File dir, String name) {
72
+ return name.startsWith("snapshot.current");
73
+ }
74
+ };
75
+ File[] clients = masterdir.listFiles(cfilter);
76
+ if (clients == null) {
77
+ buffer.append("<tr>\n" +
78
+ "<td>\n" +
79
+ "</td>\n" +
80
+ "<td>\n" +
81
+ "No distribution info present" +
82
+ "</td>\n" +
83
+ "</tr>\n");
84
+ } else {
85
+ buffer.append("<h4>Client Snapshot In Use:</h4>\n" +
86
+ "<tr>\n" +
87
+ "<th>\n" +
88
+ "Client" +
89
+ "</th>\n" +
90
+ "<th>\n" +
91
+ "Version" +
92
+ "</th>\n" +
93
+ "</tr>\n");
94
+ int i = 0;
95
+ while (i < clients.length) {
96
+ String fileName=clients[i].toString();
97
+ int p=fileName.indexOf("snapshot.current");
98
+ String clientName=fileName.substring(p+17);
99
+ BufferedReader reader = new BufferedReader(new FileReader(clients[i]));
100
+ buffer.append("<tr>\n" +
101
+ "<td>\n" +
102
+ clientName +
103
+ "</td>\n" +
104
+ "<td>\n")
105
+ .append( reader.readLine())
106
+ .append( "</td>\n" +
107
+ "</tr>\n" +
108
+ "<tr>\n" +
109
+ "</tr>\n");
110
+ i++;
111
+ }
112
+ clients = masterdir.listFiles(sfilter);
113
+ if (clients!=null) {
114
+ buffer.append("</table>\n" +
115
+ "<h4>Client Snapshot Distribution Status:</h4>\n" +
116
+ "<table>\n" +
117
+ "<tr>\n" +
118
+ "<th>\n" +
119
+ "Client" +
120
+ "</th>\n" +
121
+ "<th>\n" +
122
+ "Status" +
123
+ "</th>\n" +
124
+ "</tr>\n");
125
+ i = 0;
126
+ while (i < clients.length) {
127
+ String fileName=clients[i].toString();
128
+ int p=fileName.indexOf("snapshot.status");
129
+ String clientName=fileName.substring(p+16);
130
+ BufferedReader reader = new BufferedReader(new FileReader(clients[i]));
131
+ buffer.append("<tr>\n" +
132
+ "<td>\n" +
133
+ clientName +
134
+ "</td>\n" +
135
+ "<td>\n")
136
+ .append( reader.readLine())
137
+ .append( "</td>\n" +
138
+ "</tr>\n" +
139
+ "<tr>\n" +
140
+ "</tr>\n");
141
+ i++;
142
+ }
143
+ }
144
+ }
145
+ }
146
+ %>
147
+
148
+
149
+ <br clear="all">
150
+ <h2>Distribution Info</h2>
151
+ <h3><%= mode %> Server</h3>
152
+ <table>
153
+ <%= buffer %>
154
+ </table>
155
+ <br><br>
156
+ <a href=".">Return to Admin Page</a>
157
+ </body>
158
+ </html>
Binary file
@@ -0,0 +1,129 @@
1
+ <%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
2
+ <%--
3
+ Licensed to the Apache Software Foundation (ASF) under one or more
4
+ contributor license agreements. See the NOTICE file distributed with
5
+ this work for additional information regarding copyright ownership.
6
+ The ASF licenses this file to You under the Apache License, Version 2.0
7
+ (the "License"); you may not use this file except in compliance with
8
+ the License. You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software
13
+ distributed under the License is distributed on an "AS IS" BASIS,
14
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ See the License for the specific language governing permissions and
16
+ limitations under the License.
17
+ --%>
18
+ <%@include file="header.jsp" %>
19
+
20
+ <br clear="all">
21
+ <form name="queryForm" method="GET" action="../select" accept-charset="UTF-8">
22
+ <!-- these are good defaults to have if people bookmark the resulting
23
+ URLs, but they should not show up in the form since they are very
24
+ output type specific.
25
+ -->
26
+ <input name="indent" type="hidden" value="on">
27
+ <input name="version" type="hidden" value="2.2">
28
+
29
+ <table>
30
+ <tr>
31
+ <td>
32
+ <strong>Solr/Lucene Statement</strong>
33
+ </td>
34
+ <td>
35
+ <textarea rows="5" cols="60" name="q"><%= defaultSearch %></textarea>
36
+ </td>
37
+ </tr>
38
+ <tr>
39
+ <td>
40
+ <strong>Start Row</strong>
41
+ </td>
42
+ <td>
43
+ <input name="start" type="text" value="0">
44
+ </td>
45
+ </tr>
46
+ <tr>
47
+ <td>
48
+ <strong>Maximum Rows Returned</strong>
49
+ </td>
50
+ <td>
51
+ <input name="rows" type="text" value="10">
52
+ </td>
53
+ </tr>
54
+ <tr>
55
+ <td>
56
+ <strong>Fields to Return</strong>
57
+ </td>
58
+ <td>
59
+ <input name="fl" type="text" value="*,score">
60
+ </td>
61
+ </tr>
62
+ <tr>
63
+ <td>
64
+ <strong>Query Type</strong>
65
+ </td>
66
+ <td>
67
+ <input name="qt" type="text" value="standard">
68
+ </td>
69
+ </tr>
70
+ <tr>
71
+ <td>
72
+ <strong>Output Type</strong>
73
+ </td>
74
+ <td>
75
+ <input name="wt" type="text" value="standard">
76
+ </td>
77
+ </tr>
78
+ <tr>
79
+ <td>
80
+ <strong>Debug: enable</strong>
81
+ </td>
82
+ <td>
83
+ <input name="debugQuery" type="checkbox" >
84
+ <em><font size="-1"> Note: you may need to "view source" in your browser to see explain() correctly indented.</font></em>
85
+ </td>
86
+ </tr>
87
+ <tr>
88
+ <td>
89
+ <strong>Debug: explain others</strong>
90
+ </td>
91
+ <td>
92
+ <input name="explainOther" type="text" >
93
+ <em><font size="-1"> Apply original query scoring to matches of this query to see how they compare.</font></em>
94
+ </td>
95
+ </tr>
96
+ <tr>
97
+ <td>
98
+ <strong>Enable Highlighting</strong>
99
+ </td>
100
+ <td>
101
+ <input name="hl" type="checkbox" >
102
+ </td>
103
+ </tr>
104
+ <tr>
105
+ <td>
106
+ <strong>Fields to Highlight</strong>
107
+ </td>
108
+ <td>
109
+ <input name="hl.fl" type="text" >
110
+ </td>
111
+ </tr>
112
+ <tr>
113
+ <td>
114
+ </td>
115
+ <td>
116
+ <input class="stdbutton" type="submit" value="search" onclick="if (queryForm.q.value.length==0) { alert('no empty queries, please'); return false; } else { queryForm.submit(); } ">
117
+ </td>
118
+ </tr>
119
+ </table>
120
+ </form>
121
+ <br clear="all">
122
+ <em>
123
+ This form demonstrates the most common query options available for the
124
+ built in Query Types. Please consult the Solr Wiki for additional
125
+ Query Parameters.
126
+ </em>
127
+
128
+ </body>
129
+ </html>