Skip to content

Instantly share code, notes, and snippets.

@ahawkins
Created January 27, 2011 02:58
Show Gist options
  • Save ahawkins/797984 to your computer and use it in GitHub Desktop.
Save ahawkins/797984 to your computer and use it in GitHub Desktop.
- search_form_for(@customer_search) do |form|
= form.keywords
= form.search_fields
= form.highlight_options
= form.conditions
= form.order_options
= form.pagination_options
= form.buttons
# this is a class to test to see if the
# search container is correctly
# detected from the class name
class CustomerSearch < SolrSearch::Search
# Set the form configurations options
#
# configuration do |form|
# form.order_option do |option|
# options.attribute_name 'sort_name'
# options.label 'Name'
# end
#
# form.order_option do |option|
# options.attribute_name 'sort_company'
# options.label 'Company'
# end
# end
#
# run do
# keywords 'double legit programmers'
# highlight :name, :bio
#
# condition do |c|
# c.match :salary
# c.more_than 100000
# end
#
# condition do |c|
# c.match :exprience
# c.between 2..4
# end
#
# condition do |c|
# c.match :skills
# c.all_of %w(ruby cucumber rspec jquery)
# end
#
# condition do |c|
# c.match :accounts
# c.any_of %w(twitter github)
# end
#
# match :all # or match any
#
# order :rate
# per_page 50
# end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment