aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-12-03 09:44:12 +0000
committerLouise Crow <louise.crow@gmail.com>2013-12-04 09:32:43 +0000
commitc9f34235a0c249b8c99f895c0ffc50ccbfe20f99 (patch)
treed5e9357a02fe50f15c6e0b52f87d1e5c81edf8d9
parent90fd2c06e48c17909b9a7d2aae6d01c41047b4de (diff)
Raise limit on results to 1000.
Seems like you have to specify a limit with xapian. We'll probably want to document the limit somewhere on this page.
-rw-r--r--app/controllers/application_controller.rb4
-rw-r--r--app/controllers/request_controller.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 161a82b26..ff21cb114 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -369,9 +369,9 @@ class ApplicationController < ActionController::Base
return page
end
- def perform_search_typeahead(query, model)
+ def perform_search_typeahead(query, model, per_page=25)
@page = get_search_page_from_params
- @per_page = 10
+ @per_page = per_page
query_words = query.split(/ +(?![-+]+)/)
if query_words.last.nil? || query_words.last.strip.length < 3
xapian_requests = nil
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index e00483df8..a5f333128 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -45,7 +45,7 @@ class RequestController < ApplicationController
def select_authorities
if !params[:public_body_query].nil?
- @search_bodies = perform_search_typeahead(params[:public_body_query], PublicBody)
+ @search_bodies = perform_search_typeahead(params[:public_body_query], PublicBody, 1000)
end
if !params[:public_body_ids].nil?
if !params[:remove_public_body_ids].nil?