Skip to content

Commit

Permalink
Refs #11753 - remove elastic search from content view filter rules
Browse files Browse the repository at this point in the history
  • Loading branch information
cfouant committed Nov 6, 2015
1 parent 05d0124 commit 26cbfb4
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 107 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ class Api::V2::ContentViewFilterRulesController < Api::V2::ApiController
api :GET, "/content_view_filters/:content_view_filter_id/rules", N_("List filter rules")
param :content_view_filter_id, :identifier, :desc => N_("filter identifier"), :required => true
def index
options = sort_params
options[:load_records?] = true
options[:filters] = [{ :terms => { :id => ContentViewFilter.rule_ids_for(@filter) } }]

@search_service.model = ContentViewFilter.rule_class_for(@filter)
respond(:collection => item_search(ContentViewFilter.rule_class_for(@filter), params, options))
ids = ContentViewFilter.rule_ids_for(@filter)
results = ids.map { |id| ContentViewFilter.rule_class_for(@filter).find(id) }
collection = {
:results => results.uniq,
:subtotal => results.count,
:total => results.count
}
respond :collection => collection
end

api :POST, "/content_view_filters/:content_view_filter_id/rules",
Expand Down
2 changes: 0 additions & 2 deletions app/models/katello/content_view_erratum_filter_rule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module Katello
class ContentViewErratumFilterRule < Katello::Model
self.include_root_in_json = false

include Glue::ElasticSearch::ContentViewErratumFilterRule if SETTINGS[:katello][:use_elasticsearch]

belongs_to :filter,
:class_name => "Katello::ContentViewErratumFilter",
:inverse_of => :erratum_rules,
Expand Down
2 changes: 0 additions & 2 deletions app/models/katello/content_view_package_filter_rule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module Katello
class ContentViewPackageFilterRule < Katello::Model
self.include_root_in_json = false

include Glue::ElasticSearch::ContentViewPackageFilterRule if SETTINGS[:katello][:use_elasticsearch]

belongs_to :filter,
:class_name => "Katello::ContentViewPackageFilter",
:inverse_of => :package_rules,
Expand Down
2 changes: 0 additions & 2 deletions app/models/katello/content_view_package_group_filter_rule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module Katello
class ContentViewPackageGroupFilterRule < Katello::Model
self.include_root_in_json = false

include Glue::ElasticSearch::ContentViewPackageGroupFilterRule if SETTINGS[:katello][:use_elasticsearch]

belongs_to :filter,
:class_name => "Katello::ContentViewPackageGroupFilter",
:inverse_of => :package_group_rules,
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ def permissions

def setup
setup_controller_defaults_api
@request.env['HTTP_ACCEPT'] = 'application/json'
@request.env['CONTENT_TYPE'] = 'application/json'
@fake_search_service = @controller.load_search_service(Support::SearchService::FakeSearchService.new)
models
permissions
end
Expand Down

0 comments on commit 26cbfb4

Please sign in to comment.