more then one .search(params) #81

renius opened this Issue Dec 8, 2011 · 0 comments


None yet
1 participant

renius commented Dec 8, 2011

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[: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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment