Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think, I did great!</p> <p>Answering to my question:</p> <ol> <li><p>From first main search page, if I run a search query, on the movies table and get 300 records as a result from 5000 movies in the table then I dynamically create a view in the mysql database from rails method, AR::Base.connection.execute() which holds the movie_ids of the 300 searched movies.</p></li> <li><p>Now moving on, in the second page if the user filters 300 results based on language or genre, I narrow down my search, doing a search on the created view and not the MOVIES table again. This is done by getting the language_id and genre_id from the url after passing it to a link_to helper.</p></li> <li><p>I get a session_id from every browser and append an alphabet in front of that id which will be used as my view name. </p></li> <li><p>If the user visits the home page or gets past the search page and finds the exact product, I will drop my view and i will keep a timeout to drop my view say 1 hour and every day I will drop the views created the day before.</p></li> </ol> <p>I heard from Ryan that persisting an User search is a good practice. I was interested in that as well. Now I think I have implemented it. Please hit me with all the negatives in my approach, Im trying to run a company here.</p> <p>Thanks!</p> <p>Edit:</p> <p>Forgot my gratitude to Ashitaka. Of course I have added will_paginate gem. Its working alright.</p> <p>TIP: In will_paginate, if you are listing out 83 movies with :per_page => 10, then you wont be able to display the total number of movies in the first page of 9 pages(10+10+....+3). If you wish to do it like Movies(83). Then, @movies.total_entries.to_s helps. </p> <p>Thanks to you too!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload