ernie/meta_search — Issue #81: more then one .search(params)
Author: renius
Created: 2011-12-08 12:12:55+00:00
State: open

if i have many params, like
a = {"brand_id_in"=>["12"], "year" => "1991"} serialized from form through params[:search]
b = {"brand_id_in"=>["46"], "year" => "1992"} serialized from form through params[:search]
c = {"brand_id_in"=>["53"], "year" => "1993"} serialized from form through params[:search]

to get first result i need to do Model.search(params[:search]) i can get 10000 enties this way, so i paginate it by page(params[:page]) and get only 10 entries
but if i want to get search by (a and b and c) i can go by two ways
first i can get three search results without LIMIT and OFFSET but it take long time 10000 entries + 10000 entryes ... and then paginate it
second: i can get every search result with LIMIT and OFFSET but i can`t repaginate it on next page 10+10+10 but first of all it take three Model Load, its longer then one complex query, second: i need to repaginate 30 entry into 10 per page manualy