Skip to content

Instantly share code, notes, and snippets.

@DimaD
Created March 11, 2010 17:36
Show Gist options
  • Save DimaD/329402 to your computer and use it in GitHub Desktop.
Save DimaD/329402 to your computer and use it in GitHub Desktop.
Sunspot.search(Person) do
keywords(query_string) do
boost_fields query_boost_fields
highlight(*fields_to_highlight.push(:fragment_size => default_highlight_fragment_size))
end
facet(:class)
#
# Very ugly hack to allow facets for all data types
#
adjust_solr_params do |params|
params[:fq] = ["{!tag=type_filter}type:Person"]
params[:"facet.field"] = ["{!ex=type_filter}class_name"]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment