Skip to content

Instantly share code, notes, and snippets.

@nz
Created July 31, 2013 20:48
Show Gist options
  • Save nz/6126021 to your computer and use it in GitHub Desktop.
Save nz/6126021 to your computer and use it in GitHub Desktop.
Hashtat brainstorming with @tinasoul
class Tattoo
searchable do
text :title
text :description
text :studio
text :body_location
string :body_location do
body_location.split(/ /)
end
end
def self.search(query, params={})
solr_search do
# prepare the search
# query for documents and score and ranking
fulltext query do
minimum_match '20%'
end
# filter to limit the documents being searched
with(:gender, params[:gender]) if params[:gender]
with(:body_location, params[:body_location]) if params[:body_location]
# preparing the response
# respond with facet details
facet :body_location
# highlight option
# sorting
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment