Jump to content

general question - 2nd search to further filter results


turpentyne

Recommended Posts

I'm ready for the next step on my site, which is learning how to filter results down with a second search.

 

The scenario is: A viewer searches for a plant by 4 variables to describe the leaf. After submit, they go to the results page, with 200 paginated results. (This is where I've gotten to)

 

Now, on that same page, they choose to further narrow their results by searching those 200 results for plants that have purple flowers. Maybe they get 40 results and can use another variable to narrow further - and so on.

 

What's the best way to set this up? I've been looking into temporary tables, but it seems to be a challenge because the table deletes the moment they leave that page or close the connection? Sessions seem like another possibility, but I read there's security issues.

 

What's the best way to set this up? Just re-query the database with the entire set of variables from both the first and second searches? is it quicker to build some type of permanent table with a timestamp that I can use to delete it after the user has gone away?

 

 

 

 

Link to comment
Share on other sites

This is kind of difficult because I don't know how you search or databases are set up, but if they are set up how I have imagined its something like

 

click search and it does a SELECT * FROM table WHERE leaf = round

 

then maybe the second search to narrow it down further would be like

 

SELECT * FROM table WHERE leaf = round, color = purple

 

narrow down further

 

etc

Link to comment
Share on other sites

Ok, let me throw a little more into the mix and see if that still works.

 

It's a database of 300,000 entries x 4 tables. The 4 tables are for different categories. A table for description, one for uses, etc.

 

Is it still fast to just rerun the same query with added search words, like you suggest, or is there a quicker way? This is where I'm wondering if temp tables work or some other method so the query isn't searching the entire database again.

 

Or maybe it takes just as long or longer to build the temp table and search that?

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.