Skip to content

Instantly share code, notes, and snippets.

@jonpaul
Created October 18, 2011 17:12
Show Gist options
  • Save jonpaul/1295980 to your computer and use it in GitHub Desktop.
Save jonpaul/1295980 to your computer and use it in GitHub Desktop.
orgs_array.each do |uid|
search_results[uid] = Listing.search do
query {
boolean do
should { term :short_description, search_terms}
should { term :full_description, search_terms}
should { term :manufacturers_name, search_terms}
should { term :manufacturers_part_num, search_terms}
should { term :suppliers_name, search_terms}
should { term :suppliers_part_num, search_terms}
should { term :klass_attributes, search_terms}
end
}
filter :terms, :organization_id => ["#{uid}"]
facet 'companies' do
terms :organization_id
end
end
search_results[uid][:organization] = Organization.find_by_id(uid)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment