rjack-solr 3.6.0.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/History.rdoc +2 -0
  2. data/Manifest.txt +62 -0
  3. data/NOTICE.txt +7 -0
  4. data/README.rdoc +71 -0
  5. data/Rakefile +12 -0
  6. data/assembly.xml +20 -0
  7. data/bin/rjack-solr-fg +53 -0
  8. data/config/config.rb +9 -0
  9. data/init/rjack-solr +44 -0
  10. data/lib/rjack-solr.rb +30 -0
  11. data/lib/rjack-solr/base.rb +28 -0
  12. data/lib/rjack-solr/commons-fileupload-1.2.1.jar +0 -0
  13. data/lib/rjack-solr/commons-io-2.1.jar +0 -0
  14. data/lib/rjack-solr/commons-lang-2.6.jar +0 -0
  15. data/lib/rjack-solr/config.rb +24 -0
  16. data/lib/rjack-solr/server.rb +70 -0
  17. data/lib/rjack-solr/solr-core-3.6.0.jar +0 -0
  18. data/lib/rjack-solr/solr-solrj-3.6.0.jar +0 -0
  19. data/pom.xml +96 -0
  20. data/test/test_solr.rb +43 -0
  21. data/webapp/META-INF/LICENSE.txt +1166 -0
  22. data/webapp/META-INF/MANIFEST.MF +13 -0
  23. data/webapp/META-INF/NOTICE.txt +438 -0
  24. data/webapp/WEB-INF/web.xml +153 -0
  25. data/webapp/WEB-INF/weblogic.xml +12 -0
  26. data/webapp/admin/_info.jsp +120 -0
  27. data/webapp/admin/action.jsp +94 -0
  28. data/webapp/admin/analysis.jsp +496 -0
  29. data/webapp/admin/analysis.xsl +179 -0
  30. data/webapp/admin/dataimport.jsp +53 -0
  31. data/webapp/admin/debug.jsp +103 -0
  32. data/webapp/admin/distributiondump.jsp +160 -0
  33. data/webapp/admin/favicon.ico +0 -0
  34. data/webapp/admin/form.jsp +152 -0
  35. data/webapp/admin/get-file.jsp +72 -0
  36. data/webapp/admin/get-properties.jsp +24 -0
  37. data/webapp/admin/header.jsp +44 -0
  38. data/webapp/admin/index.jsp +162 -0
  39. data/webapp/admin/jquery-1.4.3.min.js +166 -0
  40. data/webapp/admin/meta.xsl +34 -0
  41. data/webapp/admin/ping.jsp +52 -0
  42. data/webapp/admin/ping.xsl +71 -0
  43. data/webapp/admin/raw-schema.jsp +38 -0
  44. data/webapp/admin/registry.jsp +107 -0
  45. data/webapp/admin/registry.xsl +321 -0
  46. data/webapp/admin/replication/header.jsp +89 -0
  47. data/webapp/admin/replication/index.jsp +378 -0
  48. data/webapp/admin/schema.jsp +690 -0
  49. data/webapp/admin/solr-admin.css +215 -0
  50. data/webapp/admin/solr_small.png +0 -0
  51. data/webapp/admin/stats.jsp +92 -0
  52. data/webapp/admin/stats.xsl +220 -0
  53. data/webapp/admin/tabular.xsl +141 -0
  54. data/webapp/admin/threaddump.jsp +110 -0
  55. data/webapp/admin/threaddump.xsl +103 -0
  56. data/webapp/favicon.ico +0 -0
  57. data/webapp/index.jsp +49 -0
  58. metadata +217 -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"
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="78" width="142" src="solr_small.png" alt="Apache 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,53 @@
1
+ <%@ page import="org.apache.solr.request.SolrRequestHandler" %>
2
+ <%@ page import="java.util.Map" %>
3
+ <%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
4
+ <%--
5
+ Licensed to the Apache Software Foundation (ASF) under one or more
6
+ contributor license agreements. See the NOTICE file distributed with
7
+ this work for additional information regarding copyright ownership.
8
+ The ASF licenses this file to You under the Apache License, Version 2.0
9
+ (the "License"); you may not use this file except in compliance with
10
+ the License. You may obtain a copy of the License at
11
+
12
+ http://www.apache.org/licenses/LICENSE-2.0
13
+
14
+ Unless required by applicable law or agreed to in writing, software
15
+ distributed under the License is distributed on an "AS IS" BASIS,
16
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ See the License for the specific language governing permissions and
18
+ limitations under the License.
19
+ --%>
20
+ <%-- do a verbatim include so we can use the local vars --%>
21
+ <%@include file="_info.jsp"%>
22
+ <html>
23
+ <%
24
+ String handler = request.getParameter("handler");
25
+
26
+ if (handler == null) {
27
+ Map<String, SolrRequestHandler> handlers = core.getRequestHandlers();
28
+ %>
29
+ <head>
30
+ <title>DataImportHandler Interactive Development</title>
31
+ <link rel="stylesheet" type="text/css" href="solr-admin.css">
32
+ </head>
33
+ <body>
34
+ Select handler:
35
+ <ul>
36
+ <%
37
+ for (String key : handlers.keySet()) {
38
+ if (handlers.get(key).getClass().getName().equals("org.apache.solr.handler.dataimport.DataImportHandler")) { %>
39
+ <li><a href="dataimport.jsp?handler=<%=key%>"><%=key%></a></li>
40
+ <%
41
+ }
42
+ }
43
+ %>
44
+ </ul>
45
+ </body>
46
+ <% } else { %>
47
+
48
+ <frameset cols = "50%, 50%">
49
+ <frame src ="debug.jsp?handler=<%=handler%>" />
50
+ <frame src ="..<%=handler%>?command=status" name="result"/>
51
+ </frameset>
52
+ <% } %>
53
+ </html>
@@ -0,0 +1,103 @@
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
+ <%-- do a verbatim include so we can use the local vars --%>
19
+ <%@include file="_info.jsp"%>
20
+ <html>
21
+ <head>
22
+ <title>DataImportHandler Interactive Development</title>
23
+ <link rel="stylesheet" type="text/css" href="solr-admin.css"/>
24
+ <link rel="icon" href="favicon.ico" type="image/ico"/>
25
+ <link rel="shortcut icon" href="favicon.ico" type="image/ico"/>
26
+ <script src="jquery-1.4.3.min.js"></script>
27
+ </head>
28
+ <body>
29
+ <h1>DataImportHandler Development Console</h1>
30
+ <%
31
+ String handler = request.getParameter("handler"); // must be specified
32
+ %>
33
+ <form action="..<%=handler%>" target="result" method="get">
34
+ <input type="hidden" name="debug" value="on"/>
35
+ <table>
36
+ <tr>
37
+ <th>Handler: </th>
38
+ <td><%=handler%> <a href="dataimport.jsp" target="_top">change handler</a></td>
39
+ </tr>
40
+ <tr>
41
+ <td colspan="2">
42
+ <table width="100%">
43
+ <tr>
44
+ <td>
45
+ <select name="command">
46
+ <option value="full-import" selected="selected">full-import</option>
47
+ <option value="delta-import">delta-import</option>
48
+ </select>
49
+ </td>
50
+ <td><strong>Verbose</strong>&nbsp;<input
51
+ name="verbose" type="checkbox"></td>
52
+ <td><strong>Commit</strong>&nbsp;<input
53
+ name="commit" type="checkbox"></td>
54
+ <td><strong>Clean</strong>&nbsp;<input
55
+ name="clean" type="checkbox"></td>
56
+ <td><strong>Start Row</strong>&nbsp;<input
57
+ name="start" size="4" type="text" value="0"></td>
58
+ <td><strong>No. of Rows</strong>&nbsp;<input name="rows"
59
+ type="text" size="4" value="10"></td>
60
+ </tr>
61
+ </table>
62
+ </td>
63
+ <tr>
64
+ <td><strong>data config xml</strong></td>
65
+ <td><input class="stdbutton" type="submit" value="debug now">
66
+ </td>
67
+ </tr>
68
+ <tr>
69
+ <td colspan="2"><textarea id="txtDataConfig" rows="30" cols="80" name="dataConfig"></textarea></td>
70
+ <script type="text/javascript" language="javascript">
71
+ $.get("..<%=handler%>?command=show-config", function(data){
72
+ $('#txtDataConfig').attr('value', data);
73
+ });
74
+ </script>
75
+ </tr>
76
+ </table>
77
+ </form>
78
+ <form action="..<%=handler%>" target="result" method="get">
79
+ <input type="hidden" name="clean" value="false">
80
+ <input type="hidden" name="commit" value="true">
81
+ <input class="stdbutton" type="submit" name="command" value="full-import">
82
+ <input class="stdbutton" type="submit" name="command" value="delta-import">
83
+ <input class="stdbutton" type="submit" name="command" value="status">
84
+ <input class="stdbutton" type="submit" name="command" value="reload-config">
85
+ <input class="stdbutton" type="submit" name="command" value="abort">
86
+ </form>
87
+ <form action="../select" target="result" method="get">
88
+ <input type="hidden" name="q" value="*:*">
89
+ <input type="hidden" name="start" value="0">
90
+ <input type="hidden" name="rows" value="0">
91
+ <input class="stdbutton" type="submit" value="Documents Count">
92
+ </form>
93
+ <form action="..<%=handler%>" target="result" method="get">
94
+ <input type="hidden" name="verbose" value="true">
95
+ <input type="hidden" name="clean" value="true">
96
+ <input type="hidden" name="commit" value="true">
97
+ <input type="hidden" name="command" value="full-import">
98
+ <input class="stdbutton" type="submit" value="Full Import with Cleaning">
99
+ </form>
100
+
101
+ <a href="index.jsp" target="_parent">Return to Admin Page</a>
102
+ </body>
103
+ </html>
@@ -0,0 +1,160 @@
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: <%= mode %> Server</h2>
151
+ <br clear="all" />
152
+ (<a href="http://wiki.apache.org/solr/CollectionDistribution">What Is This Page?</a>)
153
+ <br clear="all" />
154
+ <table>
155
+ <%= buffer %>
156
+ </table>
157
+ <br><br>
158
+ <a href=".">Return to Admin Page</a>
159
+ </body>
160
+ </html>