simple_solr_client 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,33 @@
|
|
|
1
|
+
#**
|
|
2
|
+
* Main entry point into the /browse templates
|
|
3
|
+
*#
|
|
4
|
+
|
|
5
|
+
#set($searcher = $request.searcher)
|
|
6
|
+
#set($params = $request.params)
|
|
7
|
+
#set($clusters = $response.response.clusters)
|
|
8
|
+
#set($mltResults = $response.response.get("moreLikeThis"))
|
|
9
|
+
#set($annotate = $params.get("annotateBrowse"))
|
|
10
|
+
#parse('query_form.vm')
|
|
11
|
+
#parse('did_you_mean.vm')
|
|
12
|
+
|
|
13
|
+
<div class="navigators">
|
|
14
|
+
#parse("facets.vm")
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<div class="pagination">
|
|
18
|
+
#parse("pagination_top.vm")
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
## Show Error Message, if any
|
|
22
|
+
<div class="error">
|
|
23
|
+
#parse("error.vm")
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
## Render Results, actual matching docs
|
|
27
|
+
<div class="results">
|
|
28
|
+
#parse("results_list.vm")
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<div class="pagination">
|
|
32
|
+
#parse("pagination_bottom.vm")
|
|
33
|
+
</div>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#**
|
|
2
|
+
* Check if Clustering is Enabled and then
|
|
3
|
+
* call cluster_results.vm
|
|
4
|
+
*#
|
|
5
|
+
|
|
6
|
+
<h2 #annTitle("Clusters generated by Carrot2 using the /clustering RequestHandler")>
|
|
7
|
+
Clusters
|
|
8
|
+
</h2>
|
|
9
|
+
|
|
10
|
+
## Div tag has placeholder text by default
|
|
11
|
+
<div id="clusters">
|
|
12
|
+
Run Solr with java -Dsolr.clustering.enabled=true -jar start.jar to see clustered search results.
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
## Replace the div content *if* Carrot^2 is available
|
|
16
|
+
<script type="text/javascript">
|
|
17
|
+
$('#clusters').load("#url_for_solr/clustering#lens",
|
|
18
|
+
{'wt':'velocity', 'v.template':"cluster_results"});
|
|
19
|
+
</script>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#**
|
|
2
|
+
* Actual rendering of Clusters
|
|
3
|
+
*#
|
|
4
|
+
|
|
5
|
+
## For each cluster
|
|
6
|
+
#foreach ($clusters in $response.response.clusters)
|
|
7
|
+
|
|
8
|
+
#set($labels = $clusters.get('labels'))
|
|
9
|
+
#set($docs = $clusters.get('docs'))
|
|
10
|
+
|
|
11
|
+
## This Cluster's Heading
|
|
12
|
+
<h3>
|
|
13
|
+
#foreach ($label in $labels)
|
|
14
|
+
## Keep the following line together to prevent
|
|
15
|
+
## a space appearing before each comma
|
|
16
|
+
$label#if( $foreach.hasNext ),#end
|
|
17
|
+
#end
|
|
18
|
+
</h3>
|
|
19
|
+
|
|
20
|
+
## This Cluster's Documents
|
|
21
|
+
<ol>
|
|
22
|
+
## For each doc in this cluster
|
|
23
|
+
#foreach ($cluDoc in $docs)
|
|
24
|
+
<li>
|
|
25
|
+
<a href="#url_for_home?q=id:$cluDoc">
|
|
26
|
+
$cluDoc</a>
|
|
27
|
+
</li>
|
|
28
|
+
#end
|
|
29
|
+
</ol>
|
|
30
|
+
|
|
31
|
+
#end ## end for each Cluster
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#**
|
|
2
|
+
* Show Debugging Information, if enabled
|
|
3
|
+
*#
|
|
4
|
+
|
|
5
|
+
#if( $params.getBool("debugQuery",false) )
|
|
6
|
+
<a href="#" onclick='jQuery(this).siblings("pre").toggle(); return false;'>
|
|
7
|
+
toggle explain</a>
|
|
8
|
+
|
|
9
|
+
<pre style="display:none">
|
|
10
|
+
$response.getExplainMap().get($doc.getFirstValue('id'))
|
|
11
|
+
</pre>
|
|
12
|
+
|
|
13
|
+
<a href="#" onclick='jQuery(this).siblings("pre2").toggle(); return false;'>
|
|
14
|
+
toggle all fields</a>
|
|
15
|
+
|
|
16
|
+
<pre2 style="display:none">
|
|
17
|
+
#foreach($fieldname in $doc.fieldNames)
|
|
18
|
+
<br>
|
|
19
|
+
<span class="field-name">$fieldname :</span>
|
|
20
|
+
<span>
|
|
21
|
+
#foreach($value in $doc.getFieldValues($fieldname))
|
|
22
|
+
$esc.html($value)
|
|
23
|
+
#end
|
|
24
|
+
</span>
|
|
25
|
+
</br>
|
|
26
|
+
#end
|
|
27
|
+
</pre2>
|
|
28
|
+
#end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#**
|
|
2
|
+
* Display facets based on field values
|
|
3
|
+
* e.g.: fields specified by &facet.field=
|
|
4
|
+
*#
|
|
5
|
+
|
|
6
|
+
#if($response.facetFields)
|
|
7
|
+
<h2 #annTitle("Facets generated by adding &facet.field= to the request")>
|
|
8
|
+
Field Facets
|
|
9
|
+
</h2>
|
|
10
|
+
#foreach($field in $response.facetFields)
|
|
11
|
+
## Hide facets without value
|
|
12
|
+
#if($field.values.size() > 0)
|
|
13
|
+
<span class="facet-field">$field.name</span>
|
|
14
|
+
<ul>
|
|
15
|
+
#foreach($facet in $field.values)
|
|
16
|
+
<li>
|
|
17
|
+
<a href="#url_for_facet_filter($field.name, $facet.name)">$facet.name</a> ($facet.count)
|
|
18
|
+
</li>
|
|
19
|
+
#end
|
|
20
|
+
</ul>
|
|
21
|
+
#end ## end if > 0
|
|
22
|
+
#end ## end for each facet field
|
|
23
|
+
#end ## end if response has facet fields
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#**
|
|
2
|
+
* Display Pivot-Based Facets
|
|
3
|
+
* e.g.: facets specified by &facet.pivot=
|
|
4
|
+
*#
|
|
5
|
+
|
|
6
|
+
<h2 #annTitle("Facets generated by adding &facet.pivot= to the request")>
|
|
7
|
+
Pivot Facets
|
|
8
|
+
</h2>
|
|
9
|
+
|
|
10
|
+
#set($pivot = $response.response.facet_counts.facet_pivot)
|
|
11
|
+
|
|
12
|
+
#display_facet_pivot($pivot, "")
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#**
|
|
2
|
+
* Display facets based on specific facet queries
|
|
3
|
+
* e.g.: facets specified by &facet.query=
|
|
4
|
+
*#
|
|
5
|
+
|
|
6
|
+
#set($field = $response.response.facet_counts.facet_queries)
|
|
7
|
+
|
|
8
|
+
<h2 #annTitle("Facets generated by adding &facet.query= to the request")>
|
|
9
|
+
Query Facets
|
|
10
|
+
</h2>
|
|
11
|
+
|
|
12
|
+
#display_facet_query($field, "", "")
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#**
|
|
2
|
+
* Display facets based on ranges of values, AKA "Bukets"
|
|
3
|
+
* e.g.: ranges specified by &facet.range=
|
|
4
|
+
*#
|
|
5
|
+
|
|
6
|
+
<h2 #annTitle("Facets generated by adding &facet.range= to the request")>
|
|
7
|
+
Range Facets
|
|
8
|
+
</h2>
|
|
9
|
+
|
|
10
|
+
#foreach ($field in $response.response.facet_counts.facet_ranges)
|
|
11
|
+
## Hide facets without value
|
|
12
|
+
#if($field.value.counts.size() > 0)
|
|
13
|
+
#set($name = $field.key)
|
|
14
|
+
#set($display = $name)
|
|
15
|
+
#set($f = $field.value.counts)
|
|
16
|
+
#set($start = $field.value.start)
|
|
17
|
+
#set($end = $field.value.end)
|
|
18
|
+
#set($gap = $field.value.gap)
|
|
19
|
+
#set($before = $field.value.before)
|
|
20
|
+
#set($after = $field.value.after)
|
|
21
|
+
#display_facet_range($f, $display, $name, $start, $end, $gap, $before, $after)
|
|
22
|
+
#end ## end if has any values
|
|
23
|
+
#end ## end for each facet range
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#**
|
|
2
|
+
* Render the bottom section of the page visible to users
|
|
3
|
+
*#
|
|
4
|
+
|
|
5
|
+
<hr/>
|
|
6
|
+
<div>
|
|
7
|
+
<span>Options:</span>
|
|
8
|
+
|
|
9
|
+
#if($request.params.get('debugQuery'))
|
|
10
|
+
<a href="#url_for_home?#q#if($list.size($request.params.getParams('fq')) > 0)&#fqs($request.params.getParams('fq'))#end">
|
|
11
|
+
disable debug</a>
|
|
12
|
+
#else
|
|
13
|
+
<a href="#url_for_lens&debugQuery=true&fl=*,score">
|
|
14
|
+
enable debug</a>
|
|
15
|
+
#end
|
|
16
|
+
-
|
|
17
|
+
#if($annotate)
|
|
18
|
+
<a href="#url_for_home?#q#if($list.size($request.params.getParams('fq')) > 0)&#fqs($request.params.getParams('fq'))#end#boostPrice">
|
|
19
|
+
disable annotation</a>
|
|
20
|
+
#else
|
|
21
|
+
<a href="#url_for_lens&annotateBrowse=true">
|
|
22
|
+
enable annotation</a>
|
|
23
|
+
#end
|
|
24
|
+
-
|
|
25
|
+
<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">
|
|
26
|
+
XML results</a>
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div>
|
|
31
|
+
Generated by <a href="http://wiki.apache.org/solr/VelocityResponseWriter">VelocityResponseWriter</a>
|
|
32
|
+
</div>
|
|
33
|
+
<div>
|
|
34
|
+
<span>Documentation: </span>
|
|
35
|
+
<a href="http://lucene.apache.org/solr">Solr Home Page</a>, <a href="http://wiki.apache.org/solr">
|
|
36
|
+
Solr Wiki</a>
|
|
37
|
+
</div>
|
|
38
|
+
<div>
|
|
39
|
+
Disclaimer:
|
|
40
|
+
The locations displayed in this demonstration are purely fictional.
|
|
41
|
+
It is more than likely that no store with the items listed actually
|
|
42
|
+
exists at that location!
|
|
43
|
+
</div>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#**
|
|
2
|
+
* Provide elements for the <head> section of the HTML document
|
|
3
|
+
*#
|
|
4
|
+
|
|
5
|
+
## An example of using an arbitrary request parameter
|
|
6
|
+
<title>#param('title')</title>
|
|
7
|
+
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
|
|
8
|
+
|
|
9
|
+
<script type="text/javascript" src="#{url_root}/js/lib/jquery-1.7.2.min.js"></script>
|
|
10
|
+
<link rel="stylesheet" type="text/css" href="#{url_for_solr}/admin/file?file=/velocity/main.css&contentType=text/css"/>
|
|
11
|
+
<link rel="stylesheet" href="#{url_for_solr}/admin/file?file=/velocity/jquery.autocomplete.css&contentType=text/css" type="text/css" />
|
|
12
|
+
<script type="text/javascript" src="#{url_for_solr}/admin/file?file=/velocity/jquery.autocomplete.js&contentType=text/javascript"></script>
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
$(document).ready(function(){
|
|
17
|
+
$("\#q").autocomplete('#{url_for_solr}/terms', { ## backslash escaped #q as that is a macro defined in VM_global_library.vm
|
|
18
|
+
extraParams:{
|
|
19
|
+
'terms.prefix': function() { return $("\#q").val();},
|
|
20
|
+
'terms.sort': 'count',
|
|
21
|
+
'terms.fl': 'name',
|
|
22
|
+
'wt': 'velocity',
|
|
23
|
+
'v.template': 'suggest'
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
).keydown(function(e){
|
|
27
|
+
if (e.keyCode === 13){
|
|
28
|
+
$("#query-form").trigger('submit');
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// http://localhost:8983/solr/collection1/terms?terms.fl=name&terms.prefix=i&terms.sort=count&wt=velocity&v.template=suggest
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
</script>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#**
|
|
2
|
+
* Called for each matching document but then
|
|
3
|
+
* calls one of product_doc, join_doc or richtext_doc
|
|
4
|
+
* depending on which fields the doc has
|
|
5
|
+
*#
|
|
6
|
+
|
|
7
|
+
#set($docId = $doc.getFieldValue('id'))
|
|
8
|
+
|
|
9
|
+
<div class="result-document">
|
|
10
|
+
|
|
11
|
+
## Has a "name" field ?
|
|
12
|
+
#if($doc.getFieldValue('name'))
|
|
13
|
+
#parse("product_doc.vm")
|
|
14
|
+
|
|
15
|
+
## Has a "compName_s" field ?
|
|
16
|
+
#elseif($doc.getFieldValue('compName_s'))
|
|
17
|
+
#parse("join_doc.vm")
|
|
18
|
+
|
|
19
|
+
## Fallback to richtext_doc
|
|
20
|
+
#else
|
|
21
|
+
#parse("richtext_doc.vm")
|
|
22
|
+
|
|
23
|
+
#end
|
|
24
|
+
|
|
25
|
+
</div>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#**
|
|
2
|
+
* Display grouped results
|
|
3
|
+
*#
|
|
4
|
+
|
|
5
|
+
<div class="result-document">
|
|
6
|
+
|
|
7
|
+
<div class="result-title">
|
|
8
|
+
<b>$grouping.key</b>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div>
|
|
12
|
+
Total Matches in Group: $grouping.value.matches
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div> ## list of groups
|
|
16
|
+
|
|
17
|
+
#foreach ($group in $grouping.value.groups)
|
|
18
|
+
<div class="group-value">
|
|
19
|
+
#if($group.groupValue)$group.groupValue#{else}<i>No group</i>#end
|
|
20
|
+
<span #annTitle("The count of the number of documents in this group")>
|
|
21
|
+
($group.doclist.numFound)
|
|
22
|
+
</span>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<div class="group-doclist"
|
|
26
|
+
#annTitle("Contains the top scoring documents in the group")
|
|
27
|
+
>
|
|
28
|
+
#foreach ($doc in $group.doclist)
|
|
29
|
+
#set($docId = $doc.getFieldValue('id'))
|
|
30
|
+
#if($doc.getFieldValue('name'))
|
|
31
|
+
#parse("product_doc.vm")
|
|
32
|
+
#elseif($doc.getFieldValue('compName_s'))
|
|
33
|
+
#parse("join_doc.vm")
|
|
34
|
+
#else
|
|
35
|
+
#parse("richtext_doc.vm")
|
|
36
|
+
#end
|
|
37
|
+
#end
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
#end ## end of foreach group in grouping.value.groups
|
|
41
|
+
</div> ## div tag for entire list of groups
|
|
42
|
+
|
|
43
|
+
</div> ## end of div class=result-document
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#**
|
|
2
|
+
* An extremely plain / debug version of hit.vm
|
|
3
|
+
*#
|
|
4
|
+
|
|
5
|
+
<table>
|
|
6
|
+
## For each field
|
|
7
|
+
#foreach( $fieldName in $doc.fieldNames )
|
|
8
|
+
## For each value
|
|
9
|
+
#foreach( $value in $doc.getFieldValues($fieldName) )
|
|
10
|
+
<tr>
|
|
11
|
+
## Field Name
|
|
12
|
+
<th align="right" valign="top">
|
|
13
|
+
#if( $foreach.count == 1 )
|
|
14
|
+
$fieldName:
|
|
15
|
+
#end
|
|
16
|
+
</th>
|
|
17
|
+
## Field Value(s)
|
|
18
|
+
<td align="left" valign="top">
|
|
19
|
+
$esc.html($value) <br/>
|
|
20
|
+
</td>
|
|
21
|
+
</tr>
|
|
22
|
+
#end ## end for each value
|
|
23
|
+
#end ## end for each field
|
|
24
|
+
</table>
|
|
25
|
+
<hr/>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#**
|
|
2
|
+
* Display documents that are joined to other documents
|
|
3
|
+
*#
|
|
4
|
+
|
|
5
|
+
<div class="result-title">
|
|
6
|
+
<b>#field('compName_s')</b>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<div>
|
|
10
|
+
Id: #field('id')
|
|
11
|
+
(company-details document for
|
|
12
|
+
<a href="http://wiki.apache.org/solr/Join" target="_new">join</a>
|
|
13
|
+
)
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<div>
|
|
17
|
+
Address: #field('address_s')
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
#parse('debug.vm')
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
.ac_results {
|
|
2
|
+
padding: 0px;
|
|
3
|
+
border: 1px solid black;
|
|
4
|
+
background-color: white;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
z-index: 99999;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.ac_results ul {
|
|
10
|
+
width: 100%;
|
|
11
|
+
list-style-position: outside;
|
|
12
|
+
list-style: none;
|
|
13
|
+
padding: 0;
|
|
14
|
+
margin: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.ac_results li {
|
|
18
|
+
margin: 0px;
|
|
19
|
+
padding: 2px 5px;
|
|
20
|
+
cursor: default;
|
|
21
|
+
display: block;
|
|
22
|
+
/*
|
|
23
|
+
if width will be 100% horizontal scrollbar will apear
|
|
24
|
+
when scroll mode will be used
|
|
25
|
+
*/
|
|
26
|
+
/*width: 100%;*/
|
|
27
|
+
font: menu;
|
|
28
|
+
font-size: 12px;
|
|
29
|
+
/*
|
|
30
|
+
it is very important, if line-height not setted or setted
|
|
31
|
+
in relative units scroll will be broken in firefox
|
|
32
|
+
*/
|
|
33
|
+
line-height: 16px;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.ac_loading {
|
|
38
|
+
background: white url('indicator.gif') right center no-repeat;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.ac_odd {
|
|
42
|
+
background-color: #eee;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.ac_over {
|
|
46
|
+
background-color: #0A246A;
|
|
47
|
+
color: white;
|
|
48
|
+
}
|