Commit b5cd51789ca29228ea773f2e911682baab40f2e9
1 parent
a9dcd2e6
Exists in
master
and in
29 other branches
Fix for ActsAsSearchable not recognizing schema_name option correctly
Showing
1 changed file
with
3 additions
and
2 deletions
Show diff stats
lib/acts_as_searchable.rb
@@ -32,9 +32,10 @@ module ActsAsSearchable | @@ -32,9 +32,10 @@ module ActsAsSearchable | ||
32 | pg_options[:page] ||= 1 | 32 | pg_options[:page] ||= 1 |
33 | pg_options[:per_page] ||= 20 | 33 | pg_options[:per_page] ||= 20 |
34 | options[:limit] ||= pg_options[:per_page].to_i*pg_options[:page].to_i | 34 | options[:limit] ||= pg_options[:per_page].to_i*pg_options[:page].to_i |
35 | - options[:scores] ||= true; | 35 | + options[:scores] ||= true |
36 | + options[:filter_queries] ||= [] | ||
36 | all_facets_enabled = options.delete(:all_facets) | 37 | all_facets_enabled = options.delete(:all_facets) |
37 | - query = !schema_name.empty? ? "+schema_name:\"#{schema_name}\" AND #{query}" : query | 38 | + options[:filter_queries] << "schema_name:\"#{schema_name}\"" unless schema_name.empty? |
38 | results = [] | 39 | results = [] |
39 | facets = all_facets = {} | 40 | facets = all_facets = {} |
40 | 41 |