Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Custom search
class HomeController < ApplicationController
class MovieSearch < FortyFacets::FacetSearch
model 'Movie' # which model to search for
custom :for_manual_handling
def index
@search =, Movie.all) # this initializes your search object from the request params
if @search.filter(:custom_filter).value.present?
@search =, Movie.near(...))
@movies = @search.result.paginate(page: params[:page], per_page: 5) # optionally paginate through your results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.