rjack-solr 3.6.2.0-java → 4.0.0.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (315) hide show
  1. data/History.rdoc +5 -0
  2. data/Manifest.txt +268 -33
  3. data/NOTICE.txt +1 -1
  4. data/README.rdoc +6 -6
  5. data/assembly.xml +2 -2
  6. data/bin/rjack-solr-fg +1 -1
  7. data/init/rjack-solr +2 -2
  8. data/lib/rjack-solr.rb +7 -2
  9. data/lib/rjack-solr/base.rb +2 -2
  10. data/lib/rjack-solr/commons-cli-1.2.jar +0 -0
  11. data/lib/rjack-solr/config.rb +1 -1
  12. data/lib/rjack-solr/server.rb +1 -1
  13. data/lib/rjack-solr/solr-core-4.0.0.jar +0 -0
  14. data/lib/rjack-solr/solr-solrj-4.0.0.jar +0 -0
  15. data/pom.xml +19 -6
  16. data/test/test_solr.rb +7 -5
  17. data/webapp/META-INF/LICENSE.txt +0 -940
  18. data/webapp/META-INF/MANIFEST.MF +5 -5
  19. data/webapp/META-INF/NOTICE.txt +160 -93
  20. data/webapp/WEB-INF/web.xml +57 -43
  21. data/webapp/admin.html +140 -0
  22. data/webapp/css/chosen.css +392 -0
  23. data/webapp/css/styles/analysis.css +293 -0
  24. data/webapp/css/styles/cloud.css +331 -0
  25. data/webapp/css/styles/common.css +593 -0
  26. data/webapp/css/styles/cores.css +203 -0
  27. data/webapp/css/styles/dashboard.css +127 -0
  28. data/webapp/css/styles/dataimport.css +222 -0
  29. data/webapp/css/styles/index.css +195 -0
  30. data/webapp/css/styles/java-properties.css +33 -0
  31. data/webapp/css/styles/logging.css +323 -0
  32. data/webapp/css/styles/menu.css +272 -0
  33. data/webapp/css/styles/plugins.css +175 -0
  34. data/webapp/css/styles/query.css +137 -0
  35. data/webapp/css/styles/replication.css +494 -0
  36. data/webapp/css/styles/schema-browser.css +476 -0
  37. data/webapp/css/styles/threads.css +153 -0
  38. data/webapp/img/ZeroClipboard.swf +0 -0
  39. data/webapp/img/chosen-sprite.png +0 -0
  40. data/webapp/img/div.gif +0 -0
  41. data/webapp/{admin → img}/favicon.ico +0 -0
  42. data/webapp/img/filetypes/7z.png +0 -0
  43. data/webapp/img/filetypes/README +27 -0
  44. data/webapp/img/filetypes/ai.png +0 -0
  45. data/webapp/img/filetypes/aiff.png +0 -0
  46. data/webapp/img/filetypes/asc.png +0 -0
  47. data/webapp/img/filetypes/audio.png +0 -0
  48. data/webapp/img/filetypes/bin.png +0 -0
  49. data/webapp/img/filetypes/bz2.png +0 -0
  50. data/webapp/img/filetypes/c.png +0 -0
  51. data/webapp/img/filetypes/cfc.png +0 -0
  52. data/webapp/img/filetypes/cfm.png +0 -0
  53. data/webapp/img/filetypes/chm.png +0 -0
  54. data/webapp/img/filetypes/class.png +0 -0
  55. data/webapp/img/filetypes/conf.png +0 -0
  56. data/webapp/img/filetypes/cpp.png +0 -0
  57. data/webapp/img/filetypes/cs.png +0 -0
  58. data/webapp/img/filetypes/css.png +0 -0
  59. data/webapp/img/filetypes/csv.png +0 -0
  60. data/webapp/img/filetypes/deb.png +0 -0
  61. data/webapp/img/filetypes/divx.png +0 -0
  62. data/webapp/img/filetypes/doc.png +0 -0
  63. data/webapp/img/filetypes/dot.png +0 -0
  64. data/webapp/img/filetypes/eml.png +0 -0
  65. data/webapp/img/filetypes/enc.png +0 -0
  66. data/webapp/img/filetypes/file.png +0 -0
  67. data/webapp/img/filetypes/gif.png +0 -0
  68. data/webapp/img/filetypes/gz.png +0 -0
  69. data/webapp/img/filetypes/hlp.png +0 -0
  70. data/webapp/img/filetypes/htm.png +0 -0
  71. data/webapp/img/filetypes/html.png +0 -0
  72. data/webapp/img/filetypes/image.png +0 -0
  73. data/webapp/img/filetypes/iso.png +0 -0
  74. data/webapp/img/filetypes/jar.png +0 -0
  75. data/webapp/img/filetypes/java.png +0 -0
  76. data/webapp/img/filetypes/jpeg.png +0 -0
  77. data/webapp/img/filetypes/jpg.png +0 -0
  78. data/webapp/img/filetypes/js.png +0 -0
  79. data/webapp/img/filetypes/lua.png +0 -0
  80. data/webapp/img/filetypes/m.png +0 -0
  81. data/webapp/img/filetypes/mm.png +0 -0
  82. data/webapp/img/filetypes/mov.png +0 -0
  83. data/webapp/img/filetypes/mp3.png +0 -0
  84. data/webapp/img/filetypes/mpg.png +0 -0
  85. data/webapp/img/filetypes/odc.png +0 -0
  86. data/webapp/img/filetypes/odf.png +0 -0
  87. data/webapp/img/filetypes/odg.png +0 -0
  88. data/webapp/img/filetypes/odi.png +0 -0
  89. data/webapp/img/filetypes/odp.png +0 -0
  90. data/webapp/img/filetypes/ods.png +0 -0
  91. data/webapp/img/filetypes/odt.png +0 -0
  92. data/webapp/img/filetypes/ogg.png +0 -0
  93. data/webapp/img/filetypes/pdf.png +0 -0
  94. data/webapp/img/filetypes/pgp.png +0 -0
  95. data/webapp/img/filetypes/php.png +0 -0
  96. data/webapp/img/filetypes/pl.png +0 -0
  97. data/webapp/img/filetypes/png.png +0 -0
  98. data/webapp/img/filetypes/ppt.png +0 -0
  99. data/webapp/img/filetypes/ps.png +0 -0
  100. data/webapp/img/filetypes/py.png +0 -0
  101. data/webapp/img/filetypes/ram.png +0 -0
  102. data/webapp/img/filetypes/rar.png +0 -0
  103. data/webapp/img/filetypes/rb.png +0 -0
  104. data/webapp/img/filetypes/rm.png +0 -0
  105. data/webapp/img/filetypes/rpm.png +0 -0
  106. data/webapp/img/filetypes/rtf.png +0 -0
  107. data/webapp/img/filetypes/sig.png +0 -0
  108. data/webapp/img/filetypes/sql.png +0 -0
  109. data/webapp/img/filetypes/swf.png +0 -0
  110. data/webapp/img/filetypes/sxc.png +0 -0
  111. data/webapp/img/filetypes/sxd.png +0 -0
  112. data/webapp/img/filetypes/sxi.png +0 -0
  113. data/webapp/img/filetypes/sxw.png +0 -0
  114. data/webapp/img/filetypes/tar.png +0 -0
  115. data/webapp/img/filetypes/tex.png +0 -0
  116. data/webapp/img/filetypes/tgz.png +0 -0
  117. data/webapp/img/filetypes/txt.png +0 -0
  118. data/webapp/img/filetypes/vcf.png +0 -0
  119. data/webapp/img/filetypes/video.png +0 -0
  120. data/webapp/img/filetypes/vsd.png +0 -0
  121. data/webapp/img/filetypes/wav.png +0 -0
  122. data/webapp/img/filetypes/wma.png +0 -0
  123. data/webapp/img/filetypes/wmv.png +0 -0
  124. data/webapp/img/filetypes/xls.png +0 -0
  125. data/webapp/img/filetypes/xml.png +0 -0
  126. data/webapp/img/filetypes/xpi.png +0 -0
  127. data/webapp/img/filetypes/xvid.png +0 -0
  128. data/webapp/img/filetypes/zip.png +0 -0
  129. data/webapp/img/ico/arrow-000-small.png +0 -0
  130. data/webapp/img/ico/arrow-circle.png +0 -0
  131. data/webapp/img/ico/arrow-switch.png +0 -0
  132. data/webapp/img/ico/asterisk.png +0 -0
  133. data/webapp/img/ico/battery.png +0 -0
  134. data/webapp/img/ico/block-small.png +0 -0
  135. data/webapp/img/ico/block.png +0 -0
  136. data/webapp/img/ico/book-open-text.png +0 -0
  137. data/webapp/img/ico/box.png +0 -0
  138. data/webapp/img/ico/bug.png +0 -0
  139. data/webapp/img/ico/chart.png +0 -0
  140. data/webapp/img/ico/chevron-small-expand.png +0 -0
  141. data/webapp/img/ico/chevron-small.png +0 -0
  142. data/webapp/img/ico/clipboard-list.png +0 -0
  143. data/webapp/img/ico/clipboard-paste-document-text.png +0 -0
  144. data/webapp/img/ico/clipboard-paste.png +0 -0
  145. data/webapp/img/ico/clock-select-remain.png +0 -0
  146. data/webapp/img/ico/clock-select.png +0 -0
  147. data/webapp/img/ico/construction.png +0 -0
  148. data/webapp/img/ico/cross-0.png +0 -0
  149. data/webapp/img/ico/cross-1.png +0 -0
  150. data/webapp/img/ico/cross.png +0 -0
  151. data/webapp/img/ico/dashboard.png +0 -0
  152. data/webapp/img/ico/database.png +0 -0
  153. data/webapp/img/ico/databases.png +0 -0
  154. data/webapp/img/ico/disk-black.png +0 -0
  155. data/webapp/img/ico/document-convert.png +0 -0
  156. data/webapp/img/ico/document-import.png +0 -0
  157. data/webapp/img/ico/document-list.png +0 -0
  158. data/webapp/img/ico/document-text.png +0 -0
  159. data/webapp/img/ico/download-cloud.png +0 -0
  160. data/webapp/img/ico/exclamation-button.png +0 -0
  161. data/webapp/img/ico/eye.png +0 -0
  162. data/webapp/img/ico/folder-export.png +0 -0
  163. data/webapp/img/ico/folder-tree.png +0 -0
  164. data/webapp/img/ico/folder.png +0 -0
  165. data/webapp/img/ico/funnel-small.png +0 -0
  166. data/webapp/img/ico/funnel.png +0 -0
  167. data/webapp/img/ico/gear.png +0 -0
  168. data/webapp/img/ico/globe-network.png +0 -0
  169. data/webapp/img/ico/globe.png +0 -0
  170. data/webapp/img/ico/hammer-screwdriver.png +0 -0
  171. data/webapp/img/ico/hand.png +0 -0
  172. data/webapp/img/ico/highlighter-text.png +0 -0
  173. data/webapp/img/ico/hourglass--exclamation.png +0 -0
  174. data/webapp/img/ico/hourglass.png +0 -0
  175. data/webapp/img/ico/inbox-document-text.png +0 -0
  176. data/webapp/img/ico/information-button.png +0 -0
  177. data/webapp/img/ico/information-small.png +0 -0
  178. data/webapp/img/ico/information-white.png +0 -0
  179. data/webapp/img/ico/information.png +0 -0
  180. data/webapp/img/ico/jar.png +0 -0
  181. data/webapp/img/ico/magnifier.png +0 -0
  182. data/webapp/img/ico/mail.png +0 -0
  183. data/webapp/img/ico/memory.png +0 -0
  184. data/webapp/img/ico/molecule.png +0 -0
  185. data/webapp/img/ico/network-cloud.png +0 -0
  186. data/webapp/img/ico/network-status-away.png +0 -0
  187. data/webapp/img/ico/network-status-busy.png +0 -0
  188. data/webapp/img/ico/network-status-offline.png +0 -0
  189. data/webapp/img/ico/network-status.png +0 -0
  190. data/webapp/img/ico/network.png +0 -0
  191. data/webapp/img/ico/node-design.png +0 -0
  192. data/webapp/img/ico/node-master.png +0 -0
  193. data/webapp/img/ico/node-select.png +0 -0
  194. data/webapp/img/ico/node-slave.png +0 -0
  195. data/webapp/img/ico/node.png +0 -0
  196. data/webapp/img/ico/pencil-small.png +0 -0
  197. data/webapp/img/ico/plus-button.png +0 -0
  198. data/webapp/img/ico/processor.png +0 -0
  199. data/webapp/img/ico/prohibition.png +0 -0
  200. data/webapp/img/ico/property.png +0 -0
  201. data/webapp/img/ico/question-small-white.png +0 -0
  202. data/webapp/img/ico/question-white.png +0 -0
  203. data/webapp/img/ico/question.png +0 -0
  204. data/webapp/img/ico/receipt-invoice.png +0 -0
  205. data/webapp/img/ico/receipt.png +0 -0
  206. data/webapp/img/ico/script-code.png +0 -0
  207. data/webapp/img/ico/server-cast.png +0 -0
  208. data/webapp/img/ico/server.png +0 -0
  209. data/webapp/img/ico/sitemap.png +0 -0
  210. data/webapp/img/ico/slash.png +0 -0
  211. data/webapp/img/ico/status-away.png +0 -0
  212. data/webapp/img/ico/status-busy.png +0 -0
  213. data/webapp/img/ico/status-offline.png +0 -0
  214. data/webapp/img/ico/status.png +0 -0
  215. data/webapp/img/ico/system-monitor--exclamation.png +0 -0
  216. data/webapp/img/ico/system-monitor.png +0 -0
  217. data/webapp/img/ico/table.png +0 -0
  218. data/webapp/img/ico/terminal.png +0 -0
  219. data/webapp/img/ico/tick-circle.png +0 -0
  220. data/webapp/img/ico/tick-red.png +0 -0
  221. data/webapp/img/ico/tick.png +0 -0
  222. data/webapp/img/ico/toggle-small-expand.png +0 -0
  223. data/webapp/img/ico/toggle-small.png +0 -0
  224. data/webapp/img/ico/toolbox.png +0 -0
  225. data/webapp/img/ico/ui-accordion.png +0 -0
  226. data/webapp/img/ico/ui-address-bar.png +0 -0
  227. data/webapp/img/ico/ui-check-box-uncheck.png +0 -0
  228. data/webapp/img/ico/ui-check-box.png +0 -0
  229. data/webapp/img/ico/ui-radio-button-uncheck.png +0 -0
  230. data/webapp/img/ico/ui-radio-button.png +0 -0
  231. data/webapp/img/ico/ui-text-field-select.png +0 -0
  232. data/webapp/img/ico/users.png +0 -0
  233. data/webapp/img/ico/wooden-box.png +0 -0
  234. data/webapp/img/ico/zone.png +0 -0
  235. data/webapp/img/loader-light.gif +0 -0
  236. data/webapp/img/loader.gif +0 -0
  237. data/webapp/img/lucene-ico.png +0 -0
  238. data/webapp/img/solr-ico.png +0 -0
  239. data/webapp/{admin/solr_small.png → img/solr.png} +0 -0
  240. data/webapp/img/tree.png +0 -0
  241. data/webapp/js/lib/ZeroClipboard.js +317 -0
  242. data/webapp/js/lib/chosen.js +953 -0
  243. data/webapp/{admin/get-properties.jsp → js/lib/console.js} +13 -10
  244. data/webapp/js/lib/d3.js +9342 -0
  245. data/webapp/js/lib/highlight.js +1 -0
  246. data/webapp/{admin/jquery-1.4.3.min.js → js/lib/jquery-1.7.2.min.js} +0 -0
  247. data/webapp/js/lib/jquery.blockUI.js +499 -0
  248. data/webapp/js/lib/jquery.cookie.js +47 -0
  249. data/webapp/js/lib/jquery.form.js +782 -0
  250. data/webapp/js/lib/jquery.jstree.js +3510 -0
  251. data/webapp/js/lib/jquery.sammy.js +1856 -0
  252. data/webapp/js/lib/jquery.sparkline.js +1271 -0
  253. data/webapp/js/lib/jquery.timeago.js +165 -0
  254. data/webapp/js/lib/linker.js +48 -0
  255. data/webapp/js/lib/order.js +189 -0
  256. data/webapp/js/main.js +57 -0
  257. data/webapp/js/require.js +11319 -0
  258. data/webapp/js/scripts/analysis.js +549 -0
  259. data/webapp/js/scripts/app.js +368 -0
  260. data/webapp/js/scripts/cloud.js +719 -0
  261. data/webapp/js/scripts/cores.js +540 -0
  262. data/webapp/js/scripts/dashboard.js +540 -0
  263. data/webapp/js/scripts/dataimport.js +567 -0
  264. data/webapp/js/scripts/file.js +56 -0
  265. data/webapp/js/scripts/index.js +344 -0
  266. data/webapp/js/scripts/java-properties.js +107 -0
  267. data/webapp/js/scripts/logging.js +519 -0
  268. data/webapp/js/scripts/ping.js +72 -0
  269. data/webapp/js/scripts/plugins.js +426 -0
  270. data/webapp/js/scripts/query.js +170 -0
  271. data/webapp/js/scripts/replication.js +557 -0
  272. data/webapp/js/scripts/schema-browser.js +1206 -0
  273. data/webapp/js/scripts/threads.js +159 -0
  274. data/webapp/tpl/analysis.html +83 -0
  275. data/webapp/tpl/cloud.html +54 -0
  276. data/webapp/tpl/cores.html +215 -0
  277. data/webapp/tpl/dashboard.html +164 -0
  278. data/webapp/tpl/dataimport.html +123 -0
  279. data/webapp/tpl/index.html +250 -0
  280. data/webapp/tpl/logging.html +23 -0
  281. data/webapp/tpl/plugins.html +39 -0
  282. data/webapp/tpl/query.html +318 -0
  283. data/webapp/tpl/replication.html +207 -0
  284. data/webapp/tpl/schema-browser.html +178 -0
  285. data/webapp/tpl/threads.html +56 -0
  286. metadata +307 -40
  287. data/lib/rjack-solr/solr-core-3.6.2.jar +0 -0
  288. data/lib/rjack-solr/solr-solrj-3.6.2.jar +0 -0
  289. data/webapp/admin/_info.jsp +0 -120
  290. data/webapp/admin/action.jsp +0 -94
  291. data/webapp/admin/analysis.jsp +0 -496
  292. data/webapp/admin/analysis.xsl +0 -179
  293. data/webapp/admin/dataimport.jsp +0 -53
  294. data/webapp/admin/debug.jsp +0 -103
  295. data/webapp/admin/distributiondump.jsp +0 -160
  296. data/webapp/admin/form.jsp +0 -152
  297. data/webapp/admin/get-file.jsp +0 -72
  298. data/webapp/admin/header.jsp +0 -44
  299. data/webapp/admin/index.jsp +0 -162
  300. data/webapp/admin/meta.xsl +0 -34
  301. data/webapp/admin/ping.jsp +0 -52
  302. data/webapp/admin/ping.xsl +0 -71
  303. data/webapp/admin/raw-schema.jsp +0 -38
  304. data/webapp/admin/registry.jsp +0 -107
  305. data/webapp/admin/registry.xsl +0 -321
  306. data/webapp/admin/replication/header.jsp +0 -89
  307. data/webapp/admin/replication/index.jsp +0 -378
  308. data/webapp/admin/schema.jsp +0 -690
  309. data/webapp/admin/solr-admin.css +0 -215
  310. data/webapp/admin/stats.jsp +0 -92
  311. data/webapp/admin/stats.xsl +0 -220
  312. data/webapp/admin/tabular.xsl +0 -141
  313. data/webapp/admin/threaddump.jsp +0 -110
  314. data/webapp/admin/threaddump.xsl +0 -103
  315. data/webapp/index.jsp +0 -49
