I tried meta_search, but after adding "include MetaSearch::Searches::ActiveRecord" into my model, it raised an error as "undefined method `joins_values'" when run "MyModel.search(params[:search])"
I think I dont need full text, so I think following gems are not suitable for my project now:: mongoid_fulltext mongoid-sphinx sunspot_mongoid mongoid_search
I tried a old gem named scoped-search I can make it work for example:
get :search do
@search = Notification.scoped_search(params[:search]
search_scope = @search.scoped
defaul_scope = current_user.notifications
result_scope = search_scope.merge defaul_scope
@notifications = result_scope
render 'notifications/search'
end
but it will be allow to call any scopes in my model.
Is there any "best practice" for doing this job ?