Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Search for Links in Multiple Categories

Quote Reply
Search for Links in Multiple Categories
Hi-

I'm trying to set up a search form that allows users to search for links that are listed in several categories. For example if a single link is listed in several categories:

Category ID 1: California
Category ID 2: Service A
Category ID 3: Service B
Category ID 4: Service C

Then I would like users to be able to search for links that match all of their selected specific criteria, for example:

The user wants to find links that are in California, offering Service A, and Service C. This would then bring back the links that are listed in the California Category AND the Service A Category AND the Service C category.

So the search line might look like:

http://www.domain.com/links/search.cgi?catid=1&catid=2&catid=4

and it would only return the links that are in all three of these specified categories.

Does anyone know if something like this is possible?

-FrankM
Quote Reply
Re: [FrankM] Search for Links in Multiple Categories In reply to
I'm sure it's possible.

It would simply be a matter of passing in an "AND" to the "condition" object, and then populating the fields you want searched on.

It _might_ need to be done in the code, but it _may_ be able to be done simply by passing in the required fields, and setting the bool=AND parameter.

Did you try using several select fields, and setting bool=and ?


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [FrankM] Search for Links in Multiple Categories In reply to
Oh....

You said 'categories' ... that would be somewhat tougher, and would require probably a new subroutine to find the CatID then match a category that was listed with all those ID's.

It would be much easier to put the services offered in the Link record itself, maybe using a set of check boxes, and then search on those FIELDS in each link record.

You'd get a _lot_ better performance out of it as well.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.