Class: WebApp

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/it_tools/solr.rb

Instance Method Summary collapse

Instance Method Details

#check_highlightsObject



35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/it_tools/solr.rb', line 35

def check_highlights
  retval = "<ul>"
  @highlights.each do |key, value|
    if value['body'].nil? 
      next  
    end
    body = value['body'][0]
    body = body.remove_non_ascii
    clean = Sanitize.clean(body, Sanitize::Config::RELAXED)
    retval += "<li>#{key}<br><div>#{clean}</div>"
  end
  retval += "</ul>"
end