From 64381d5786c883a41fad3b099a3059e97f96445e Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Thu, 19 Jan 2012 12:34:10 +0000 Subject: Disable Xapian wildcards Do not use FLAG_WILDCARD or FLAG_PARTIAL anywhere, because wildcard searches can crash the whole server as per http://trac.xapian.org/ticket/350 (e.g. http://www.whatdotheyknow.com/body/search_ahead?query=app will crash the server prior to this commit.) This is a temporary fix while we investigate the possibilities of the set_max_wildcard_expansion() method, which should make it possible to alleviate this issue. --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers/application_controller.rb') diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 0c8544932..c639bece1 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -387,7 +387,7 @@ class ApplicationController < ActionController::Base ActsAsXapian.query_parser.default_op = Xapian::Query::OP_OR user_query = ActsAsXapian.query_parser.parse_query( query, - Xapian::QueryParser::FLAG_LOVEHATE | Xapian::QueryParser::FLAG_PARTIAL | + Xapian::QueryParser::FLAG_LOVEHATE | Xapian::QueryParser::FLAG_SPELLING_CORRECTION) xapian_requests = ActsAsXapian::Search.new([model], query, options, user_query) ActsAsXapian.query_parser.default_op = old_default_op -- cgit v1.2.3