meta_search icon indicating copy to clipboard operation
meta_search copied to clipboard

more then one .search(params)

Open renius opened this issue 13 years ago • 0 comments

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

renius avatar Dec 08 '11 12:12 renius