Created
May 18, 2009 18:37
-
-
Save mwmitchell/113661 to your computer and use it in GitHub Desktop.
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
# set default params here for each of the SolrDocument methods (search, find_document, opensearch etc..) | |
SolrDocument.default_params[:search] = {:qt=>:search} | |
class MyController < ApplicationController | |
include Controller::Solrizable | |
# call the #search method on SolrDocument when the #index action is executed | |
# this also creates the #index action as well as some other helpers. | |
# controller.solr_index_params is automatically created and exposed as a view helper. | |
solrize :index, :search do | |
{ | |
:q => params[:q], | |
:phrase_filters => params[:f], | |
:rows => params[:rows].to_i.limit(1..100) | |
} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment