Created
March 14, 2014 18:58
-
-
Save jlsherrill/9554412 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/controllers/katello/api/v2/api_controller.rb b/app/controllers/katello/api/v2/api_controller. | |
index d5bc7c5..8857125 100644 | |
--- a/app/controllers/katello/api/v2/api_controller.rb | |
+++ b/app/controllers/katello/api/v2/api_controller.rb | |
@@ -88,6 +88,7 @@ module Katello | |
@search_service.model = item_class | |
options[:per_page] = 1 | |
options[:facets] = {facet_name => term} | |
+ options[:facet_filters] = options[:filters] | |
@search_service.retrieve('', 0, options) | |
diff --git a/app/models/katello/glue/elastic_search/items.rb b/app/models/katello/glue/elastic_search/items.rb | |
index a1a074d..f25736c 100644 | |
--- a/app/models/katello/glue/elastic_search/items.rb | |
+++ b/app/models/katello/glue/elastic_search/items.rb | |
@@ -57,6 +57,7 @@ module Glue | |
all_rows = false | |
sort_by = search_options.fetch(:sort_by, 'name_sort') | |
sort_order = search_options[:sort_order] || 'ASC' | |
+ facet_filters = search_options[:facet_filters] || {} | |
total_count = 0 | |
sort_by = format_sort(sort_by) | |
@@ -96,8 +97,9 @@ module Glue | |
if search_options[:facets] | |
search_options[:facets].each_pair do |name, value| | |
- facet name do | |
+ facet(name, :facet_filter => facet_filters) do | |
terms value, :size => facet_size | |
+ | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment