simple_solr_client 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +349 -0
- data/Rakefile +11 -0
- data/lib/simple_solr.rb +42 -0
- data/lib/simple_solr/client.rb +139 -0
- data/lib/simple_solr/client/core_admin.rb +0 -0
- data/lib/simple_solr/core.rb +50 -0
- data/lib/simple_solr/core/admin.rb +47 -0
- data/lib/simple_solr/core/core_data.rb +51 -0
- data/lib/simple_solr/core/index.rb +25 -0
- data/lib/simple_solr/core/search.rb +21 -0
- data/lib/simple_solr/response/document.rb +45 -0
- data/lib/simple_solr/response/generic_response.rb +19 -0
- data/lib/simple_solr/response/query_response.rb +54 -0
- data/lib/simple_solr/schema.rb +261 -0
- data/lib/simple_solr/schema/analysis.rb +58 -0
- data/lib/simple_solr/schema/copyfield.rb +42 -0
- data/lib/simple_solr/schema/dynamic_field.rb +23 -0
- data/lib/simple_solr/schema/field.rb +35 -0
- data/lib/simple_solr/schema/field_or_type.rb +112 -0
- data/lib/simple_solr/schema/field_type.rb +62 -0
- data/lib/simple_solr/schema/matcher.rb +16 -0
- data/lib/simple_solr/version.rb +3 -0
- data/simple_solr_client.gemspec +39 -0
- data/solr_sample_core/conf/_schema_analysis_stopwords_english.json +38 -0
- data/solr_sample_core/conf/_schema_analysis_synonyms_english.json +11 -0
- data/solr_sample_core/conf/admin-extra.html +24 -0
- data/solr_sample_core/conf/admin-extra.menu-bottom.html +25 -0
- data/solr_sample_core/conf/admin-extra.menu-top.html +25 -0
- data/solr_sample_core/conf/clustering/carrot2/kmeans-attributes.xml +19 -0
- data/solr_sample_core/conf/clustering/carrot2/lingo-attributes.xml +24 -0
- data/solr_sample_core/conf/clustering/carrot2/stc-attributes.xml +19 -0
- data/solr_sample_core/conf/currency.xml +67 -0
- data/solr_sample_core/conf/elevate.xml +38 -0
- data/solr_sample_core/conf/lang/contractions_ca.txt +8 -0
- data/solr_sample_core/conf/lang/contractions_fr.txt +15 -0
- data/solr_sample_core/conf/lang/contractions_ga.txt +5 -0
- data/solr_sample_core/conf/lang/contractions_it.txt +23 -0
- data/solr_sample_core/conf/lang/hyphenations_ga.txt +5 -0
- data/solr_sample_core/conf/lang/stemdict_nl.txt +6 -0
- data/solr_sample_core/conf/lang/stoptags_ja.txt +420 -0
- data/solr_sample_core/conf/lang/stopwords_ar.txt +125 -0
- data/solr_sample_core/conf/lang/stopwords_bg.txt +193 -0
- data/solr_sample_core/conf/lang/stopwords_ca.txt +220 -0
- data/solr_sample_core/conf/lang/stopwords_ckb.txt +136 -0
- data/solr_sample_core/conf/lang/stopwords_cz.txt +172 -0
- data/solr_sample_core/conf/lang/stopwords_da.txt +110 -0
- data/solr_sample_core/conf/lang/stopwords_de.txt +294 -0
- data/solr_sample_core/conf/lang/stopwords_el.txt +78 -0
- data/solr_sample_core/conf/lang/stopwords_en.txt +54 -0
- data/solr_sample_core/conf/lang/stopwords_es.txt +356 -0
- data/solr_sample_core/conf/lang/stopwords_eu.txt +99 -0
- data/solr_sample_core/conf/lang/stopwords_fa.txt +313 -0
- data/solr_sample_core/conf/lang/stopwords_fi.txt +97 -0
- data/solr_sample_core/conf/lang/stopwords_fr.txt +186 -0
- data/solr_sample_core/conf/lang/stopwords_ga.txt +110 -0
- data/solr_sample_core/conf/lang/stopwords_gl.txt +161 -0
- data/solr_sample_core/conf/lang/stopwords_hi.txt +235 -0
- data/solr_sample_core/conf/lang/stopwords_hu.txt +211 -0
- data/solr_sample_core/conf/lang/stopwords_hy.txt +46 -0
- data/solr_sample_core/conf/lang/stopwords_id.txt +359 -0
- data/solr_sample_core/conf/lang/stopwords_it.txt +303 -0
- data/solr_sample_core/conf/lang/stopwords_ja.txt +127 -0
- data/solr_sample_core/conf/lang/stopwords_lv.txt +172 -0
- data/solr_sample_core/conf/lang/stopwords_nl.txt +119 -0
- data/solr_sample_core/conf/lang/stopwords_no.txt +194 -0
- data/solr_sample_core/conf/lang/stopwords_pt.txt +253 -0
- data/solr_sample_core/conf/lang/stopwords_ro.txt +233 -0
- data/solr_sample_core/conf/lang/stopwords_ru.txt +243 -0
- data/solr_sample_core/conf/lang/stopwords_sv.txt +133 -0
- data/solr_sample_core/conf/lang/stopwords_th.txt +119 -0
- data/solr_sample_core/conf/lang/stopwords_tr.txt +212 -0
- data/solr_sample_core/conf/lang/userdict_ja.txt +29 -0
- data/solr_sample_core/conf/mapping-FoldToASCII.txt +3813 -0
- data/solr_sample_core/conf/mapping-ISOLatin1Accent.txt +246 -0
- data/solr_sample_core/conf/protwords.txt +21 -0
- data/solr_sample_core/conf/schema.xml +62 -0
- data/solr_sample_core/conf/scripts.conf +24 -0
- data/solr_sample_core/conf/solrconfig.xml +1702 -0
- data/solr_sample_core/conf/spellings.txt +2 -0
- data/solr_sample_core/conf/stopwords.txt +14 -0
- data/solr_sample_core/conf/syn.txt +0 -0
- data/solr_sample_core/conf/synonyms.txt +29 -0
- data/solr_sample_core/conf/token_fixing_charfilter.txt +110 -0
- data/solr_sample_core/conf/update-script.js +53 -0
- data/solr_sample_core/conf/velocity/README.txt +101 -0
- data/solr_sample_core/conf/velocity/VM_global_library.vm +175 -0
- data/solr_sample_core/conf/velocity/browse.vm +33 -0
- data/solr_sample_core/conf/velocity/cluster.vm +19 -0
- data/solr_sample_core/conf/velocity/cluster_results.vm +31 -0
- data/solr_sample_core/conf/velocity/debug.vm +28 -0
- data/solr_sample_core/conf/velocity/did_you_mean.vm +9 -0
- data/solr_sample_core/conf/velocity/error.vm +11 -0
- data/solr_sample_core/conf/velocity/facet_fields.vm +23 -0
- data/solr_sample_core/conf/velocity/facet_pivot.vm +12 -0
- data/solr_sample_core/conf/velocity/facet_queries.vm +12 -0
- data/solr_sample_core/conf/velocity/facet_ranges.vm +23 -0
- data/solr_sample_core/conf/velocity/facets.vm +10 -0
- data/solr_sample_core/conf/velocity/footer.vm +43 -0
- data/solr_sample_core/conf/velocity/head.vm +35 -0
- data/solr_sample_core/conf/velocity/header.vm +7 -0
- data/solr_sample_core/conf/velocity/hit.vm +25 -0
- data/solr_sample_core/conf/velocity/hit_grouped.vm +43 -0
- data/solr_sample_core/conf/velocity/hit_plain.vm +25 -0
- data/solr_sample_core/conf/velocity/join_doc.vm +20 -0
- data/solr_sample_core/conf/velocity/jquery.autocomplete.css +48 -0
- data/solr_sample_core/conf/velocity/jquery.autocomplete.js +763 -0
- data/solr_sample_core/conf/velocity/layout.vm +24 -0
- data/solr_sample_core/conf/velocity/main.css +230 -0
- data/solr_sample_core/conf/velocity/mime_type_lists.vm +68 -0
- data/solr_sample_core/conf/velocity/pagination_bottom.vm +22 -0
- data/solr_sample_core/conf/velocity/pagination_top.vm +29 -0
- data/solr_sample_core/conf/velocity/product_doc.vm +32 -0
- data/solr_sample_core/conf/velocity/query.vm +42 -0
- data/solr_sample_core/conf/velocity/query_form.vm +64 -0
- data/solr_sample_core/conf/velocity/query_group.vm +43 -0
- data/solr_sample_core/conf/velocity/query_spatial.vm +75 -0
- data/solr_sample_core/conf/velocity/results_list.vm +22 -0
- data/solr_sample_core/conf/velocity/richtext_doc.vm +153 -0
- data/solr_sample_core/conf/velocity/suggest.vm +8 -0
- data/solr_sample_core/conf/velocity/tabs.vm +50 -0
- data/solr_sample_core/conf/xslt/example.xsl +132 -0
- data/solr_sample_core/conf/xslt/example_atom.xsl +67 -0
- data/solr_sample_core/conf/xslt/example_rss.xsl +66 -0
- data/solr_sample_core/conf/xslt/luke.xsl +337 -0
- data/solr_sample_core/conf/xslt/updateXml.xsl +70 -0
- data/spec/client_basics_spec.rb +26 -0
- data/spec/connect_spec.rb +25 -0
- data/spec/core_basics.rb +21 -0
- data/spec/index_spec.rb +31 -0
- data/spec/load_spec.rb +7 -0
- data/spec/minitest_helper.rb +36 -0
- data/spec/schema_spec.rb +113 -0
- metadata +284 -0
@@ -0,0 +1,24 @@
|
|
1
|
+
#**
|
2
|
+
* Overall HTML page layout
|
3
|
+
*#
|
4
|
+
|
5
|
+
<html>
|
6
|
+
<head>
|
7
|
+
#parse("head.vm")
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<div id="admin"><a href="#url_root/#/#core_name">Solr Admin</a></div>
|
11
|
+
<div id="header">
|
12
|
+
#parse("header.vm")
|
13
|
+
</div>
|
14
|
+
<div id="tabs">
|
15
|
+
#parse("tabs.vm")
|
16
|
+
</div>
|
17
|
+
<div id="content">
|
18
|
+
$content
|
19
|
+
</div>
|
20
|
+
<div id="footer">
|
21
|
+
#parse("footer.vm")
|
22
|
+
</div>
|
23
|
+
</body>
|
24
|
+
</html>
|
@@ -0,0 +1,230 @@
|
|
1
|
+
#admin{
|
2
|
+
text-align: right;
|
3
|
+
vertical-align: top;
|
4
|
+
}
|
5
|
+
|
6
|
+
#head{
|
7
|
+
width: 100%;
|
8
|
+
}
|
9
|
+
.array-field {
|
10
|
+
border: 2px solid #474747;
|
11
|
+
background: #FFE9D8;
|
12
|
+
padding: 5px;
|
13
|
+
margin: 5px;
|
14
|
+
}
|
15
|
+
|
16
|
+
.array-field-list li {
|
17
|
+
list-style: circle;
|
18
|
+
margin-left: 20px;
|
19
|
+
}
|
20
|
+
|
21
|
+
.parsed_query_header {
|
22
|
+
font-family: Helvetica, Arial, sans-serif;
|
23
|
+
font-size: 10pt;
|
24
|
+
font-weight: bold;
|
25
|
+
}
|
26
|
+
|
27
|
+
.parsed_query {
|
28
|
+
font-family: Courier, Courier New, monospaced;
|
29
|
+
font-size: 10pt;
|
30
|
+
font-weight: normal;
|
31
|
+
}
|
32
|
+
|
33
|
+
body {
|
34
|
+
font-family: Helvetica, Arial, sans-serif;
|
35
|
+
font-size: 10pt;
|
36
|
+
}
|
37
|
+
|
38
|
+
a {
|
39
|
+
color: #43a4b1;
|
40
|
+
}
|
41
|
+
|
42
|
+
.navigators {
|
43
|
+
float: left;
|
44
|
+
margin: 5px;
|
45
|
+
margin-top: 0px;
|
46
|
+
width: 185px;
|
47
|
+
padding: 5px;
|
48
|
+
top: -20px;
|
49
|
+
position: relative;
|
50
|
+
}
|
51
|
+
|
52
|
+
.tabs-bar {
|
53
|
+
padding: 5px;
|
54
|
+
width: 100%;
|
55
|
+
border: 1px solid;
|
56
|
+
border-width: 0px 0px 1px 0px;
|
57
|
+
}
|
58
|
+
.tab {
|
59
|
+
font-weight: bold;
|
60
|
+
padding: 5px;
|
61
|
+
margin: 0px 5px;
|
62
|
+
border: 1px solid;
|
63
|
+
background-color: #dddddd;
|
64
|
+
border-top-left-radius: 4px;
|
65
|
+
border-top-right-radius: 4px;
|
66
|
+
}
|
67
|
+
.tab:hover {
|
68
|
+
background: #FEC293;
|
69
|
+
}
|
70
|
+
.tab.selected {
|
71
|
+
background-color: #ffffff;
|
72
|
+
border-bottom: 1px solid #ffffff;
|
73
|
+
}
|
74
|
+
|
75
|
+
.navigators h2 {
|
76
|
+
background: #FEC293;
|
77
|
+
padding: 2px 5px;
|
78
|
+
}
|
79
|
+
|
80
|
+
.navigators ul {
|
81
|
+
list-style: none;
|
82
|
+
margin: 0;
|
83
|
+
margin-bottom: 5px;
|
84
|
+
margin-top: 5px;
|
85
|
+
padding-left: 10px;
|
86
|
+
}
|
87
|
+
|
88
|
+
.navigators ul li {
|
89
|
+
color: #999;
|
90
|
+
padding: 2px;
|
91
|
+
}
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
.facet-field {
|
96
|
+
font-weight: bold;
|
97
|
+
}
|
98
|
+
|
99
|
+
.highlight {
|
100
|
+
color: white;
|
101
|
+
background-color: gray;
|
102
|
+
border: 1px black solid;
|
103
|
+
}
|
104
|
+
|
105
|
+
.highlight-box {
|
106
|
+
margin-left: 15px;
|
107
|
+
}
|
108
|
+
|
109
|
+
.field-name {
|
110
|
+
font-weight: bold;
|
111
|
+
}
|
112
|
+
|
113
|
+
.highlighted-facet-field {
|
114
|
+
background: white;
|
115
|
+
}
|
116
|
+
|
117
|
+
.constraints {
|
118
|
+
margin-top: 10px;
|
119
|
+
}
|
120
|
+
|
121
|
+
#query-form{
|
122
|
+
width: 80%;
|
123
|
+
}
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
.query-box, .constraints {
|
128
|
+
padding: 5px;
|
129
|
+
margin: 5px;
|
130
|
+
font-weight: normal;
|
131
|
+
font-size: 24px;
|
132
|
+
letter-spacing: 0.08em;
|
133
|
+
}
|
134
|
+
|
135
|
+
.query-box #q {
|
136
|
+
margin-left: 8px;
|
137
|
+
width: 60%;
|
138
|
+
height: 50px;
|
139
|
+
border: 1px solid #999;
|
140
|
+
font-size: 1em;
|
141
|
+
padding: 0.4em;
|
142
|
+
}
|
143
|
+
|
144
|
+
.query-box {
|
145
|
+
|
146
|
+
}
|
147
|
+
|
148
|
+
.query-boost {
|
149
|
+
|
150
|
+
top: 10px;
|
151
|
+
left: 50px;
|
152
|
+
position: relative;
|
153
|
+
font-size: 0.8em;
|
154
|
+
}
|
155
|
+
|
156
|
+
.query-box .inputs{
|
157
|
+
left: 180px;
|
158
|
+
position: relative;
|
159
|
+
|
160
|
+
}
|
161
|
+
|
162
|
+
#logo {
|
163
|
+
margin: 10px;
|
164
|
+
border-style: none;
|
165
|
+
}
|
166
|
+
|
167
|
+
.pagination {
|
168
|
+
padding-left: 33%;
|
169
|
+
background: #eee;
|
170
|
+
margin: 5px;
|
171
|
+
margin-left: 210px;
|
172
|
+
padding-top: 5px;
|
173
|
+
padding-bottom: 5px;
|
174
|
+
}
|
175
|
+
|
176
|
+
.result-document {
|
177
|
+
border: 1px solid #999;
|
178
|
+
padding: 5px;
|
179
|
+
margin: 5px;
|
180
|
+
margin-left: 210px;
|
181
|
+
margin-bottom: 15px;
|
182
|
+
}
|
183
|
+
|
184
|
+
.result-document div{
|
185
|
+
padding: 5px;
|
186
|
+
}
|
187
|
+
|
188
|
+
.result-title{
|
189
|
+
width:60%;
|
190
|
+
}
|
191
|
+
|
192
|
+
.result-body{
|
193
|
+
background: #ddd;
|
194
|
+
}
|
195
|
+
|
196
|
+
.mlt{
|
197
|
+
|
198
|
+
}
|
199
|
+
|
200
|
+
.map{
|
201
|
+
float: right;
|
202
|
+
position: relative;
|
203
|
+
top: -25px;
|
204
|
+
}
|
205
|
+
|
206
|
+
.result-document:nth-child(2n+1) {
|
207
|
+
background-color: #eee;
|
208
|
+
}
|
209
|
+
|
210
|
+
|
211
|
+
.selected-facet-field {
|
212
|
+
font-weight: bold;
|
213
|
+
}
|
214
|
+
|
215
|
+
li.show {
|
216
|
+
list-style: disc;
|
217
|
+
}
|
218
|
+
|
219
|
+
.group-value{
|
220
|
+
font-weight: bold;
|
221
|
+
}
|
222
|
+
|
223
|
+
.error {
|
224
|
+
color: white;
|
225
|
+
background-color: red;
|
226
|
+
left: 210px;
|
227
|
+
width:80%;
|
228
|
+
position: relative;
|
229
|
+
|
230
|
+
}
|
@@ -0,0 +1,68 @@
|
|
1
|
+
#**
|
2
|
+
* Define some Mime-Types, short and long form
|
3
|
+
*#
|
4
|
+
|
5
|
+
## MimeType to extension map for detecting file type
|
6
|
+
## and showing proper icon
|
7
|
+
## List of types match the icons in /solr/img/filetypes
|
8
|
+
|
9
|
+
## Short MimeType Names
|
10
|
+
## Was called $supportedtypes
|
11
|
+
#set($supportedMimeTypes = "7z;ai;aiff;asc;audio;bin;bz2;c;cfc;cfm;chm;class;conf;cpp;cs;css;csv;deb;divx;doc;dot;eml;enc;file;gif;gz;hlp;htm;html;image;iso;jar;java;jpeg;jpg;js;lua;m;mm;mov;mp3;mpg;odc;odf;odg;odi;odp;ods;odt;ogg;pdf;pgp;php;pl;png;ppt;ps;py;ram;rar;rb;rm;rpm;rtf;sig;sql;swf;sxc;sxd;sxi;sxw;tar;tex;tgz;txt;vcf;video;vsd;wav;wma;wmv;xls;xml;xpi;xvid;zip")
|
12
|
+
|
13
|
+
## Long Form: map MimeType headers to our Short names
|
14
|
+
## Was called $extMap
|
15
|
+
#set( $mimeExtensionsMap = {
|
16
|
+
"application/x-7z-compressed": "7z",
|
17
|
+
"application/postscript": "ai",
|
18
|
+
"application/pgp-signature": "asc",
|
19
|
+
"application/octet-stream": "bin",
|
20
|
+
"application/x-bzip2": "bz2",
|
21
|
+
"text/x-c": "c",
|
22
|
+
"application/vnd.ms-htmlhelp": "chm",
|
23
|
+
"application/java-vm": "class",
|
24
|
+
"text/css": "css",
|
25
|
+
"text/csv": "csv",
|
26
|
+
"application/x-debian-package": "deb",
|
27
|
+
"application/msword": "doc",
|
28
|
+
"message/rfc822": "eml",
|
29
|
+
"image/gif": "gif",
|
30
|
+
"application/winhlp": "hlp",
|
31
|
+
"text/html": "html",
|
32
|
+
"application/java-archive": "jar",
|
33
|
+
"text/x-java-source": "java",
|
34
|
+
"image/jpeg": "jpeg",
|
35
|
+
"application/javascript": "js",
|
36
|
+
"application/vnd.oasis.opendocument.chart": "odc",
|
37
|
+
"application/vnd.oasis.opendocument.formula": "odf",
|
38
|
+
"application/vnd.oasis.opendocument.graphics": "odg",
|
39
|
+
"application/vnd.oasis.opendocument.image": "odi",
|
40
|
+
"application/vnd.oasis.opendocument.presentation": "odp",
|
41
|
+
"application/vnd.oasis.opendocument.spreadsheet": "ods",
|
42
|
+
"application/vnd.oasis.opendocument.text": "odt",
|
43
|
+
"application/pdf": "pdf",
|
44
|
+
"application/pgp-encrypted": "pgp",
|
45
|
+
"image/png": "png",
|
46
|
+
"application/vnd.ms-powerpoint": "ppt",
|
47
|
+
"audio/x-pn-realaudio": "ram",
|
48
|
+
"application/x-rar-compressed": "rar",
|
49
|
+
"application/vnd.rn-realmedia": "rm",
|
50
|
+
"application/rtf": "rtf",
|
51
|
+
"application/x-shockwave-flash": "swf",
|
52
|
+
"application/vnd.sun.xml.calc": "sxc",
|
53
|
+
"application/vnd.sun.xml.draw": "sxd",
|
54
|
+
"application/vnd.sun.xml.impress": "sxi",
|
55
|
+
"application/vnd.sun.xml.writer": "sxw",
|
56
|
+
"application/x-tar": "tar",
|
57
|
+
"application/x-tex": "tex",
|
58
|
+
"text/plain": "txt",
|
59
|
+
"text/x-vcard": "vcf",
|
60
|
+
"application/vnd.visio": "vsd",
|
61
|
+
"audio/x-wav": "wav",
|
62
|
+
"audio/x-ms-wma": "wma",
|
63
|
+
"video/x-ms-wmv": "wmv",
|
64
|
+
"application/vnd.ms-excel": "xls",
|
65
|
+
"application/xml": "xml",
|
66
|
+
"application/x-xpinstall": "xpi",
|
67
|
+
"application/zip": "zip"
|
68
|
+
})
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#**
|
2
|
+
* Paging and Statistics at bottom of results
|
3
|
+
*#
|
4
|
+
|
5
|
+
## Usually rendered in pagination div tag
|
6
|
+
|
7
|
+
#if($response.response.get('grouped'))
|
8
|
+
## pass
|
9
|
+
#else
|
10
|
+
|
11
|
+
#link_to_previous_page("previous")
|
12
|
+
|
13
|
+
<span class="results-found">$page.results_found</span>
|
14
|
+
results found.
|
15
|
+
|
16
|
+
Page <span class="page-num">$page.current_page_number</span>
|
17
|
+
of <span class="page-count">$page.page_count</span>
|
18
|
+
|
19
|
+
#link_to_next_page("next")
|
20
|
+
|
21
|
+
#end
|
22
|
+
<br/>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#**
|
2
|
+
* Paging and Statistics at top of results
|
3
|
+
*#
|
4
|
+
|
5
|
+
## Usually rendered in pagination div tag
|
6
|
+
|
7
|
+
## Grouped Results / Not Paginated
|
8
|
+
#if($response.response.get('grouped'))
|
9
|
+
|
10
|
+
<span>
|
11
|
+
<span class="results-found">
|
12
|
+
$response.response.get('grouped').size() group(s)
|
13
|
+
</span>
|
14
|
+
found in ${response.responseHeader.QTime} ms
|
15
|
+
</span>
|
16
|
+
|
17
|
+
## Regular Results / Use Paging Links if needed
|
18
|
+
#else
|
19
|
+
|
20
|
+
<span>
|
21
|
+
<span class="results-found">$page.results_found</span>
|
22
|
+
results found in
|
23
|
+
${response.responseHeader.QTime} ms
|
24
|
+
</span>
|
25
|
+
|
26
|
+
Page <span class="page-num">$page.current_page_number</span>
|
27
|
+
of <span class="page-count">$page.page_count</span>
|
28
|
+
|
29
|
+
#end ## end else non-grouped results, normal pagination
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#**
|
2
|
+
* Render a hit representing a Product
|
3
|
+
* assumed to have a field called "name"
|
4
|
+
*#
|
5
|
+
|
6
|
+
<div class="result-title"><b>#field('name')</b><span class="mlt"> #if($params.getBool('mlt', false) == false)<a href="#lensNoQ&q=id:$docId&mlt=true">More Like This</a>#end</span></div>
|
7
|
+
##do we have a physical store for this product
|
8
|
+
#set($store = $doc.getFieldValue('store'))
|
9
|
+
#if($store)<div class="map"><img src="http://maps.google.com/maps/api/staticmap?&zoom=12&size=150x80&maptype=roadmap&markers=$doc.getFieldValue('store')&sensor=false" /><div><small><a target="_map" href="http://maps.google.com/?q=$store&source=embed">Larger Map</a></small></div></div>#end
|
10
|
+
<div>Id: #field('id')</div>
|
11
|
+
<div>Price: #field('price_c')</div>
|
12
|
+
<div>Features: #field('features')</div>
|
13
|
+
<div>In Stock: #field('inStock')</div>
|
14
|
+
<div class="mlt">
|
15
|
+
#set($mlt = $mltResults.get($docId))
|
16
|
+
#set($mltOn = $params.getBool('mlt'))
|
17
|
+
#if($mltOn == true)<div class="field-name">Similar Items</div>#end
|
18
|
+
#if ($mltOn && $mlt && $mlt.size() > 0)
|
19
|
+
<ul>
|
20
|
+
#foreach($mltHit in $mlt)
|
21
|
+
#set($mltId = $mltHit.getFieldValue('id'))
|
22
|
+
<li><div><a href="#url_for_home?q=id:$mltId">$mltId</a></div><div><span class="field-name">Name:</span> $mltHit.getFieldValue('name')</div>
|
23
|
+
<div><span class="field-name">Price:</span> $!number.currency($mltHit.getFieldValue('price')) <span class="field-name">In Stock:</span> $mltHit.getFieldValue('inStock')</div>
|
24
|
+
|
25
|
+
</li>
|
26
|
+
#end
|
27
|
+
</ul>
|
28
|
+
#elseif($mltOn && $mlt.size() == 0)
|
29
|
+
<div>No Similar Items Found</div>
|
30
|
+
#end
|
31
|
+
</div>
|
32
|
+
#parse('debug.vm')
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<div class="query-box">
|
2
|
+
<form id="query-form" action="#{url_for_home}" method="GET">
|
3
|
+
<div class="inputs">
|
4
|
+
<span #annTitle("Add the query using the &q= parameter")>Find: <input type="text" id="q" name="q" value="$!esc.html($params.get('q'))"/> <input type="submit" id="querySubmit"/> <input type="reset"/></span>
|
5
|
+
<div class="query-boost"><span #annTitle("Add the boost function &bf=price to the query")><input type="checkbox" name="bf" value="price" #if($request.params.get('bf') == 'price')checked="true"#end>Boost by Price</input></span>
|
6
|
+
#parse("querySpatial.vm")
|
7
|
+
#parse("queryGroup.vm")
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
#if($request.params.get('debugQuery'))
|
12
|
+
<input type="hidden" name="debugQuery" value="true"/>
|
13
|
+
#end
|
14
|
+
#if($annotate == true)
|
15
|
+
<input type="hidden" name="annotateBrowse" value="true"/>
|
16
|
+
#end
|
17
|
+
#foreach($fq in $request.params.getParams('fq'))
|
18
|
+
#if ($fq != "{!bbox}")
|
19
|
+
<input type="hidden" name="fq" id="allFQs" value="$esc.html($fq)"/>
|
20
|
+
#end
|
21
|
+
#end
|
22
|
+
<div class="constraints" #annTitle("Lists out the &fq filters. Click to remove.")>
|
23
|
+
#foreach($fq in $params.getParams('fq'))
|
24
|
+
#set($previous_fq_count=$velocityCount - 1)
|
25
|
+
#if($fq != '')
|
26
|
+
> <a style="{text-decoration: line-through;}" href="#url_for_filters($request.params.getParams('fq').subList(0,$previous_fq_count))">$fq</a>
|
27
|
+
#end
|
28
|
+
#end
|
29
|
+
</div>
|
30
|
+
<div class="parsed_query_header">
|
31
|
+
#if($request.params.get('debugQuery'))
|
32
|
+
<a href="#" onclick='jQuery(this).siblings("div").toggle(); return false;'>toggle parsed query</a>
|
33
|
+
<div class="parsed_query" style="display:none">$response.response.debug.parsedquery</div>
|
34
|
+
#end
|
35
|
+
#set($queryOpts = $request.params.get("queryOpts"))
|
36
|
+
#if($queryOpts && $queryOpts != "")
|
37
|
+
<input type="hidden" name="queryOpts" value="$queryOpts"/>
|
38
|
+
#end
|
39
|
+
</div>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
</div>
|