/kai/templates/snippets/view.mako
Relevant Search: With Applications for Solr and Elasticsearch
For more in depth reading about search, ranking and generally everything you could ever want to know about how lucene, elasticsearch or solr work under the hood I highly suggest this book. Easily one of the most interesting technical books I have read in a long time. If you are tasked with solving search relevance problems even if not in Solr or Elasticsearch it should be your first reference. Amazon Affiliate LinkMako | 34 lines | 30 code | 4 blank | 0 comment | 7 complexity | ef43a1d0de0aa05bdd6ff8cccfe3cdf5 MD5 | raw file
1${widgets.user_post(h.link_to(c.snippet.displayname, url=url('snippet_author', id=c.snippet.displayname)), 2 c.snippet.email or 'anonymous', c.snippet.created, extra_classes='header')} 3<h1>${c.snippet.title} \ 4% if c.is_owner or (c.user and c.user.in_group('admin')): 5<span class="subtle">(${h.link_to('Edit', url=url('edit_snippet', id=c.id))})</span> 6% endif 7</h1> 8 9<div class="tag">Tags: <Span style="taglist">\ 10% for tag in c.snippet.tags: 11 <a href="${url(controller='snippets', action='by_tag', tag=tag.strip())}">${tag}</a>\ 12% endfor 13</span></div> 14 15<div class="description">${c.snippet.description|n}</div> 16 17<div class="snippet_content">${c.snippet_content|n}</div> 18 19${widgets.show_comments(c.snippet.id)} 20<%namespace name="widgets" file="/widgets.mako"/> 21<%def name="title()">${parent.title()} - ${_('View Snippet: %s' % c.snippet.title)}</%def> 22<%inherit file="layout.mako" /> 23<%def name="styles()"> 24${parent.styles()} 25${h.stylesheet_link('/css/sphinx.css')} 26</%def> 27<%def name="javascript()"> 28${parent.javascript()} 29<script> 30$(document).ready(function() { 31 ${widgets.comment_js(c.snippet.id)} 32}); 33</script> 34</%def>