AutoCommit Fre Sep 4 14:03:04 CEST 2015
This commit is contained in:
@@ -102,7 +102,7 @@ class Document < ActiveRecord::Base
|
||||
end
|
||||
text :name, :boost=>4.0, :stored=> true
|
||||
text :meeting, stored: true do |d|
|
||||
(d.parent_type == "Meeting")? d.try(:parent).try(:text).to_s : ""
|
||||
(d.parent.is_a?(Meeting))? d.try(:parent).try(:text).to_s : ""
|
||||
end
|
||||
end
|
||||
def maketoc
|
||||
|
||||
@@ -1,17 +1,22 @@
|
||||
<% unless search_results.nil? %>
|
||||
<%= search_results %>
|
||||
<%#= search_results %>
|
||||
|
||||
|
||||
<ul>
|
||||
<% search_results.each_hit_with_result do |hit,result| %>
|
||||
<li> <%= link_to result.parent.title+": " + result.name, document_path(result) %>
|
||||
<div style="border:red 1px solid"><%= hit.highlights.to_yaml %></div>
|
||||
<div style="border:blue 1px solid"><%#= hit.to_yaml %></div>
|
||||
|
||||
<% hit.highlights(:name).each do |hlgt| %>
|
||||
<%= raw(hlgt.format{|word|"<b>#{word}</b>" } ) %>
|
||||
<%= (hlgt.format{|word|"<b>#{word}</b>" } ).html_safe%>
|
||||
<% end %>
|
||||
<% %>
|
||||
<% hit.highlights(:text).each do |hlgt| %>
|
||||
<%= "text:" + raw(hlgt.format {|word| raw("<b>#{word}</b>") })%>
|
||||
<%= "text:" + (hlgt.format {|word| raw("<b>#{word}</b>") }).html_safe%>
|
||||
<% end %>
|
||||
<% hit.highlights(:meeting).each do |hlgt| %>
|
||||
<%= "text:" + raw(hlgt.format {|word| "*#{word}*" })%>
|
||||
<%= "text:" + (hlgt.format {|word| "*#{word}*" }).html_safe%>
|
||||
<% end %>
|
||||
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user