diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/application.rb | 4 | ||||
-rw-r--r-- | app/controllers/general_controller.rb | 13 |
2 files changed, 11 insertions, 6 deletions
diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 79521e240..7275e53a7 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.40 2008-04-24 23:52:59 francis Exp $ +# $Id: application.rb,v 1.41 2008-04-30 00:37:50 francis Exp $ class ApplicationController < ActionController::Base @@ -127,7 +127,7 @@ class ApplicationController < ActionController::Base @http_auth_user = admin_http_auth_user end - # Convert URL name for sort by order, to Lucene query + # Convert URL name for sort by order, to Xapian query def order_to_sort_by(sortby) if sortby.nil? return [nil, true] diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb index 9e2dccc9a..6ac91c605 100644 --- a/app/controllers/general_controller.rb +++ b/app/controllers/general_controller.rb @@ -5,7 +5,7 @@ # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: general_controller.rb,v 1.19 2008-04-24 23:52:59 francis Exp $ +# $Id: general_controller.rb,v 1.20 2008-04-30 00:37:50 francis Exp $ class GeneralController < ApplicationController @@ -47,14 +47,19 @@ class GeneralController < ApplicationController @query = nil render :action => "search" else - redirect_to search_url(:query => @query, :sortby => @sortby) + redirect_to search_url(@query, @sortby) end end # Actual search def search - query = params[:query] - sortby = params[:sortby] + combined = params[:combined] + sortby = nil + if combined.size > 1 and combined[-1] == 'newest' + sortby = 'newest' + combined = combined[0..-2] + end + query = combined.join("/") perform_search(query, sortby) #render :controller => "help", :action => "about" |