aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/request_controller.rb
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2012-01-11 11:53:40 +0000
committerSeb Bacon <seb.bacon@gmail.com>2012-01-11 11:56:26 +0000
commitba07a044614a1648eaa176436346a3aed7f4ac74 (patch)
tree871b9f83fd6056d043ee57c34f50dcd9e9a3cb88 /app/controllers/request_controller.rb
parent93d75fa0b2b572a495a3fb7a91d52ee25effb948 (diff)
Fix problem with typeahead searches containing " - " characters and similar. Closes #328
Diffstat (limited to 'app/controllers/request_controller.rb')
-rw-r--r--app/controllers/request_controller.rb8
1 files changed, 1 insertions, 7 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index f3bbd6708..6e33fe043 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -755,13 +755,7 @@ class RequestController < ApplicationController
# Since acts_as_xapian doesn't support the Partial match flag, we work around it
# by making the last work a wildcard, which is quite the same
query = params[:q]
- query = query.split(' ')
- if query.last.nil? || query.last.strip.length < 3
- @xapian_requests = nil
- else
- query = query.join(' OR ') # XXX: HACK for OR instead of default AND!
- @xapian_requests = perform_search([InfoRequestEvent], query, 'relevant', 'request_collapse', 5)
- end
+ @xapian_requests = perform_search_typeahead(query, InfoRequestEvent)
render :partial => "request/search_ahead.rhtml"
end