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.
- data/History.rdoc +5 -0
- data/Manifest.txt +268 -33
- data/NOTICE.txt +1 -1
- data/README.rdoc +6 -6
- data/assembly.xml +2 -2
- data/bin/rjack-solr-fg +1 -1
- data/init/rjack-solr +2 -2
- data/lib/rjack-solr.rb +7 -2
- data/lib/rjack-solr/base.rb +2 -2
- data/lib/rjack-solr/commons-cli-1.2.jar +0 -0
- data/lib/rjack-solr/config.rb +1 -1
- data/lib/rjack-solr/server.rb +1 -1
- data/lib/rjack-solr/solr-core-4.0.0.jar +0 -0
- data/lib/rjack-solr/solr-solrj-4.0.0.jar +0 -0
- data/pom.xml +19 -6
- data/test/test_solr.rb +7 -5
- data/webapp/META-INF/LICENSE.txt +0 -940
- data/webapp/META-INF/MANIFEST.MF +5 -5
- data/webapp/META-INF/NOTICE.txt +160 -93
- data/webapp/WEB-INF/web.xml +57 -43
- data/webapp/admin.html +140 -0
- data/webapp/css/chosen.css +392 -0
- data/webapp/css/styles/analysis.css +293 -0
- data/webapp/css/styles/cloud.css +331 -0
- data/webapp/css/styles/common.css +593 -0
- data/webapp/css/styles/cores.css +203 -0
- data/webapp/css/styles/dashboard.css +127 -0
- data/webapp/css/styles/dataimport.css +222 -0
- data/webapp/css/styles/index.css +195 -0
- data/webapp/css/styles/java-properties.css +33 -0
- data/webapp/css/styles/logging.css +323 -0
- data/webapp/css/styles/menu.css +272 -0
- data/webapp/css/styles/plugins.css +175 -0
- data/webapp/css/styles/query.css +137 -0
- data/webapp/css/styles/replication.css +494 -0
- data/webapp/css/styles/schema-browser.css +476 -0
- data/webapp/css/styles/threads.css +153 -0
- data/webapp/img/ZeroClipboard.swf +0 -0
- data/webapp/img/chosen-sprite.png +0 -0
- data/webapp/img/div.gif +0 -0
- data/webapp/{admin → img}/favicon.ico +0 -0
- data/webapp/img/filetypes/7z.png +0 -0
- data/webapp/img/filetypes/README +27 -0
- data/webapp/img/filetypes/ai.png +0 -0
- data/webapp/img/filetypes/aiff.png +0 -0
- data/webapp/img/filetypes/asc.png +0 -0
- data/webapp/img/filetypes/audio.png +0 -0
- data/webapp/img/filetypes/bin.png +0 -0
- data/webapp/img/filetypes/bz2.png +0 -0
- data/webapp/img/filetypes/c.png +0 -0
- data/webapp/img/filetypes/cfc.png +0 -0
- data/webapp/img/filetypes/cfm.png +0 -0
- data/webapp/img/filetypes/chm.png +0 -0
- data/webapp/img/filetypes/class.png +0 -0
- data/webapp/img/filetypes/conf.png +0 -0
- data/webapp/img/filetypes/cpp.png +0 -0
- data/webapp/img/filetypes/cs.png +0 -0
- data/webapp/img/filetypes/css.png +0 -0
- data/webapp/img/filetypes/csv.png +0 -0
- data/webapp/img/filetypes/deb.png +0 -0
- data/webapp/img/filetypes/divx.png +0 -0
- data/webapp/img/filetypes/doc.png +0 -0
- data/webapp/img/filetypes/dot.png +0 -0
- data/webapp/img/filetypes/eml.png +0 -0
- data/webapp/img/filetypes/enc.png +0 -0
- data/webapp/img/filetypes/file.png +0 -0
- data/webapp/img/filetypes/gif.png +0 -0
- data/webapp/img/filetypes/gz.png +0 -0
- data/webapp/img/filetypes/hlp.png +0 -0
- data/webapp/img/filetypes/htm.png +0 -0
- data/webapp/img/filetypes/html.png +0 -0
- data/webapp/img/filetypes/image.png +0 -0
- data/webapp/img/filetypes/iso.png +0 -0
- data/webapp/img/filetypes/jar.png +0 -0
- data/webapp/img/filetypes/java.png +0 -0
- data/webapp/img/filetypes/jpeg.png +0 -0
- data/webapp/img/filetypes/jpg.png +0 -0
- data/webapp/img/filetypes/js.png +0 -0
- data/webapp/img/filetypes/lua.png +0 -0
- data/webapp/img/filetypes/m.png +0 -0
- data/webapp/img/filetypes/mm.png +0 -0
- data/webapp/img/filetypes/mov.png +0 -0
- data/webapp/img/filetypes/mp3.png +0 -0
- data/webapp/img/filetypes/mpg.png +0 -0
- data/webapp/img/filetypes/odc.png +0 -0
- data/webapp/img/filetypes/odf.png +0 -0
- data/webapp/img/filetypes/odg.png +0 -0
- data/webapp/img/filetypes/odi.png +0 -0
- data/webapp/img/filetypes/odp.png +0 -0
- data/webapp/img/filetypes/ods.png +0 -0
- data/webapp/img/filetypes/odt.png +0 -0
- data/webapp/img/filetypes/ogg.png +0 -0
- data/webapp/img/filetypes/pdf.png +0 -0
- data/webapp/img/filetypes/pgp.png +0 -0
- data/webapp/img/filetypes/php.png +0 -0
- data/webapp/img/filetypes/pl.png +0 -0
- data/webapp/img/filetypes/png.png +0 -0
- data/webapp/img/filetypes/ppt.png +0 -0
- data/webapp/img/filetypes/ps.png +0 -0
- data/webapp/img/filetypes/py.png +0 -0
- data/webapp/img/filetypes/ram.png +0 -0
- data/webapp/img/filetypes/rar.png +0 -0
- data/webapp/img/filetypes/rb.png +0 -0
- data/webapp/img/filetypes/rm.png +0 -0
- data/webapp/img/filetypes/rpm.png +0 -0
- data/webapp/img/filetypes/rtf.png +0 -0
- data/webapp/img/filetypes/sig.png +0 -0
- data/webapp/img/filetypes/sql.png +0 -0
- data/webapp/img/filetypes/swf.png +0 -0
- data/webapp/img/filetypes/sxc.png +0 -0
- data/webapp/img/filetypes/sxd.png +0 -0
- data/webapp/img/filetypes/sxi.png +0 -0
- data/webapp/img/filetypes/sxw.png +0 -0
- data/webapp/img/filetypes/tar.png +0 -0
- data/webapp/img/filetypes/tex.png +0 -0
- data/webapp/img/filetypes/tgz.png +0 -0
- data/webapp/img/filetypes/txt.png +0 -0
- data/webapp/img/filetypes/vcf.png +0 -0
- data/webapp/img/filetypes/video.png +0 -0
- data/webapp/img/filetypes/vsd.png +0 -0
- data/webapp/img/filetypes/wav.png +0 -0
- data/webapp/img/filetypes/wma.png +0 -0
- data/webapp/img/filetypes/wmv.png +0 -0
- data/webapp/img/filetypes/xls.png +0 -0
- data/webapp/img/filetypes/xml.png +0 -0
- data/webapp/img/filetypes/xpi.png +0 -0
- data/webapp/img/filetypes/xvid.png +0 -0
- data/webapp/img/filetypes/zip.png +0 -0
- data/webapp/img/ico/arrow-000-small.png +0 -0
- data/webapp/img/ico/arrow-circle.png +0 -0
- data/webapp/img/ico/arrow-switch.png +0 -0
- data/webapp/img/ico/asterisk.png +0 -0
- data/webapp/img/ico/battery.png +0 -0
- data/webapp/img/ico/block-small.png +0 -0
- data/webapp/img/ico/block.png +0 -0
- data/webapp/img/ico/book-open-text.png +0 -0
- data/webapp/img/ico/box.png +0 -0
- data/webapp/img/ico/bug.png +0 -0
- data/webapp/img/ico/chart.png +0 -0
- data/webapp/img/ico/chevron-small-expand.png +0 -0
- data/webapp/img/ico/chevron-small.png +0 -0
- data/webapp/img/ico/clipboard-list.png +0 -0
- data/webapp/img/ico/clipboard-paste-document-text.png +0 -0
- data/webapp/img/ico/clipboard-paste.png +0 -0
- data/webapp/img/ico/clock-select-remain.png +0 -0
- data/webapp/img/ico/clock-select.png +0 -0
- data/webapp/img/ico/construction.png +0 -0
- data/webapp/img/ico/cross-0.png +0 -0
- data/webapp/img/ico/cross-1.png +0 -0
- data/webapp/img/ico/cross.png +0 -0
- data/webapp/img/ico/dashboard.png +0 -0
- data/webapp/img/ico/database.png +0 -0
- data/webapp/img/ico/databases.png +0 -0
- data/webapp/img/ico/disk-black.png +0 -0
- data/webapp/img/ico/document-convert.png +0 -0
- data/webapp/img/ico/document-import.png +0 -0
- data/webapp/img/ico/document-list.png +0 -0
- data/webapp/img/ico/document-text.png +0 -0
- data/webapp/img/ico/download-cloud.png +0 -0
- data/webapp/img/ico/exclamation-button.png +0 -0
- data/webapp/img/ico/eye.png +0 -0
- data/webapp/img/ico/folder-export.png +0 -0
- data/webapp/img/ico/folder-tree.png +0 -0
- data/webapp/img/ico/folder.png +0 -0
- data/webapp/img/ico/funnel-small.png +0 -0
- data/webapp/img/ico/funnel.png +0 -0
- data/webapp/img/ico/gear.png +0 -0
- data/webapp/img/ico/globe-network.png +0 -0
- data/webapp/img/ico/globe.png +0 -0
- data/webapp/img/ico/hammer-screwdriver.png +0 -0
- data/webapp/img/ico/hand.png +0 -0
- data/webapp/img/ico/highlighter-text.png +0 -0
- data/webapp/img/ico/hourglass--exclamation.png +0 -0
- data/webapp/img/ico/hourglass.png +0 -0
- data/webapp/img/ico/inbox-document-text.png +0 -0
- data/webapp/img/ico/information-button.png +0 -0
- data/webapp/img/ico/information-small.png +0 -0
- data/webapp/img/ico/information-white.png +0 -0
- data/webapp/img/ico/information.png +0 -0
- data/webapp/img/ico/jar.png +0 -0
- data/webapp/img/ico/magnifier.png +0 -0
- data/webapp/img/ico/mail.png +0 -0
- data/webapp/img/ico/memory.png +0 -0
- data/webapp/img/ico/molecule.png +0 -0
- data/webapp/img/ico/network-cloud.png +0 -0
- data/webapp/img/ico/network-status-away.png +0 -0
- data/webapp/img/ico/network-status-busy.png +0 -0
- data/webapp/img/ico/network-status-offline.png +0 -0
- data/webapp/img/ico/network-status.png +0 -0
- data/webapp/img/ico/network.png +0 -0
- data/webapp/img/ico/node-design.png +0 -0
- data/webapp/img/ico/node-master.png +0 -0
- data/webapp/img/ico/node-select.png +0 -0
- data/webapp/img/ico/node-slave.png +0 -0
- data/webapp/img/ico/node.png +0 -0
- data/webapp/img/ico/pencil-small.png +0 -0
- data/webapp/img/ico/plus-button.png +0 -0
- data/webapp/img/ico/processor.png +0 -0
- data/webapp/img/ico/prohibition.png +0 -0
- data/webapp/img/ico/property.png +0 -0
- data/webapp/img/ico/question-small-white.png +0 -0
- data/webapp/img/ico/question-white.png +0 -0
- data/webapp/img/ico/question.png +0 -0
- data/webapp/img/ico/receipt-invoice.png +0 -0
- data/webapp/img/ico/receipt.png +0 -0
- data/webapp/img/ico/script-code.png +0 -0
- data/webapp/img/ico/server-cast.png +0 -0
- data/webapp/img/ico/server.png +0 -0
- data/webapp/img/ico/sitemap.png +0 -0
- data/webapp/img/ico/slash.png +0 -0
- data/webapp/img/ico/status-away.png +0 -0
- data/webapp/img/ico/status-busy.png +0 -0
- data/webapp/img/ico/status-offline.png +0 -0
- data/webapp/img/ico/status.png +0 -0
- data/webapp/img/ico/system-monitor--exclamation.png +0 -0
- data/webapp/img/ico/system-monitor.png +0 -0
- data/webapp/img/ico/table.png +0 -0
- data/webapp/img/ico/terminal.png +0 -0
- data/webapp/img/ico/tick-circle.png +0 -0
- data/webapp/img/ico/tick-red.png +0 -0
- data/webapp/img/ico/tick.png +0 -0
- data/webapp/img/ico/toggle-small-expand.png +0 -0
- data/webapp/img/ico/toggle-small.png +0 -0
- data/webapp/img/ico/toolbox.png +0 -0
- data/webapp/img/ico/ui-accordion.png +0 -0
- data/webapp/img/ico/ui-address-bar.png +0 -0
- data/webapp/img/ico/ui-check-box-uncheck.png +0 -0
- data/webapp/img/ico/ui-check-box.png +0 -0
- data/webapp/img/ico/ui-radio-button-uncheck.png +0 -0
- data/webapp/img/ico/ui-radio-button.png +0 -0
- data/webapp/img/ico/ui-text-field-select.png +0 -0
- data/webapp/img/ico/users.png +0 -0
- data/webapp/img/ico/wooden-box.png +0 -0
- data/webapp/img/ico/zone.png +0 -0
- data/webapp/img/loader-light.gif +0 -0
- data/webapp/img/loader.gif +0 -0
- data/webapp/img/lucene-ico.png +0 -0
- data/webapp/img/solr-ico.png +0 -0
- data/webapp/{admin/solr_small.png → img/solr.png} +0 -0
- data/webapp/img/tree.png +0 -0
- data/webapp/js/lib/ZeroClipboard.js +317 -0
- data/webapp/js/lib/chosen.js +953 -0
- data/webapp/{admin/get-properties.jsp → js/lib/console.js} +13 -10
- data/webapp/js/lib/d3.js +9342 -0
- data/webapp/js/lib/highlight.js +1 -0
- data/webapp/{admin/jquery-1.4.3.min.js → js/lib/jquery-1.7.2.min.js} +0 -0
- data/webapp/js/lib/jquery.blockUI.js +499 -0
- data/webapp/js/lib/jquery.cookie.js +47 -0
- data/webapp/js/lib/jquery.form.js +782 -0
- data/webapp/js/lib/jquery.jstree.js +3510 -0
- data/webapp/js/lib/jquery.sammy.js +1856 -0
- data/webapp/js/lib/jquery.sparkline.js +1271 -0
- data/webapp/js/lib/jquery.timeago.js +165 -0
- data/webapp/js/lib/linker.js +48 -0
- data/webapp/js/lib/order.js +189 -0
- data/webapp/js/main.js +57 -0
- data/webapp/js/require.js +11319 -0
- data/webapp/js/scripts/analysis.js +549 -0
- data/webapp/js/scripts/app.js +368 -0
- data/webapp/js/scripts/cloud.js +719 -0
- data/webapp/js/scripts/cores.js +540 -0
- data/webapp/js/scripts/dashboard.js +540 -0
- data/webapp/js/scripts/dataimport.js +567 -0
- data/webapp/js/scripts/file.js +56 -0
- data/webapp/js/scripts/index.js +344 -0
- data/webapp/js/scripts/java-properties.js +107 -0
- data/webapp/js/scripts/logging.js +519 -0
- data/webapp/js/scripts/ping.js +72 -0
- data/webapp/js/scripts/plugins.js +426 -0
- data/webapp/js/scripts/query.js +170 -0
- data/webapp/js/scripts/replication.js +557 -0
- data/webapp/js/scripts/schema-browser.js +1206 -0
- data/webapp/js/scripts/threads.js +159 -0
- data/webapp/tpl/analysis.html +83 -0
- data/webapp/tpl/cloud.html +54 -0
- data/webapp/tpl/cores.html +215 -0
- data/webapp/tpl/dashboard.html +164 -0
- data/webapp/tpl/dataimport.html +123 -0
- data/webapp/tpl/index.html +250 -0
- data/webapp/tpl/logging.html +23 -0
- data/webapp/tpl/plugins.html +39 -0
- data/webapp/tpl/query.html +318 -0
- data/webapp/tpl/replication.html +207 -0
- data/webapp/tpl/schema-browser.html +178 -0
- data/webapp/tpl/threads.html +56 -0
- metadata +307 -40
- data/lib/rjack-solr/solr-core-3.6.2.jar +0 -0
- data/lib/rjack-solr/solr-solrj-3.6.2.jar +0 -0
- data/webapp/admin/_info.jsp +0 -120
- data/webapp/admin/action.jsp +0 -94
- data/webapp/admin/analysis.jsp +0 -496
- data/webapp/admin/analysis.xsl +0 -179
- data/webapp/admin/dataimport.jsp +0 -53
- data/webapp/admin/debug.jsp +0 -103
- data/webapp/admin/distributiondump.jsp +0 -160
- data/webapp/admin/form.jsp +0 -152
- data/webapp/admin/get-file.jsp +0 -72
- data/webapp/admin/header.jsp +0 -44
- data/webapp/admin/index.jsp +0 -162
- data/webapp/admin/meta.xsl +0 -34
- data/webapp/admin/ping.jsp +0 -52
- data/webapp/admin/ping.xsl +0 -71
- data/webapp/admin/raw-schema.jsp +0 -38
- data/webapp/admin/registry.jsp +0 -107
- data/webapp/admin/registry.xsl +0 -321
- data/webapp/admin/replication/header.jsp +0 -89
- data/webapp/admin/replication/index.jsp +0 -378
- data/webapp/admin/schema.jsp +0 -690
- data/webapp/admin/solr-admin.css +0 -215
- data/webapp/admin/stats.jsp +0 -92
- data/webapp/admin/stats.xsl +0 -220
- data/webapp/admin/tabular.xsl +0 -141
- data/webapp/admin/threaddump.jsp +0 -110
- data/webapp/admin/threaddump.xsl +0 -103
- data/webapp/index.jsp +0 -49
data/webapp/admin/schema.jsp
DELETED
@@ -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"> </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>
|