%# # Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. %>
Displaying <%= (params[:page] || 1).to_i.ordinalize %> page with <%= @articles.size %> articles of total <%= @articles.total %>
No documents have been found. <% if @articles.response.suggestions['suggest_title'].present? || @articles.response.suggestions['suggest_body'].present? %> Maybe you mean <%= @articles.response.suggestions.map { |k,v| v.first['options'] }.flatten.map {|v| v['text']}.uniq.map do |term| link_to term, search_path(params.permit(:q, :a, :c, :s, :w, :comments).merge q: term) end.to_sentence(last_word_connector: ' or ').html_safe %>? <% end %>
<%= link_to 'All Sections →'.html_safe, search_path(params.permit(:q, :a, :c, :s, :w, :comments).merge(c: nil))%>
<% if article.try(:highlight).try(:abstract) %> <%= article.highlight.abstract.join.html_safe %> <% else %> <%= article.try(:highlight).try(:content) ? article.highlight.content.join('…').html_safe : article.abstract %> <% end %>
<% if comments = article.try(:highlight) && article.highlight['comments.body'] %>Comments: <%= comments.join('…').html_safe %>
<% end %>Authors: <%= article.authors.map(&:full_name).to_sentence %> | Published: <%= article.published_on %> | Score: <%= article._score %>