Created
July 31, 2013 20:48
-
-
Save nz/6126021 to your computer and use it in GitHub Desktop.
Hashtat brainstorming with @tinasoul
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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