<%! from lonote.im3 import Book, Paper %> <% results.fragmenter.maxchars = 50 results.fragmenter.surround = 20 %> <%def name="result_item(hit)"> <% book = bs[hit['bid']] parent_name = None try: parent_name = book.paper(bs[hit['bid']].pid_parent(hit['pid'])).name except: pass %> ${hit['pname'] | h} % if hit['pdesc']:  ${hit['pdesc'] | h} % endif

% if hit['sid'] == Paper.default_sid: ${hit['sid'] | h} % else: ${hit['sid'] | h} % endif    ${parent_name}   ${hit['bid']}

<% highlight = '' try: highlight = hit.highlights('text', top = 3, minscore = 1) except: pass %>

${highlight}

${_('Search Results of [ {} ]:').format(key)} ${results.scored_length()} / ${len(results)} / ${doc_count}