I have a php classifieds website (mostly) and I am currently using MYSQL as a database.
Later on I will use SOLR or maybe Sphinx as a “search engine”.
I want to make it possible for users to view “results” of searches they have made before, but I don’t know where to start…
How is this done?
Currently I have a form which is filled in and when submitted, the php just checks agains a mysql table to see if there are any matches.
Should I store the ‘Search criteria’ and do a new search every time the users click on one of their previous searches, or should I store the results? I would prefer to make a new search because new items may have been inserted since the last search!
If you need more input, just let me know and I will update this Q.
Thanks
Well… if you’re basically talking about “saved searches”, I’m doing something similar currently so that I just have a separate table where….
saved_search_id (primary) | user_id (foreign) | search_name | criteria1 | criteria2 | criteria3 … etc
So basically I can now display to the user a list of saved searches they’ve created, and the table stores the criteria that were part of that search. I can then use those saved criteria to run a saved search anytime.
Does that help?