1

I am trying to implement a search on my website. Getting started, I have some beginner questions.

  1. If I use a pagination script, does those scripts find all results when search is triggered and simply display the results as pages?
  2. Is it better to keep the keywords in a session variable and do search, bring say 10 results everytime user hits "More results" Button?

Thanks for any insights.

1
  • It is useful question for me too. Commented Oct 31, 2012 at 0:12

1 Answer 1

2
  1. Unless you cache the results the first time the search is run, the "paged" results generally re-run the search query, then throw away the rows that aren't being displayed
  2. There's no point in using a session variable to store the keywords, unless you don't plan on displaying the search box alongside the results (e.g. as Google search result pages do).
Sign up to request clarification or add additional context in comments.

3 Comments

Understood #1. About #2, I was thinking: If I save the keywords, then I can limit the search to say 10 results, and if user clicks on 'more', I can redo a search LIMIT 10,20. Or you think that is not a good idea?
that'd be part of #1, actually.
Thanks for the response. Getting started on it now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.