[ic] OR search on subcategories (revised)

Mike Heins mikeh@minivend.com
Thu, 7 Dec 2000 07:15:37 -0500


Quoting John Nealy (jnealy@symetrek.com):
> Sorry about the bad reply,folks, it was a rough day.  Also forgot to say I am using PostgreSQL
> 6.5 for the
> database on RH 6.0.
> What I did try so far was the following:
> Using the UI I put in
> 
> fi=products
> st=db
> co=yes
> os=yes
> sf=subcategory
> se=All
> op=eq
> sf=subcategory
> se=Motorola
> op=rm
> rf=*
> 
> Which returns the message "No match found for All Motorola".
> 
> Next I replaced that code with sq=select * from products where subcategory =
> 'All' or subcategory like 'Motorola' and I got the same message.  I am
> working on the assumption that in the UI I do not need the [loop] or [query]
> tags because they will be generated.  Is this correct?  Thanks so much for
> the help and patience.

You need two os=1 parameters --- they do cascade. The value applies to
the left-hand side of the term it is used for. I suppose I could shift
them one....it didn't occur to me. I can't really do it different now,
it would kill anyone who already is using it.

If you want to make absolutely sure:

[loop search="
     fi=products
     st=db
     co=yes

     os=yes
     sf=category
     se=Hammers
     sg=0
     op=eq

     sf=category
     se=brushes
     op=rm
     sg=1

     sr=0 or 1

     rf=*
"][loop-code] [loop-description]<BR>
[/loop]

The mv_search_relate allows you to do complex groupings like:

	sr=((0 and 1) or (2 and ! 3) ) or 4

One of these days I will put in the code to map SQL statements to the
sr= search relation.

I think I will put in an ag= parameter to automatically generate groups
sequentially...

-- 
Akopia, Inc., 131 Willow Lane, Floor 2, Oxford, OH  45056
phone +1.513.523.7621 fax 7501 <heins@akopia.com>

Fast, reliable, cheap.  Pick two and we'll talk.  -- unknown