Created
January 27, 2011 02:58
-
-
Save ahawkins/797984 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
- 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 file contains hidden or 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
# 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