rere 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. data/.classpath +260 -0
  2. data/.gitignore +28 -0
  3. data/.project +14 -0
  4. data/.ruby-version +1 -0
  5. data/.settings/org.eclim.prefs +3 -0
  6. data/.settings/org.eclipse.jdt.core.prefs +5 -0
  7. data/.settings/org.eclipse.jdt.ui.prefs +2 -0
  8. data/Gemfile +7 -0
  9. data/LICENSE +22 -0
  10. data/README.md +44 -0
  11. data/Rakefile +65 -0
  12. data/bin/solr +61 -0
  13. data/example/config/solr.yml +23 -0
  14. data/example/log/.gitkeep +0 -0
  15. data/example/solr/README.txt +63 -0
  16. data/example/solr/collection1/README.txt +50 -0
  17. data/example/solr/collection1/conf/admin-extra.html +24 -0
  18. data/example/solr/collection1/conf/admin-extra.menu-bottom.html +25 -0
  19. data/example/solr/collection1/conf/admin-extra.menu-top.html +25 -0
  20. data/example/solr/collection1/conf/currency.xml +67 -0
  21. data/example/solr/collection1/conf/elevate.xml +38 -0
  22. data/example/solr/collection1/conf/lang/contractions_ca.txt +8 -0
  23. data/example/solr/collection1/conf/lang/contractions_fr.txt +15 -0
  24. data/example/solr/collection1/conf/lang/contractions_ga.txt +5 -0
  25. data/example/solr/collection1/conf/lang/contractions_it.txt +23 -0
  26. data/example/solr/collection1/conf/lang/hyphenations_ga.txt +5 -0
  27. data/example/solr/collection1/conf/lang/stemdict_nl.txt +6 -0
  28. data/example/solr/collection1/conf/lang/stoptags_ja.txt +420 -0
  29. data/example/solr/collection1/conf/lang/stopwords_ar.txt +125 -0
  30. data/example/solr/collection1/conf/lang/stopwords_bg.txt +193 -0
  31. data/example/solr/collection1/conf/lang/stopwords_ca.txt +220 -0
  32. data/example/solr/collection1/conf/lang/stopwords_cz.txt +172 -0
  33. data/example/solr/collection1/conf/lang/stopwords_da.txt +108 -0
  34. data/example/solr/collection1/conf/lang/stopwords_de.txt +292 -0
  35. data/example/solr/collection1/conf/lang/stopwords_el.txt +78 -0
  36. data/example/solr/collection1/conf/lang/stopwords_en.txt +54 -0
  37. data/example/solr/collection1/conf/lang/stopwords_es.txt +354 -0
  38. data/example/solr/collection1/conf/lang/stopwords_eu.txt +99 -0
  39. data/example/solr/collection1/conf/lang/stopwords_fa.txt +313 -0
  40. data/example/solr/collection1/conf/lang/stopwords_fi.txt +95 -0
  41. data/example/solr/collection1/conf/lang/stopwords_fr.txt +184 -0
  42. data/example/solr/collection1/conf/lang/stopwords_ga.txt +110 -0
  43. data/example/solr/collection1/conf/lang/stopwords_gl.txt +161 -0
  44. data/example/solr/collection1/conf/lang/stopwords_hi.txt +235 -0
  45. data/example/solr/collection1/conf/lang/stopwords_hu.txt +209 -0
  46. data/example/solr/collection1/conf/lang/stopwords_hy.txt +46 -0
  47. data/example/solr/collection1/conf/lang/stopwords_id.txt +359 -0
  48. data/example/solr/collection1/conf/lang/stopwords_it.txt +301 -0
  49. data/example/solr/collection1/conf/lang/stopwords_ja.txt +127 -0
  50. data/example/solr/collection1/conf/lang/stopwords_lv.txt +172 -0
  51. data/example/solr/collection1/conf/lang/stopwords_nl.txt +117 -0
  52. data/example/solr/collection1/conf/lang/stopwords_no.txt +192 -0
  53. data/example/solr/collection1/conf/lang/stopwords_pt.txt +251 -0
  54. data/example/solr/collection1/conf/lang/stopwords_ro.txt +233 -0
  55. data/example/solr/collection1/conf/lang/stopwords_ru.txt +241 -0
  56. data/example/solr/collection1/conf/lang/stopwords_sv.txt +131 -0
  57. data/example/solr/collection1/conf/lang/stopwords_th.txt +119 -0
  58. data/example/solr/collection1/conf/lang/stopwords_tr.txt +212 -0
  59. data/example/solr/collection1/conf/lang/userdict_ja.txt +29 -0
  60. data/example/solr/collection1/conf/mapping-FoldToASCII.txt +3813 -0
  61. data/example/solr/collection1/conf/mapping-ISOLatin1Accent.txt +246 -0
  62. data/example/solr/collection1/conf/protwords.txt +21 -0
  63. data/example/solr/collection1/conf/schema.xml +1125 -0
  64. data/example/solr/collection1/conf/scripts.conf +24 -0
  65. data/example/solr/collection1/conf/solrconfig.xml +1816 -0
  66. data/example/solr/collection1/conf/spellings.txt +2 -0
  67. data/example/solr/collection1/conf/stopwords.txt +14 -0
  68. data/example/solr/collection1/conf/synonyms.txt +29 -0
  69. data/example/solr/collection1/conf/update-script.js +53 -0
  70. data/example/solr/collection1/conf/velocity/VM_global_library.vm +170 -0
  71. data/example/solr/collection1/conf/velocity/browse.vm +50 -0
  72. data/example/solr/collection1/conf/velocity/cluster.vm +9 -0
  73. data/example/solr/collection1/conf/velocity/clusterResults.vm +12 -0
  74. data/example/solr/collection1/conf/velocity/debug.vm +17 -0
  75. data/example/solr/collection1/conf/velocity/did_you_mean.vm +4 -0
  76. data/example/solr/collection1/conf/velocity/facet_fields.vm +15 -0
  77. data/example/solr/collection1/conf/velocity/facet_pivot.vm +3 -0
  78. data/example/solr/collection1/conf/velocity/facet_queries.vm +3 -0
  79. data/example/solr/collection1/conf/velocity/facet_ranges.vm +15 -0
  80. data/example/solr/collection1/conf/velocity/facets.vm +5 -0
  81. data/example/solr/collection1/conf/velocity/footer.vm +17 -0
  82. data/example/solr/collection1/conf/velocity/head.vm +32 -0
  83. data/example/solr/collection1/conf/velocity/header.vm +3 -0
  84. data/example/solr/collection1/conf/velocity/hit.vm +11 -0
  85. data/example/solr/collection1/conf/velocity/hitGrouped.vm +24 -0
  86. data/example/solr/collection1/conf/velocity/join-doc.vm +4 -0
  87. data/example/solr/collection1/conf/velocity/jquery.autocomplete.css +48 -0
  88. data/example/solr/collection1/conf/velocity/jquery.autocomplete.js +763 -0
  89. data/example/solr/collection1/conf/velocity/layout.vm +20 -0
  90. data/example/solr/collection1/conf/velocity/main.css +208 -0
  91. data/example/solr/collection1/conf/velocity/product-doc.vm +27 -0
  92. data/example/solr/collection1/conf/velocity/query.vm +42 -0
  93. data/example/solr/collection1/conf/velocity/queryGroup.vm +19 -0
  94. data/example/solr/collection1/conf/velocity/querySpatial.vm +40 -0
  95. data/example/solr/collection1/conf/velocity/richtext-doc.vm +114 -0
  96. data/example/solr/collection1/conf/velocity/suggest.vm +3 -0
  97. data/example/solr/collection1/conf/velocity/tabs.vm +6 -0
  98. data/example/solr/collection1/conf/xslt/example.xsl +132 -0
  99. data/example/solr/collection1/conf/xslt/example_atom.xsl +67 -0
  100. data/example/solr/collection1/conf/xslt/example_rss.xsl +66 -0
  101. data/example/solr/collection1/conf/xslt/luke.xsl +337 -0
  102. data/example/solr/collection1/conf/xslt/updateXml.xsl +70 -0
  103. data/example/solr/collection1/data/index/segments.gen +0 -0
  104. data/example/solr/collection1/data/index/segments_1 +0 -0
  105. data/example/solr/data/development/index/segments.gen +0 -0
  106. data/example/solr/data/development/index/segments_1 +0 -0
  107. data/example/solr/solr.xml +53 -0
  108. data/example/solr/zoo.cfg +17 -0
  109. data/lib/rere.rb +66 -0
  110. data/lib/rere/railtie.rb +8 -0
  111. data/lib/rere/server.rb +380 -0
  112. data/lib/rere/tasks/solr.rake +47 -0
  113. data/lib/rere/version.rb +3 -0
  114. data/pom.xml +168 -0
  115. data/rere.gemspec +26 -0
  116. data/server/README.txt +78 -0
  117. data/server/cloud-scripts/zkcli.bat +12 -0
  118. data/server/cloud-scripts/zkcli.sh +14 -0
  119. data/server/contexts/solr-jetty-context.xml +8 -0
  120. data/server/etc/create-solrtest.keystore.sh +37 -0
  121. data/server/etc/jetty.xml +205 -0
  122. data/server/etc/logging.properties +38 -0
  123. data/server/etc/solrtest.keystore +0 -0
  124. data/server/etc/webdefault.xml +527 -0
  125. data/server/exampledocs/books.csv +11 -0
  126. data/server/exampledocs/books.json +51 -0
  127. data/server/exampledocs/gb18030-example.xml +32 -0
  128. data/server/exampledocs/hd.xml +56 -0
  129. data/server/exampledocs/ipod_other.xml +60 -0
  130. data/server/exampledocs/ipod_video.xml +40 -0
  131. data/server/exampledocs/manufacturers.xml +75 -0
  132. data/server/exampledocs/mem.xml +77 -0
  133. data/server/exampledocs/money.xml +65 -0
  134. data/server/exampledocs/monitor.xml +35 -0
  135. data/server/exampledocs/monitor2.xml +34 -0
  136. data/server/exampledocs/mp500.xml +43 -0
  137. data/server/exampledocs/post.jar +0 -0
  138. data/server/exampledocs/post.sh +30 -0
  139. data/server/exampledocs/sd500.xml +38 -0
  140. data/server/exampledocs/solr.xml +38 -0
  141. data/server/exampledocs/test_utf8.sh +93 -0
  142. data/server/exampledocs/utf8-example.xml +42 -0
  143. data/server/exampledocs/vidcard.xml +62 -0
  144. data/server/lib/ext/jcl-over-slf4j-1.6.6.jar +0 -0
  145. data/server/lib/ext/jul-to-slf4j-1.6.6.jar +0 -0
  146. data/server/lib/ext/log4j-1.2.16.jar +0 -0
  147. data/server/lib/ext/slf4j-api-1.6.6.jar +0 -0
  148. data/server/lib/ext/slf4j-log4j12-1.6.6.jar +0 -0
  149. data/server/lib/jetty-continuation-8.1.8.v20121106.jar +0 -0
  150. data/server/lib/jetty-deploy-8.1.8.v20121106.jar +0 -0
  151. data/server/lib/jetty-http-8.1.8.v20121106.jar +0 -0
  152. data/server/lib/jetty-io-8.1.8.v20121106.jar +0 -0
  153. data/server/lib/jetty-jmx-8.1.8.v20121106.jar +0 -0
  154. data/server/lib/jetty-security-8.1.8.v20121106.jar +0 -0
  155. data/server/lib/jetty-server-8.1.8.v20121106.jar +0 -0
  156. data/server/lib/jetty-servlet-8.1.8.v20121106.jar +0 -0
  157. data/server/lib/jetty-util-8.1.8.v20121106.jar +0 -0
  158. data/server/lib/jetty-webapp-8.1.8.v20121106.jar +0 -0
  159. data/server/lib/jetty-xml-8.1.8.v20121106.jar +0 -0
  160. data/server/lib/servlet-api-3.0.jar +0 -0
  161. data/server/resources/log4j.properties +19 -0
  162. data/server/solr/README.txt +63 -0
  163. data/server/solr/solr.xml +53 -0
  164. data/server/solr/zoo.cfg +17 -0
  165. data/server/start.jar +0 -0
  166. data/server/webapps/solr.war +0 -0
  167. data/solr/lib/solr-winds-0.1.jar +0 -0
  168. metadata +284 -0
@@ -0,0 +1,2 @@
1
+ pizza
2
+ history
@@ -0,0 +1,14 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright ownership.
4
+ # The ASF licenses this file to You under the Apache License, Version 2.0
5
+ # (the "License"); you may not use this file except in compliance with
6
+ # the License. You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
@@ -0,0 +1,29 @@
1
+ # The ASF licenses this file to You under the Apache License, Version 2.0
2
+ # (the "License"); you may not use this file except in compliance with
3
+ # the License. You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+
13
+ #-----------------------------------------------------------------------
14
+ #some test synonym mappings unlikely to appear in real input text
15
+ aaafoo => aaabar
16
+ bbbfoo => bbbfoo bbbbar
17
+ cccfoo => cccbar cccbaz
18
+ fooaaa,baraaa,bazaaa
19
+
20
+ # Some synonym groups specific to this example
21
+ GB,gib,gigabyte,gigabytes
22
+ MB,mib,megabyte,megabytes
23
+ Television, Televisions, TV, TVs
24
+ #notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming
25
+ #after us won't split it into two words.
26
+
27
+ # Synonym mappings can be used for spelling correction too
28
+ pixima => pixma
29
+
@@ -0,0 +1,53 @@
1
+ /*
2
+ This is a basic skeleton JavaScript update processor.
3
+
4
+ In order for this to be executed, it must be properly wired into solrconfig.xml; by default it is commented out in
5
+ the example solrconfig.xml and must be uncommented to be enabled.
6
+
7
+ See http://wiki.apache.org/solr/ScriptUpdateProcessor for more details.
8
+ */
9
+
10
+ function processAdd(cmd) {
11
+
12
+ doc = cmd.solrDoc; // org.apache.solr.common.SolrInputDocument
13
+ id = doc.getFieldValue("id");
14
+ logger.info("update-script#processAdd: id=" + id);
15
+
16
+ // Set a field value:
17
+ // doc.setField("foo_s", "whatever");
18
+
19
+ // Get a configuration parameter:
20
+ // config_param = params.get('config_param'); // "params" only exists if processor configured with <lst name="params">
21
+
22
+ // Get a request parameter:
23
+ // some_param = req.getParams().get("some_param")
24
+
25
+ // Add a field of field names that match a pattern:
26
+ // - Potentially useful to determine the fields/attributes represented in a result set, via faceting on field_name_ss
27
+ // field_names = doc.getFieldNames().toArray();
28
+ // for(i=0; i < field_names.length; i++) {
29
+ // field_name = field_names[i];
30
+ // if (/attr_.*/.test(field_name)) { doc.addField("attribute_ss", field_names[i]); }
31
+ // }
32
+
33
+ }
34
+
35
+ function processDelete(cmd) {
36
+ // no-op
37
+ }
38
+
39
+ function processMergeIndexes(cmd) {
40
+ // no-op
41
+ }
42
+
43
+ function processCommit(cmd) {
44
+ // no-op
45
+ }
46
+
47
+ function processRollback(cmd) {
48
+ // no-op
49
+ }
50
+
51
+ function finish() {
52
+ // no-op
53
+ }
@@ -0,0 +1,170 @@
1
+
2
+ #macro(param $key)$request.params.get($key)#end
3
+
4
+ #macro(url_root)/solr#end
5
+
6
+ ## TODO: s/url_for_solr/url_for_core/ and s/url_root/url_for_solr/
7
+ #macro(core_name)$request.core.name#end
8
+ #macro(url_for_solr)#{url_root}#if($request.core.name != "")/$request.core.name#end#end
9
+ #macro(url_for_home)#url_for_solr/browse#end
10
+
11
+ #macro(q)&q=$!{esc.url($params.get('q'))}#end
12
+
13
+ #macro(fqs $p)#foreach($fq in $p)#if($velocityCount>1)&#{end}fq=$esc.url($fq)#end#end
14
+
15
+ #macro(debug)#if($request.params.get('debugQuery'))&debugQuery=true#end#end
16
+
17
+ #macro(boostPrice)#if($request.params.get('bf') == 'price')&bf=price#end#end
18
+
19
+ #macro(annotate)#if($request.params.get('annotateBrowse'))&annotateBrowse=true#end#end
20
+
21
+ #macro(annTitle $msg)#if($annotate == true)title="$msg"#end#end
22
+
23
+ #macro(spatial)#if($request.params.get('sfield'))&sfield=store#end#if($request.params.get('pt'))&pt=$request.params.get('pt')#end#if($request.params.get('d'))&d=$request.params.get('d')#end#end
24
+
25
+ #macro(qOpts)#set($queryOpts = $request.params.get("queryOpts"))#if($queryOpts && $queryOpts != "")&queryOpts=$queryOpts#end#end
26
+
27
+ #macro(group)#if($request.params.getBool("group") == true)&group=true#end#if($request.params.get("group.field"))#foreach($grp in $request.params.getParams('group.field'))&group.field=$grp#end#end#end
28
+
29
+ #macro(sort $p)#if($p)#foreach($s in $p)&sort=$esc.url($s)#end#end#end
30
+
31
+ #macro(lensNoQ)?#if($request.params.getParams('fq') and $list.size($request.params.getParams('fq')) > 0)&#fqs($request.params.getParams('fq'))#end#sort($request.params.getParams('sort'))#debug#boostPrice#annotate#spatial#qOpts#group#end
32
+ #macro(lens)#lensNoQ#q#end
33
+
34
+
35
+ #macro(url_for_lens)#{url_for_home}#lens#end
36
+
37
+ #macro(url_for_start $start)#url_for_home#lens&start=$start#end
38
+
39
+ #macro(url_for_filters $p)#url_for_home?#q#boostPrice#spatial#qOpts#if($list.size($p) > 0)&#fqs($p)#end#debug#end
40
+
41
+ #macro(url_for_nested_facet_query $field)#url_for_home#lens&fq=$esc.url($field)#end
42
+
43
+ ## TODO: convert to use {!raw f=$field}$value (with escaping of course)
44
+ #macro(url_for_facet_filter $field $value)#url_for_home#lens&fq=$esc.url($field):%22$esc.url($value)%22#end
45
+
46
+ #macro(url_for_facet_date_filter $field $value)#url_for_home#lens&fq=$esc.url($field):$esc.url($value)#end
47
+
48
+ #macro(url_for_facet_range_filter $field $value)#url_for_home#lens&fq=$esc.url($field):$esc.url($value)#end
49
+
50
+
51
+ #macro(link_to_previous_page $text)
52
+ #if($page.current_page_number > 1)
53
+ #set($prev_start = $page.start - $page.results_per_page)
54
+ <a class="prev-page" href="#url_for_start($prev_start)">$text</a>
55
+ #end
56
+ #end
57
+
58
+ #macro(link_to_next_page $text)
59
+ #if($page.current_page_number < $page.page_count)
60
+ #set($next_start = $page.start + $page.results_per_page)
61
+ <a class="next-page" href="#url_for_start($next_start)">$text</a>
62
+ #end
63
+ #end
64
+
65
+ #macro(link_to_page $page_number $text)
66
+ #if($page_number == $page.current_page_number)
67
+ $text
68
+ #else
69
+ #if($page_number <= $page.page_count)
70
+ #set($page_start = $page_number * $page.results_per_page - $page.results_per_page)
71
+ <a class="page" href="#url_for_start($page_start)">$text</a>
72
+ #end
73
+ #end
74
+ #end
75
+
76
+ #macro(display_facet_query $field, $display, $fieldName)
77
+ #if($field.size() > 0)
78
+ <span class="facet-field">$display</span>
79
+ <ul>
80
+ #foreach ($facet in $field)
81
+ #if ($facet.value > 0)
82
+ #set($facetURL = "#url_for_nested_facet_query($facet.key)")
83
+ #if ($facetURL != '')
84
+ <li><a href="$facetURL">$facet.key</a> ($facet.value)</li>
85
+ #end
86
+ #end
87
+ #end
88
+ </ul>
89
+ #end
90
+ #end
91
+
92
+
93
+ #macro(display_facet_range $field, $display, $fieldName, $start, $end, $gap, $before, $after)
94
+ <span class="facet-field">$display</span>
95
+ <ul>
96
+ #if($before && $before != "")
97
+ #set($value = "[* TO " + "#format_value($start)" + "}")
98
+ #set($facetURL = "#url_for_facet_range_filter($fieldName, $value)")
99
+ <li><a href="$facetURL">Less than #format_value($start)</a> ($before)</li>
100
+ #end
101
+ #foreach ($facet in $field)
102
+ #set($rangeEnd = "#range_get_to_value($facet.key, $gap)")
103
+ #set($value = "[" + $facet.key + " TO " + $rangeEnd + "}")
104
+ #set($facetURL = "#url_for_facet_range_filter($fieldName, $value)")
105
+ #if ($facetURL != '')
106
+ <li><a href="$facetURL">$facet.key - #format_value($rangeEnd)</a> ($facet.value)</li>
107
+ #end
108
+ #end
109
+ #if($end && $end != "" && $after > 0)
110
+ #set($value = "[" + "#format_value($end)" + " TO *}")
111
+ #set($facetURL = "#url_for_facet_range_filter($fieldName, $value)")
112
+ <li><a href="$facetURL">More than #format_value($end)</a> ($after)</li>
113
+ #end
114
+ </ul>
115
+ #end
116
+
117
+ ## $pivots is a list of facet_pivot
118
+ #macro(display_facet_pivot $pivots, $display)
119
+ #if($pivots.size() > 0)
120
+ <span class="facet-field">$display</span>
121
+ <ul>
122
+ #foreach ($pivot in $pivots)
123
+ #foreach ($entry in $pivot.value)
124
+ <a href="#url_for_facet_filter($entry.field, $entry.value)">$entry.field::$entry.value</a> ($entry.count)
125
+ <ul>
126
+ #foreach($nest in $entry.pivot)
127
+ <a href="#url_for_facet_filter($entry.field, $entry.value)&fq=$esc.url($nest.field):%22$esc.url($nest.value)%22">$nest.field::$nest.value</a> ($nest.count)
128
+ #end
129
+ </ul>
130
+ #end
131
+ #end
132
+ </ul>
133
+ #end
134
+ #end
135
+
136
+ #macro(field $f)
137
+ #if($response.response.highlighting.get($docId).get($f).get(0))
138
+ #set($pad = "")
139
+ #foreach($v in $response.response.highlighting.get($docId).get($f))
140
+ $pad$v##
141
+ #set($pad = " ... ")
142
+ #end
143
+ #else
144
+ #foreach($v in $doc.getFieldValues($f))
145
+ $v##
146
+ #end
147
+ #end
148
+ #end
149
+
150
+ #macro(utc_date $theDate)
151
+ $date.format("yyyy-MM-dd'T'HH:mm:ss'Z'",$theDate,$date.getLocale(),$date.getTimeZone().getTimeZone("UTC"))##
152
+ #end
153
+
154
+ #macro(format_value $val)
155
+ #if(${val.class.name} == "java.util.Date")
156
+ #utc_date($val)##
157
+ #else
158
+ $val##
159
+ #end
160
+ #end
161
+
162
+ #macro(range_get_to_value $inval, $gapval)
163
+ #if(${gapval.class.name} == "java.lang.String")
164
+ $inval$gapval##
165
+ #elseif(${gapval.class.name} == "java.lang.Float" || ${inval.class.name} == "java.lang.Float")
166
+ $math.toDouble($math.add($inval,$gapval))##
167
+ #else
168
+ $math.add($inval,$gapval)##
169
+ #end
170
+ #end
@@ -0,0 +1,50 @@
1
+ #set($searcher=$request.searcher)
2
+ #set($params=$request.params)
3
+ #set($clusters = $response.response.clusters)
4
+ #set($mltResults = $response.response.get("moreLikeThis"))
5
+ #set($annotate = $params.get("annotateBrowse"))
6
+ #parse('query.vm')
7
+ #parse('did_you_mean.vm')
8
+
9
+ <div class="navigators">
10
+ #parse("facets.vm")
11
+ </div>
12
+
13
+ <div class="pagination">
14
+ #if($response.response.get('grouped'))
15
+ <span><span class="results-found">$response.response.get('grouped').size() group(s)</span> found in ${response.responseHeader.QTime} ms</span>
16
+ #else<span><span class="results-found">$page.results_found</span> results found in ${response.responseHeader.QTime} ms</span>
17
+ Page <span class="page-num">$page.current_page_number</span> of <span
18
+ class="page-count">$page.page_count</span>#end
19
+ </div>
20
+
21
+ <div class="error">
22
+ #if(${response.response.error.code})
23
+ <h1>ERROR ${response.response.error.code}</h1>
24
+ ${response.response.error.msg}
25
+ #end
26
+ </div>
27
+
28
+ <div class="results">
29
+ #if($response.response.get('grouped'))
30
+ #foreach($grouping in $response.response.get('grouped'))
31
+ #parse("hitGrouped.vm")
32
+ #end
33
+ #else
34
+ #foreach($doc in $response.results)
35
+ #parse("hit.vm")
36
+ #end
37
+ #end
38
+ </div>
39
+
40
+ <div class="pagination">
41
+ #if($response.response.get('grouped'))
42
+ #else
43
+ #link_to_previous_page("previous")
44
+ <span class="results-found">$page.results_found</span> results found.
45
+ Page <span class="page-num">$page.current_page_number</span> of <span
46
+ class="page-count">$page.page_count</span>
47
+ #link_to_next_page("next")
48
+ #end
49
+ <br/>
50
+ </div>
@@ -0,0 +1,9 @@
1
+ <h2 #annTitle("Clusters generated by Carrot2 using the /clustering RequestHandler")>Clusters</h2>
2
+ <div id="clusters">
3
+ Run Solr with java -Dsolr.clustering.enabled=true -jar start.jar to see results
4
+ </div>
5
+ <script type="text/javascript">
6
+
7
+ $('#clusters').load("#url_for_solr/clustering#lens",
8
+ {'wt':'velocity', 'v.template':"clusterResults"});
9
+ </script>
@@ -0,0 +1,12 @@
1
+ #foreach ($clusters in $response.response.clusters)
2
+ #set($labels = $clusters.get('labels'))
3
+ #set($docs = $clusters.get('docs'))
4
+ <h3>#foreach ($label in $labels)$label#if( $foreach.hasNext ),#end#end</h3>
5
+ <ol>
6
+ #foreach ($cluDoc in $docs)
7
+ <li><a href="#url_for_home?q=id:$cluDoc">$cluDoc</a></li>
8
+ #end
9
+ </ol>
10
+
11
+
12
+ #end
@@ -0,0 +1,17 @@
1
+ #if($params.getBool("debugQuery",false))
2
+ <a href="#" onclick='jQuery(this).siblings("pre").toggle(); return false;'>toggle explain</a>
3
+ <pre style="display:none">$response.getExplainMap().get($doc.getFirstValue('id'))</pre>
4
+ <a href="#" onclick='jQuery(this).siblings("pre2").toggle(); return false;'>toggle all fields</a>
5
+ <pre2 style="display:none">
6
+ #foreach($fieldname in $doc.fieldNames)
7
+ <br>
8
+ <span class="field-name">$fieldname :</span>
9
+ <span>
10
+ #foreach($value in $doc.getFieldValues($fieldname))
11
+ $esc.html($value)
12
+ #end
13
+ </span>
14
+ #end
15
+ </br>
16
+ </pre2>
17
+ #end
@@ -0,0 +1,4 @@
1
+ #set($dym = $response.response.spellcheck.suggestions.collation.collationQuery)
2
+ #if($dym)
3
+ Did you mean <a href="#{url_for_home}#{lensNoQ}&q=$esc.url($dym)">$esc.html($dym)</a>?
4
+ #end
@@ -0,0 +1,15 @@
1
+ #if($response.facetFields)
2
+ <h2 #annTitle("Facets generated by adding &facet.field= to the request")>Field Facets</h2>
3
+ #foreach($field in $response.facetFields)
4
+ ## Hide facets without value
5
+ #if($field.values.size() > 0)
6
+ <span class="facet-field">$field.name</span>
7
+
8
+ <ul>
9
+ #foreach($facet in $field.values)
10
+ <li><a href="#url_for_facet_filter($field.name, $facet.name)">$facet.name</a> ($facet.count)</li>
11
+ #end
12
+ </ul>
13
+ #end
14
+ #end
15
+ #end
@@ -0,0 +1,3 @@
1
+ <h2 #annTitle("Facets generated by adding &facet.pivot= to the request")>Pivot Facets</h2>
2
+ #set($pivot = $response.response.facet_counts.facet_pivot)
3
+ #display_facet_pivot($pivot, "")
@@ -0,0 +1,3 @@
1
+ #set($field = $response.response.facet_counts.facet_queries)
2
+ <h2 #annTitle("Facets generated by adding &facet.query= to the request")>Query Facets</h2>
3
+ #display_facet_query($field, "", "")
@@ -0,0 +1,15 @@
1
+ <h2 #annTitle("Facets generated by adding &facet.range= to the request")>Range Facets</h2>
2
+ #foreach ($field in $response.response.facet_counts.facet_ranges)
3
+ ## Hide facets without value
4
+ #if($field.value.counts.size() > 0)
5
+ #set($name = $field.key)
6
+ #set($display = $name)
7
+ #set($f = $field.value.counts)
8
+ #set($start = $field.value.start)
9
+ #set($end = $field.value.end)
10
+ #set($gap = $field.value.gap)
11
+ #set($before = $field.value.before)
12
+ #set($after = $field.value.after)
13
+ #display_facet_range($f, $display, $name, $start, $end, $gap, $before, $after)
14
+ #end
15
+ #end
@@ -0,0 +1,5 @@
1
+ #parse('facet_fields.vm')
2
+ #parse('facet_queries.vm')
3
+ #parse('facet_ranges.vm')
4
+ #parse('facet_pivot.vm')
5
+ #parse('cluster.vm')
@@ -0,0 +1,17 @@
1
+ <hr/>
2
+ <div>
3
+ <span>Options:</span>
4
+ #if($request.params.get('debugQuery'))
5
+ <a href="#url_for_home?#q#if($list.size($request.params.getParams('fq')) > 0)&#fqs($request.params.getParams('fq'))#end">disable debug</a>
6
+ #else
7
+ <a href="#url_for_lens&debugQuery=true&fl=*,score">enable debug</a>
8
+ #end
9
+ #if($annotate)
10
+ <a href="#url_for_home?#q#if($list.size($request.params.getParams('fq')) > 0)&#fqs($request.params.getParams('fq'))#end#boostPrice">disable annotation</a>
11
+ #else
12
+ <a href="#url_for_lens&annotateBrowse=true">enable annotation</a>
13
+ #end
14
+ <a #annTitle("Click to switch to an XML response: &wt=xml") href="#url_for_lens&wt=xml#if($request.params.get('debugQuery'))&debugQuery=true#end">XML</a></div>
15
+ <div>Generated by <a href="http://wiki.apache.org/solr/VelocityResponseWriter">VelocityResponseWriter</a></div>
16
+ <div><span>Documentation: </span> <a href="http://lucene.apache.org/solr">Solr Home Page</a>, <a href="http://wiki.apache.org/solr">Solr Wiki</a></div>
17
+ <div>Disclaimer: The locations displayed in this demonstration are purely fictional. It is more than likely that no store with the items listed actually exists at that location!</div>