Class: Handler

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

Instance Method Summary collapse

Instance Method Details

#get_srch(params) ⇒ Object



58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/it_tools/solr.rb', line 58

def get_srch params
  query = params["query"]
  if query.nil?
    raise NoResults.new "<p>No Query Specified</p>"
  end
  query = Solr::Query.new params
  resp = query.do_query params
  @highlights = resp['highlighting']
  if @highlights.length == 0 
    raise NoResults.new "<p>No Results</p>"
  end
  return @highlights
end