{# This template displays the result of a whoosh search. The initial report is generated by an include within the search.html template. Subsequent updates are made by ajax as the user selects search options or adds/delete characters to the search query. #} {%- if results is defined %} {%- if is_ticket %} {%- if results %}
{{ result['itemid'][:4] }} |
{{ _("{summary}").format(summary=result['summary']) }} |
{{ _("Whoosh query:") }} {{ whoosh_query }}
{%- if whoosh_filter %}{{ _("Whoosh filter:") }} {{ whoosh_filter }}
{%- endif %} {%- if omitted_words %}{{ _("Common words omitted from query:") }} {{ omitted_words }}
{%- endif %} {%- if results is defined %}{%- if results.filtered_count %} {%- set found = results|length - results.filtered_count %} {{ _("{found:d} items found, {items_filtered:d} more items filtered by content types.").format(found=found, items_filtered=results.filtered_count) }} {%- else %} {{ _("{result_len:d} items found.").format(result_len=results|length) }} {%- endif %}
{%- if results %}{# when user clicks on an item link under results, "regex=query" will highlight search terms within content #} {%- if result['name'] %} {%- if history %} {# user has checked "All" radio button under Revisions heading #} {{ result['names'] }} {%- else %} {{ result['names'] }} {%- endif %} {%- else %} Item ID : {{ result['itemid'] }} {%- endif %} {{ _("MATCHED TERMS:") }} {%- for field, term in result.matched_terms() %} {%- set field, term = theme_supp.field_term(field, term) %} {{ field }}:{{ term }}, {%- endfor %}
{{ _("REVISION: {revid}, SIZE: {size}, MODIFIED: {mtime}, CONTENT TYPE: {type}, SCORE: {score}"). format(type=(result['contenttype']|shorten_ctype), mtime=result['mtime']|time_datetime, size=result['size']|filesizeformat, revid=result['rev_number'], score=result.score|round(2)) }}
{%- if result.highlights('comment') %}{{ _("COMMENT: {content}").format(content=result.highlights('comment')|safe) }}
{%- endif %} {%- if result['tags'] %}{{ _("TAGS: {content}").format(content=result['tags']|safe) }}
{%- endif %} {%- if result.highlights('content') %}{{ _("CONTENT: {content}").format(content=result.highlights('content')|safe) }}
{%- endif %} {%- else %} {#- read permission denied, using list to work around jinja2 scoping issue #} {%- if count.append(count.pop() + 1) %} {%- endif %} {%- endif %} {%- endfor %} {% if count[0] %}