@@ -1,690 +0,0 @@
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
- <%-- $Id: index.jsp 608150 2008-01-02 17:15:30Z ryan $ --%>
20
- <%-- $Source: /cvs/main/searching/SolrServer/resources/admin/index.jsp,v $ --%>
21
- <%-- $Name: $ --%>
22
-
23
- <script src="jquery-1.4.3.min.js"></script>
24
- <script>
25
-
26
- (function($, libName) {
27
- var solr = {
28
-
29
- //The default location of the luke handler relative to this page
30
- // Can be overridden in the init(url) method
31
- pathToLukeHandler: 'luke',
32
-
33
- // Base properties to hold schema information
34
- schemaInfo: {},
35
- schemaFields: {},
36
- schemaDynamicFields: {},
37
- schemaTypes: {},
38
- schemaFlags: {},
39
-
40
- //The basic function to call to make the initail JSON calls
41
- // takes one option parameter, the path to the luke handler
42
- // if undefined, it will use the default, 'luke', which means
43
- // this is being called from the same relative URL path
44
- init: function(pathToLukeHandler) {
45
- if (pathToLukeHandler != undefined) {
46
- solr.pathToLukeHandler = pathToLukeHandler;
47
- }
48
- solr.loadSchema(function() {
49
- solr.loadFromLukeHandler(function () {
50
- solr.createMenu('menu');
51
- solr.displaySchemaInfo();
52
- });
53
- });
54
-
55
- },
56
- // get the reportDocCount parameter, could ask for others
57
- getParamDefault: function(paramName, defaultVal) {
58
- var searchString = window.location.search.substring(1),
59
- i, val, params = searchString.split("&");
60
-
61
- for (i=0;i<params.length;i++) {
62
- val = params[i].split("=");
63
- if (val[0] == paramName) {
64
- return unescape(val[1]);
65
- }
66
- }
67
- return defaultVal;
68
- },
69
-
70
- //load the Schema from the LukeRequestHandler
71
- // this loads every field, and in each field the copy source/dests and flags
72
- // we also load the list of field types, and the list of flags
73
- loadSchema: function(func) {
74
- $.getJSON(solr.pathToLukeHandler +'?show=schema&wt=json', function(data) {
75
- //populate all non field/type/flag data in the info block
76
- $.each(data.index, function(i, item) {
77
- solr.schemaInfo[i] = item;
78
- });
79
-
80
- //LukeRequestHandler places these two attributes outside of the "index" node, but
81
- // we want it here so we can more easily display it in the "HOME" block
82
- solr.schemaInfo['uniqueKeyField'] = data.schema.uniqueKeyField;
83
- solr.schemaInfo['defaultSearchField'] = data.schema.defaultSearchField;
84
- //a one-off hack, because the directory string is so long and unbroken
85
- // that it can break CSS layouts
86
- solr.schemaInfo['directory'] = solr.schemaInfo['directory'].substring(0, solr.schemaInfo['directory'].indexOf('@')+1) + ' ' + solr.schemaInfo['directory'].substring(solr.schemaInfo['directory'].indexOf('@') +1);
87
-
88
- // populate the list of fields
89
- $.each(data.schema.fields, function(i,item){
90
- solr.schemaFields[i]=item;
91
- });
92
- // populate the list of field types
93
- $.each(data.schema.types, function(type, ft) {
94
- solr.schemaTypes[type] = ft;
95
- });
96
- //populate the list of dynamic fields
97
- $.each(data.schema.dynamicFields, function(i, dynField) {
98
- solr.schemaDynamicFields[i] = dynField;
99
- });
100
- //populate the list of flags, so we can convert flags to text in display
101
- $.each(data.info.key, function(i, flag) {
102
- solr.schemaFlags[i] = flag;
103
- });
104
-
105
- //LukeRequestHandler returns copyFields src/dest as the entire toString of the field
106
- // we only need the field name, so here we loop through the fields, and replace the full
107
- // field definitions with the name in the copySources/copyDests properties
108
- $.each(solr.schemaFields, function(i, field) {
109
- $.each(['copySources', 'copyDests'], function(i, copyProp) {
110
- var newFields = new Array();
111
- $.each(field[copyProp], function(i, fullName) {
112
- newFields.push(fullName.substring(fullName.lastIndexOf(':')+1, fullName.indexOf('{')));
113
- });
114
- field[copyProp] = newFields;
115
- });
116
-
117
- });
118
- //An additional optional callback
119
- // used in init to trigger the 2nd call to LukeRequestHandler only
120
- // after the first one is finished
121
- if ($.isFunction(func)) {
122
- func(solr);
123
- }
124
- });
125
- },
126
-
127
- //further populates the loaded schema with information gathered
128
- // from the no argument LukeRequestHandler
129
- loadFromLukeHandler: function(func) {
130
-
131
- $.getJSON(solr.pathToLukeHandler+'?wt=json' + '&reportDocCount=' + solr.getParamDefault('reportDocCount', 'false'), function(data) {
132
- $.each(data.fields, function(i, item) {
133
- var field = solr.schemaFields[i];
134
-
135
- //If undefined, then we have a dynamicField which does not show up
136
- // in the LukeRequestHandler show=schema variant
137
- if (field == undefined) {
138
- field = item;
139
- //Attach this field to its dynamicField
140
- var base = field.dynamicBase;
141
- var dynField = solr.schemaDynamicFields[base];
142
-
143
- //Some fields in a multicore setting have no dynamic base, either
144
- // the name of the core is a field that has no type or flags
145
- if (dynField != undefined) {
146
- var synFields = dynField['fields'];
147
- if (synFields== undefined) {
148
- synFields= new Array();
149
- }
150
- synFields.push(i);
151
- dynField['fields'] = synFields;
152
- }
153
- solr.schemaFields[i] = item;
154
- }
155
- //Populate other data in this field that would not have been loaded in
156
- // the show=schema variant
157
- $.each(item, function(k, v) {
158
- if (k == 'topTerms' || k == 'histogram') {
159
- solr.schemaFields[i][k] = solr.lukeArrayToHash(v);
160
- } else {
161
- solr.schemaFields[i][k] = v;
162
- }
163
- });
164
- });
165
- //another optional callback; used in the init case to lay out the page
166
- // after the data is loaded
167
- if ($.isFunction(func)) {
168
- func();
169
- }
170
- });
171
- },
172
- //some elements in the JSON response are arrays, where odd/even elements
173
- // are the name/value, and convert it to a standard map/associative array
174
- // incoming: ['foo', 'bar', 'bat', 'baz']
175
- // output: {'foo':'bar', 'bat':baz'}
176
- lukeArrayToHash: function(termsArr) {
177
- var hash = new Object();
178
- var temp;
179
- //topTerms comes in as an array, with odd indexes the field name
180
- // and even indexes the number
181
- $.each(termsArr, function(i, item) {
182
- if (i%2 ==0) {
183
- temp = item;
184
- } else {
185
- hash[temp] = item;
186
- }
187
- });
188
- return hash;
189
- },
190
-
191
- //gets the top Terms via an Ajax call the LukeRequestHandler for that field
192
- // The callback is used here to redraw the table after the ajax call returns
193
- getTopTerms: function(fieldName, numTerms, func) {
194
- if (numTerms == undefined) {
195
- var numTerms = 10;
196
- }
197
- if (isNaN(numTerms) || numTerms <=0 || numTerms.indexOf('.') != -1) {
198
- return;
199
- }
200
-
201
- $.getJSON(solr.pathToLukeHandler+'?fl='+fieldName+'&wt=json&numTerms='+numTerms+'&reportDocCount=' + solr.getParamDefault('reportDocCount', 'false'), function(data) {
202
- solr.schemaFields[fieldName]['topTerms'] = solr.lukeArrayToHash(data.fields[fieldName].topTerms);
203
- if ($.isFunction(func)) {
204
- func(solr.schemaFields[fieldName]['topTerms'], fieldName);
205
- }
206
- });
207
- },
208
-
209
- // Displays the SchemaInfo in the main content panel
210
- // dispayed on data load, and also when 'Home' is clicked
211
- displaySchemaInfo: function() {
212
- $('#mainInfo').html('');
213
- $('#topTerms').html('');
214
- $('#histogram').html('');
215
- $('#mainInfo').append(solr.createSimpleText('Schema Information'));
216
- //Make sure the uniqueKeyField and defaultSearchFields come first
217
- $.each({'Unique Key':'uniqueKeyField', 'Default Search Field':'defaultSearchField'}, function(text, prop) {
218
- if (solr.schemaInfo[prop] != undefined) {
219
- $('#mainInfo').append(solr.createNameValueText(text, function(p) {
220
- p.appendChild(solr.createLink(solr.schemaInfo[prop], solr.schemaInfo[prop]));
221
- return p;
222
- }));
223
- }
224
- });
225
- $.each(solr.schemaInfo, function(i, item) {
226
- if (i == 'uniqueKeyField' || i == 'defaultSearchField') {
227
- //noop; we took care of this above
228
- } else {
229
- $('#mainInfo').append(solr.createNameValueText(i, item));
230
- }
231
- });
232
- //Close all menus when we display schema home
233
- solr.toggleMenus(undefined, ['fields', 'types', 'dynFields']);
234
- },
235
-
236
- // display a dynamic field in the main content panel
237
- displayDynamicField: function(dynamicPattern) {
238
- var df = solr.schemaDynamicFields[dynamicPattern];
239
- $('#mainInfo').html('');
240
- $('#topTerms').html('');
241
- $('#histogram').html('');
242
- $('#mainInfo').append(solr.createSimpleText('Dynamic Field: ' + dynamicPattern));
243
- $('#mainInfo').append(solr.createNameValueText('Fields', function(p) {
244
- if (df.fields != undefined) {
245
- $.each(df.fields, function(i, item) {
246
- p.appendChild(solr.createLink(item, item));
247
- });
248
- } else {
249
- p.appendChild(document.createTextNode(' None currently in index'));
250
- }
251
- return p;
252
- }));
253
- var ft = solr.schemaTypes[df.type];
254
- $('#mainInfo').append(solr.createNameValueText('Field Type', function(p) {
255
- p.appendChild(solr.createLink(df.type, df.type, solr.displayFieldType));
256
- return p;
257
- }));
258
- if (df.flags != undefined) {
259
- $('#mainInfo').append(solr.createNameValueText('Properties', solr.createTextFromFlags(df.flags, df.type)));
260
- }
261
- solr.displayAnalyzer(ft.indexAnalyzer, 'Index Analyzer', true);
262
- solr.displayAnalyzer(ft.queryAnalyzer, 'Query Analyzer', true);
263
-
264
- solr.toggleMenus('dynFields', ['fields', 'types'], dynamicPattern);
265
- },
266
-
267
- // display a field type in the main area
268
- displayFieldType: function(typeName) {
269
- var ft = solr.schemaTypes[typeName];
270
- $('#mainInfo').html('');
271
- $('#topTerms').html('');
272
- $('#histogram').html('');
273
- $('#mainInfo').append(solr.createSimpleText('Field Type: ' + typeName));
274
- $('#mainInfo').append(solr.createNameValueText('Fields', function(p) {
275
- if (ft.fields != undefined) {
276
- $.each(ft.fields, function(i, item) {
277
- if (solr.schemaFields[item] != undefined) {
278
- p.appendChild(solr.createLink(item, item));
279
- } else {
280
- p.appendChild(solr.createLink(item, item, solr.displayDynamicField));
281
- }
282
- p.appendChild(document.createTextNode(' '));
283
- });
284
- } else {
285
- p.appendChild(document.createTextNode('No fields in index'));
286
- }
287
- return p;
288
- }));
289
- $('#mainInfo').append(solr.createNameValueText('Tokenized', ft.tokenized));
290
- $('#mainInfo').append(solr.createNameValueText('Class Name', ft.className));
291
-
292
- solr.displayAnalyzer(ft.indexAnalyzer, 'Index Analyzer');
293
- solr.displayAnalyzer(ft.queryAnalyzer, 'Query Analyzer');
294
- solr.toggleMenus('types', ['fields', 'dynFields'], typeName);
295
- },
296
-
297
- //Displays information about an Analyzer in the main content area
298
- displayAnalyzer: function(analyzer, type, shouldCollapse) {
299
- var tid = type.replace(' ', '');
300
- var collapse = shouldCollapse && (analyzer.charFilters != undefined || analyzer.tokenizer != undefined || analyzer.filters != undefined);
301
- $('#mainInfo').append(solr.createNameValueText(type, function(p) {
302
- p.appendChild(document.createTextNode(analyzer.className + ' '));
303
- if (collapse) {
304
- p.appendChild(solr.createLink(type, 'Details', function() {
305
- $('#'+tid).toggle("slow");
306
- }));
307
- }
308
- return p;
309
- }));
310
- var adiv = document.createElement('div');
311
- adiv.id=tid;
312
- adiv.className='analyzer';
313
- if (collapse) {
314
- adiv.style.display='none';
315
- }
316
- if (analyzer.charFilters != undefined) {
317
- adiv.appendChild(solr.createNameValueText('Char Filters', ''));
318
- var f = document.createElement('ol');
319
- $.each(analyzer.charFilters, function(i, item) {
320
- var fil = document.createElement('li');
321
- var filterText = item.className;
322
- if (item.args != undefined) {
323
- filterText += ' args:{'
324
- $.each(item.args, function(fi, fitem) {
325
- filterText += fi + ': ' + fitem + ' ';
326
- });
327
- filterText +='}';
328
- fil.innerHTML = filterText;
329
- f.appendChild(fil);
330
- }
331
- });
332
- adiv.appendChild(f);
333
- }
334
- if (analyzer.tokenizer != undefined) {
335
- adiv.appendChild(solr.createNameValueText("Tokenizer Class", analyzer.tokenizer.className));
336
- }
337
- if (analyzer.filters != undefined) {
338
- adiv.appendChild(solr.createNameValueText('Filters', ''));
339
- var f = document.createElement('ol');
340
- $.each(analyzer.filters, function(i, item) {
341
- var fil = document.createElement('li');
342
- var filterText = item.className;
343
- if (item.args != undefined) {
344
- filterText += ' args:{'
345
- $.each(item.args, function(fi, fitem) {
346
- filterText += fi + ': ' + fitem + ' ';
347
- });
348
- filterText +='}';
349
- fil.innerHTML = filterText;
350
- f.appendChild(fil);
351
- }
352
- });
353
- adiv.appendChild(f);
354
- }
355
- $('#mainInfo').append(adiv);
356
- },
357
-
358
- // display information about a Field in the main content area
359
- // and its TopTerms and Histogram in related divs
360
- displayField: function(fieldName) {
361
- var field = solr.schemaFields[fieldName];
362
- var isDynamic = field.dynamicBase != undefined ? true : false;
363
- var ft;
364
- var ftName;
365
- $('#mainInfo').html('');
366
- $('#topTerms').html('');
367
- $('#histogram').html('');
368
- $('#mainInfo').append(solr.createSimpleText('Field: ' + fieldName));
369
-
370
- //For regular fields, we take their properties; for dynamicFields,
371
- // we take them from their dynamicField definitions
372
- if (isDynamic) {
373
- ftName = solr.schemaDynamicFields[field.dynamicBase].type
374
- $('#mainInfo').append(solr.createNameValueText('Dynamically Created From Pattern', function(p) {
375
- p.appendChild(solr.createLink(field.dynamicBase, field.dynamicBase, solr.displayDynamicField));
376
- return p;
377
- }));
378
- } else {
379
- ftName = field.type;
380
- }
381
- ft = solr.schemaTypes[field.type];
382
- $('#mainInfo').append(solr.createNameValueText('Field Type', function(p) {
383
- p.appendChild(solr.createLink(ftName, ftName, solr.displayFieldType));
384
- return p;
385
- }));
386
- if (solr.schemaFlags != '') {
387
- $.each({'flags':'Properties', 'schema':'Schema', 'index':'Index'}, function(prop, text) {
388
- if (field[prop] != undefined) {
389
- $('#mainInfo').append(solr.createNameValueText(text, solr.createTextFromFlags(field[prop], ft)));
390
- }
391
- });
392
- }
393
- $.each({'copySources':'Copied From', 'copyDests':'Copied Into'}, function(prop, text) {
394
- if (field[prop] != undefined && field[prop] != '') {
395
- $('#mainInfo').append(solr.createNameValueText(text, function(p) {
396
- $.each(field[prop], function(i, item) {
397
- p.appendChild(solr.createLink(item, item));
398
- p.appendChild(document.createTextNode(' '));
399
- });
400
- return p;
401
- }));
402
- }
403
- });
404
- if (field.positionIncrementGap != undefined) {
405
- $('#mainInfo').append(solr.createNameValueText('Position Increment Gap', field.positionIncrementGap));
406
- }
407
- solr.displayAnalyzer(ft.indexAnalyzer, 'Index Analyzer', true);
408
- solr.displayAnalyzer(ft.queryAnalyzer, 'Query Analyzer', true);
409
- if (field.docs != undefined) {
410
- $('#mainInfo').append(solr.createNameValueText('Docs', field.docs));
411
- }
412
- if (field.distinct != undefined) {
413
- $('#mainInfo').append(solr.createNameValueText('Distinct', field.distinct));
414
- }
415
-
416
- if (field.topTerms != undefined) {
417
- solr.displayTopTerms(field.topTerms, fieldName);
418
- }
419
-
420
- if (field.histogram != undefined) {
421
- solr.drawHistogram(field.histogram);
422
- }
423
- solr.toggleMenus('fields', ['types', 'dynFields'], fieldName);
424
- },
425
-
426
- //utility method to create a single sentence list of properties from a flag set
427
- // or pass it on, if the flags are (unstored field)
428
- createTextFromFlags: function(fieldFlags, fieldType) {
429
- var value;
430
- if (fieldFlags != '(unstored field)') {
431
- var value = '';
432
- for (var i=0;i<fieldFlags.length;i++) {
433
- if (fieldFlags.charAt(i) != '-') {
434
- value += solr.schemaFlags[fieldFlags.charAt(i)];
435
- value += ', ';
436
- }
437
- }
438
- value = value.substring(0, value.length-2);
439
- } else {
440
- value = fieldFlags;
441
- }
442
- return value;
443
- },
444
-
445
- //Store the currently highlighted menu item, as otherwise we
446
- // must traverse all li menu items, which is very slow on schemas with
447
- // large number of fields
448
- // for example $('#menu ul li').siblings().removeClass('selected');
449
- currentlyHighlightedMenuId: undefined,
450
-
451
- //add a highlight to the currently selected menu item, and remove
452
- // the highlights from all other menu items
453
- highlightMenuItem: function(idToSelect) {
454
- if (solr.currentlyHighlightedMenuId != undefined) {
455
- $('#'+solr.currentlyHighlightedMenuId).removeClass('selected');
456
- }
457
- $('#'+idToSelect).addClass('selected');
458
- solr.currentlyHighlightedMenuId = idToSelect;
459
- },
460
-
461
- //Opens one menu group, close the others, and optionally highlight one
462
- // item, which should be in the opened menu
463
- toggleMenus: function(idToShow, idsToHide, idToSelect) {
464
- if (idToSelect != undefined) {
465
- solr.highlightMenuItem(idToShow + idToSelect);
466
- }
467
- $('#'+idToShow).show("slow");
468
- $.each(idsToHide, function(i, idToHide) {
469
- $('#'+idToHide).hide("slow");
470
- });
471
- },
472
-
473
- //A utility method to create a paragraph, which takes two arguments;
474
- // an opening text, and either text or a callback function to follow
475
- // any callback function must return the node passed into it
476
- createNameValueText: function(openingText, func) {
477
- var p = document.createElement('p');
478
- p.appendChild(solr.createSimpleText(openingText + ': ', 'b'));
479
- return solr.applyFuncToNode(p, func);
480
- },
481
-
482
- //utility method to create an HTML text element node
483
- // with the literal text to place, and an optional function to apply
484
- // any callback function must return the node passed into it
485
- createSimpleText: function(text, n, func) {
486
- if (n == undefined) {
487
- n = 'h2';
488
- }
489
- var no= document.createElement(n);
490
- no.appendChild(document.createTextNode(text));
491
- return solr.applyFuncToNode(no, func);
492
- },
493
-
494
- //Utility method that applies a function or a string to append
495
- // an additional child to a node
496
- applyFuncToNode: function(no, func) {
497
- if ($.isFunction(func)) {
498
- no = func(no);
499
- } else {
500
- // if it is not a function, append it as a string
501
- if (func != undefined) {
502
- no.appendChild(document.createTextNode(' ' + func));
503
- }
504
- }
505
- return no;
506
- },
507
-
508
- //show a table of top terms for a given field
509
- displayTopTerms: function(topTerms, fieldName) {
510
- $('#topTerms').html('');
511
- var tbl = document.createElement('table');
512
- tbl.className='topTerms';
513
- var thead= document.createElement('thead');
514
- var headerRow = document.createElement('tr');
515
- $.each(['term', 'frequency'], function() {
516
- var cell = document.createElement('th');
517
- cell.innerHTML= this;
518
- headerRow.appendChild(cell);
519
- });
520
- thead.appendChild(headerRow);
521
- tbl.appendChild(thead);
522
- var tbody = document.createElement('tbody');
523
-
524
- var numTerms = 0;
525
- $.each(topTerms, function(term, count) {
526
- var c1 = $('<td>').text(term);
527
- var c2 = $('<td>').text(count);
528
- var row = $('<tr>').append(c1).append(c2);
529
- tbody.appendChild(row.get(0));
530
- numTerms++;
531
- });
532
- tbl.appendChild(tbody);
533
-
534
- //create a header along with an input widget so the user
535
- // can request a different number of Top Terms
536
- var h2 = document.createElement('h2');
537
- h2.appendChild(document.createTextNode('Top '));
538
- var termsGetter = document.createElement('input');
539
- termsGetter.type='text';
540
- termsGetter.size=5;
541
- termsGetter.value=numTerms;
542
-
543
- termsGetter.onchange=function() {
544
- solr.getTopTerms(fieldName, this.value, solr.displayTopTerms);
545
- }
546
- h2.appendChild(termsGetter);
547
- h2.appendChild(document.createTextNode(' Terms'));
548
- $('#topTerms').append(h2);
549
-
550
- document.getElementById('topTerms').appendChild(tbl);
551
- $('#topTerms').append(tbl);
552
- },
553
-
554
- //draws a histogram, taking a map of values and an optional total height and width for the table
555
- drawHistogram: function(histogram, totalHeightArg, totalWidthArg) {
556
- $('#histogram').html('');
557
- $('#histogram').append(solr.createSimpleText('Histogram'));
558
- var max = 0;
559
- var bars =0;
560
- //find the # of columns and max value in the histogram
561
- // so we can create an appropriately scaled chart
562
- $.each(histogram, function(i, item) {
563
- if (item > max) max = item;
564
- bars += 1;
565
- });
566
- if (max ==0) {
567
- $('#histogram').append(solr.createNameValueText('No histogram available'));
568
- } else {
569
- var totalHeight = totalHeightArg == undefined ? 208 : totalHeightArg;
570
- var totalWidth = totalWidthArg == undefined ? 160 : totalWidthArg;
571
- var tbl = document.createElement('table');
572
- tbl.style.width=totalWidth+'px';
573
- tbl.className = 'histogram';
574
- var h = document.createElement('tbody');
575
- var r = document.createElement('tr');
576
- var r2 = document.createElement('tr');
577
- $.each(histogram, function(i, item) {
578
- var c = document.createElement('td');
579
- c.innerHTML=item+'<div style="width:'+totalWidth/bars+'px;height:'+(item*totalHeight/max)+'px;background:blue">&nbsp</div>';
580
- r.appendChild(c);
581
- var c2 = document.createElement('td');
582
- c2.innerHTML='' + i;
583
- r2.appendChild(c2);
584
- });
585
- h.appendChild(r);
586
- h.appendChild(r2);
587
- tbl.appendChild(h);
588
- $('#histogram').append(tbl);
589
- }
590
- },
591
-
592
- //dynamically creates a link to be appended
593
- createLink: function(idToDisplay, linkText, linkFunction) {
594
- var link = document.createElement('a');
595
- if (!$.isFunction(linkFunction)) {
596
- linkFunction = solr.displayField
597
- }
598
- link.onclick=function() {
599
- linkFunction(idToDisplay);
600
- return false;
601
- };
602
- link.href='#';
603
- link.innerHTML=linkText;
604
- return link;
605
- },
606
-
607
- //Creates a menu header that can expand or collapse its children
608
- createMenuHeader: function(text, idToShow, idsToHide) {
609
- var head = document.createElement('h3');
610
- var a = document.createElement('a');
611
- a.onclick=function() {
612
- solr.toggleMenus(idToShow, idsToHide);
613
- return false;
614
- };
615
- a.href='#';
616
- a.innerHTML=text;
617
- head.appendChild(a);
618
- return head;
619
- },
620
-
621
- //Creates an element in a menu (e.g. each field in a list of fields)
622
- createMenuItem: function(tagName, text, link, type, func) {
623
- var fieldEle = document.createElement('li');
624
- fieldEle.id=type+text;
625
- var funct = func == undefined ? undefined : func;
626
- fieldEle.appendChild(solr.createLink(text, link, funct));
627
- return fieldEle;
628
- },
629
-
630
- //populates the menu div
631
- createMenu: function(menuId) {
632
- var m = $('#'+menuId);
633
- var home = document.createElement('h2');
634
- home.appendChild(solr.createLink('Home', 'Home', solr.displaySchemaInfo));
635
- m.append(home);
636
- m.append(solr.createMenuHeader('Fields', 'fields', ['types', 'dynFields']));
637
- var fields= document.createElement('ul');
638
- fields.style.display='none';
639
- fields.id = 'fields';
640
- $.each(solr.schemaFields, function(i, item) {
641
- fields.appendChild(solr.createMenuItem('li', i, i, fields.id));
642
- });
643
- m.append(fields);
644
- m.append(solr.createMenuHeader('Dynamic Fields', 'dynFields', ['fields', 'types']));
645
- var dyns = document.createElement('ul');
646
- dyns.style.display = 'none';
647
- dyns.id = 'dynFields';
648
- $.each(solr.schemaDynamicFields, function(i, item) {
649
- dyns.appendChild(solr.createMenuItem('li', i,i, dyns.id, solr.displayDynamicField));
650
- });
651
- m.append(dyns);
652
- m.append(solr.createMenuHeader('Field Types', 'types', ['fields', 'dynFields']));
653
- var types = document.createElement('ul');
654
- types.style.display='none';
655
- types.id='types';
656
- $.each(this.schemaTypes, function(i, item) {
657
- types.appendChild(solr.createMenuItem('li', i, i,types.id, solr.displayFieldType));
658
- });
659
- m.append(types);
660
- }
661
- };
662
-
663
- window[libName] = solr;
664
- })(jQuery, 'solr');
665
- $(document).ready(function() {
666
- solr.init();
667
- });
668
-
669
- $(window).unload( function() {
670
- solr = null;
671
- $('#mainInfo').html('');
672
- $('#menu').html('');
673
- $('#topTerms').html('');
674
- $('#histogram').html('');
675
- });
676
-
677
- </script>
678
- <%-- do a verbatim include so we can use the local vars --%>
679
- <%@include file="header.jsp" %>
680
- <div id="schemaTop">
681
- <h2>Schema Browser | See <a href="file/?file=schema.xml">Raw Schema.xml</a></h2>
682
- </div>
683
- <div id="menu"></div>
684
- <div id="content">
685
- <div id="mainInfo"><h2>Please wait...loading and parsing Schema Information from LukeRequestHandler</h2><p>If it does not load or your browser is not javascript or ajax-capable, you may wish to examine your schema using the <a href="luke?wt=xslt&tr=luke.xsl">Server side transformed LukeRequestHandler</a> or the raw <a href="file/?file=schema.xml">schema.xml</a> instead.</div>
686
- <div id="topTerms"></div>
687
- <div id="histogram"></div>
688
- </div>
689
- </body>
690
- </html>