aboutsummaryrefslogtreecommitdiffstats
path: root/isuifang_solr/solr/conf/velocity/doc.vm
diff options
context:
space:
mode:
Diffstat (limited to 'isuifang_solr/solr/conf/velocity/doc.vm')
-rw-r--r--isuifang_solr/solr/conf/velocity/doc.vm42
1 files changed, 42 insertions, 0 deletions
diff --git a/isuifang_solr/solr/conf/velocity/doc.vm b/isuifang_solr/solr/conf/velocity/doc.vm
new file mode 100644
index 0000000..7da97cb
--- /dev/null
+++ b/isuifang_solr/solr/conf/velocity/doc.vm
@@ -0,0 +1,42 @@
+<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>
+##do we have a physical store for this product
+#set($store = $doc.getFieldValue('store'))
+#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&amp;source=embed">Larger Map</a></small></div></div>#end
+<div>Price: #field('price_c')</div>
+<div>Features: #field('features')</div>
+<div>In Stock: #field('inStock')</div>
+<div class="mlt">
+ #set($mlt = $mltResults.get($docId))
+ #set($mltOn = $params.getBool('mlt'))
+ #if($mltOn == true)<div class="field-name">Similar Items</div>#end
+ #if ($mltOn && $mlt && $mlt.size() > 0)
+ <ul>
+ #foreach($mltHit in $mlt)
+ #set($mltId = $mltHit.getFieldValue('id'))
+ <li><div><a href="#url_for_home?q=id:$mltId">$mltId</a></div><div><span class="field-name">Name:</span> $mltHit.getFieldValue('name')</div>
+ <div><span class="field-name">Price:</span> $!number.currency($mltHit.getFieldValue('price')) <span class="field-name">In Stock:</span> $mltHit.getFieldValue('inStock')</div>
+
+ </li>
+ #end
+ </ul>
+ #elseif($mltOn && $mlt.size() == 0)
+ <div>No Similar Items Found</div>
+ #end
+</div>
+#if($params.getBool("debugQuery",false))
+ <a href="#" onclick='jQuery(this).siblings("pre").toggle(); return false;'>toggle explain</a>
+ <pre style="display:none">$response.getExplainMap().get($doc.getFirstValue('id'))</pre>
+ <a href="#" onclick='jQuery(this).siblings("pre2").toggle(); return false;'>toggle all fields</a>
+ <pre2 style="display:none">
+ #foreach($fieldname in $doc.fieldNames)
+ <br>
+ <span class="field-name">$fieldname :</span>
+ <span>
+ #foreach($value in $doc.getFieldValues($fieldname))
+ $value
+ #end
+ </span>
+ #end
+ </br>
+ </pre2>
+#end \ No newline at end of file