From c62db4918a9a4497fc85628bd07110e55ad8fac5 Mon Sep 17 00:00:00 2001 From: francis Date: Mon, 14 Apr 2008 14:46:47 +0000 Subject: Centralise call to multi_solr_search --- app/controllers/application.rb | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'app/controllers/application.rb') diff --git a/app/controllers/application.rb b/app/controllers/application.rb index e8c8ec199..736656dec 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -6,7 +6,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: application.rb,v 1.37 2008-04-11 15:53:57 francis Exp $ +# $Id: application.rb,v 1.38 2008-04-14 14:46:47 francis Exp $ class ApplicationController < ActionController::Base @@ -155,19 +155,7 @@ class ApplicationController < ActionController::Base else @page = this_page end - - # XXX remove duplication with models/track_mailer.rb - solr_object = InfoRequestEvent.multi_solr_search(@query, :models => [ PublicBody, User ], - :limit => @per_page, :offset => (@page - 1) * @per_page, - :highlight => { - :prefix => html_highlight ? '' : "*", - :suffix => html_highlight ? '' : "*", - :fragsize => 250, - :fields => ["solr_text_main", "title", # InfoRequestEvent - "name", "short_name", # PublicBody - "name" # User - ]}, :order => order - ) + solr_object = InfoRequest.full_search(@query, order, @per_page, @page, true) @search_results = solr_object.results @search_hits = solr_object.total_hits -- cgit v1.2.3