module Workarea # Checking for SearchSuggestions this way ensures the constant # loads, if possible, before deciding whether to decorate. if !!(Search::SearchSuggestions rescue nil) decorate Search::SearchSuggestions, with: :content_search do def query super.tap do |query| query[:bool][:must_not] = { term: { type: 'content' } } end end end end end