[ic] Search Filtering

Barry Treahy, Jr. Treahy at MMaz.com
Thu Jul 22 20:51:16 EDT 2004


daniel castro wrote:

> Hi all,
>
> I know this topic is not new, and it has been posted before, but after 
> countless hours tring to make the search filtering work, with some 
> code I found in the archives, but I must say I am losing my time tring 
> to implement code I dont understand, can some one please help me  out 
> with this. At least a point me out so I can find the solution.
>
> I am tring to filter the search any user would do, the filtering is 
> based on the category that the products ir in.
>
> Also I was able to implement the sorting of the search in all the 
> pages, even though it is not very good for heavy trafic sites. If any 
> one is intrested please let me know.
>
First, it is helpful to know which version and an example of what you 
have tried, as well as the errors that is being returned otherwise you 
have a very good chance of just being ignored since it isn't the lists 
job to do the work for you but to help refine what you are doing...

Here is an example of a loop that does searches of the products table 
based on a variable number of fields that are provided by a prior form:

[loop more=1
        prefix=TRM
        search="
                fi=products
                st=db
                tf=category,sku
                co=yes
                ml=15
                
rf=sku,description,freqmax,power,body,interfaces,genders,dbranges
                ac=0
                sf=prod_group
                op=eq
                se=Terminations
 
                ac=0
                sf=[scratch AllowGroup]
                op=eq
                se=X
 
[if cgi WIRELESS]
                ac=0
                sf=category
                op=rm
                se=Wireless
[/if]
[if cgi FREQMAX]
                ac=0
                sf=freqmax
                op=rm
                se=[scratch FREQMAX]
[/if]
[if cgi POWER]
                ac=0
                sf=power
                op=rm
                se=[scratch POWER]
[/if]
[if cgi VSWR]
                ac=0
                sf=vswr
                op=rm
                se=LOW|1
[/if]
[if cgi BODY]
                ac=0
                sf=body
                op=rm
                se=[scratch BODY]
[/if]
[if cgi GENDERS]
                ac=0
                sf=genders
                op=rm
                se=[scratch GENDERS]
[/if]
[if cgi INTERFACES]
                ac=0
                sf=interfaces
                op=rm
                se=[scratch INTERFACES]
[/if]
"]

If you don't understand the passed parameters values, just remove all of 
the context related to the CGI checks and just focus on the first search 
field which is examining the product group for only terminations...

Barry

-- 

Barry Treahy, Jr                       E-mail: Treahy at MMaz.com
Midwest Microwave                          Phone: 480/314-1320
Vice President & CIO                         FAX: 480/661-7028
                       




More information about the interchange-users mailing list