>
<%= form_tag show_page_with_language_path(:urlname => "suche", :lang => @page.language_code), :method => :get do %>
<%= text_field_tag "query", params[:query], :class => 'field' %>
<%= submit_tag _("search"), :name => nil %>
<%- end -%>
<%- if !@text_search_results.blank? || !@rtf_search_results.blank? -%>
<%= t('alchemy.search.result_heading', :query => h(params[:query]), :count => @rtf_search_results.length + @text_search_results.length) %>
<%- all_results = (@text_search_results + @rtf_search_results).sort{|y, x| x.ferret_score <=> y.ferret_score} -%>
<%- all_results.each do |result| -%>
<%- element = Content.find_by_essence_id_and_essence_type(result.id, result.class.to_s).element -%>
<%- page = element.nil? ? nil : element.page -%>
-
<%= _('Excerpt') %>:
<%= result.highlight(params[:query], {
:field => (result.class == EssenceRichtext ? :stripped_body : :body),
:num_excerpts => 1,
:pre_tag => "",
:post_tag => ""
}) %>
<%- unless page.nil? -%>
<%= _('Page') %>: <%= link_to page.urlname, show_page_with_language_path(:urlname => page.urlname, :lang => page.language) %>
<%- end -%>
<%- end -%>
<%- elsif !params[:query].blank? -%>
<%= t('alchemy.search.no_results') %>
<%- end -%>