close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Methods for building dynamic filter searching

Thread began 9/04/2012 11:46 am by alnico431299 | Last modified 9/07/2012 2:00 pm by alnico431299 | 3074 views | 6 replies |

alnico431299

Methods for building dynamic filter searching

I am investigating methods for building dynamic filter searching such as Zappos, Amazon (I guess they call these faceted searches) with php/mysql.

Scenario:

1. I have a list of search parameters (checkbox’s, radio’s, etc), that belong to filterForm. A search query would be built by adding or subtracting parameters as they are selected and query the server upon each selection.
2. I also need to get the count of hit/matches for each parameter in the filterForm, regardless if they are selected or not.

So essentially, I need to query for matches and return a dataSet AND simultaneously get each parameter count for the active dataSet.

Method’s:

1. Request two separate queries in succession, I believe this is wasteful and prone to inaccurate counts?
2. Use a Stored Procedure (capable of returning two dataSets from same Select)?
3. Request match dataset and create session variable containing array of parameter/counts?
4. Use php to split the dataset into two?

These are just ideas; I am not sure what is at all possible here…

Looking for direction, suggestions and how this may be tied into DataAssist; if at all?

Thanks,
Brent

Sign in to reply to this post

Jason ByrnesWebAssist

This can be done using Data Assist Search to create the search form.

you first create a results page that is unfiltered, then run the data assist search wizard to create the search form. the search wont take place as conditions are selected though, the form would need to be submitted manually for the flittering to occur.

Sign in to reply to this post

alnico431299

Creating a search form with results page is not the issue here, that is pretty straight forward.
Upon selecting each filter...I would submit the form using jquery, not to difficult either.

The issue is getting the record count for all filters based on the returned recordset; all in a single operation; without having to fire off two repetitive (wasteful) queries (one for the results page and the other, filter counts; both share a large part of the same query).

Here is an example...

database table: worldFlags
====================
1 America
2 Britain
3 Canada

Filters (initial state):
===============
Red (0)
White (0)
Blue (0)
Green (0)

Filters (state after selecting Blue):
==========================
Red (3)
White (3)
Blue (2)
Green (0)

Records returned matching Blue:
=========================
1 America
2 Britain

Each time a filter is selected it must return two sets of information...the Records that match the query and the counts for that recordset.

So, back in my original post I describe some methods that could be used???

Hopefully you understand what I am trying to accomplish ;-)

Sign in to reply to this post

Jason ByrnesWebAssist

the basic dreamweaver pagination that is added to the results page will show a total count.

something like "Showing record 1 - 10 of 248" this is a basic function of the Dreamweaver paging controls.

Sign in to reply to this post

alnico431299

Jason...that is not at all what I am trying to achieve here.

Perhaps this is to difficult to explain in writing. All I can add is that I am building a multi-faceted(checkboxes) search where you can drill down on a recordset dynamically via checkboxes...which returns a results page AND match counts for EACH facet(checkbox).

This essentially gives me my matches I searched for and also I am able to see each checkbox with a match count behind it; if the count is zero I will know that I am not able to drill down on the recordset further...alternatively other checkboxes may have a count greater than zero, where I may continue to drill down.

So again, I am looking for methods as explained in my first post.

Sign in to reply to this post

Jason ByrnesWebAssist

Here is a tutorial i found through google that uses Sphinx to do something similar to what i think you are talking about:
faceted-search-with-sphinx/

Sign in to reply to this post

alnico431299

Yep, I have Googled and found many docs including the one you mentioned...the setup is overly complex for what I need (I do not need full text search, etc).

This is a very common search method and can be complex to setup.

Thanks,
Brent

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...