Skip to content

Instantly share code, notes, and snippets.

@mwmitchell
Created May 18, 2009 18:37
Show Gist options
  • Save mwmitchell/113661 to your computer and use it in GitHub Desktop.
Save mwmitchell/113661 to your computer and use it in GitHub Desktop.
# 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