1

I want to let user choose the number of search results that should be displayed in a search page powered by apache solr. The current setup I have only lets the admin choose the number of results to be displayed. Has anyone worked on such functionality before?

  • If its an admin setting it will probably use variable_get and set. Just look up the name of that variable and in search query where the variable is being used use another variable where the variable is user specific. – GoodSp33d Jun 19 '12 at 9:01
  • I was thinking about doing something like this. I want even the anonymous user also have his setting saved. Hence I am thinking about setting this variable in the session cookie. Do you see any pitfalls? – char_x0r Jun 19 '12 at 11:14
  • Not really, for anonymous you can use cookies but for authenticated you can make use of DB to store them permanently. Be sure to add else condition if none of the above returns values so that it defaults to admin settings. – GoodSp33d Jun 19 '12 at 11:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.