[ic] Complex search

Mike Heins interchange-users@icdevgroup.org
Wed Nov 20 09:42:00 2002


Quoting Jean-Christophe Plat (jc.p@sudway.fr):
> Hello all,
> 
> I have a search that return products from two categories.
> The following works fine :
> st=db
> co=1
> os=1
> sf=category
> se=CD
> op=eq
> sf=category
> se=DVD
> op=eq
> 
> Then I would like to check for the inactive field but everything I try fail. 
> The following return nothing
> sf=inactive
> se=1
> op=ne
> 
> I thing I don't undestand the operators's precedence. 
> Is it possible to use both OR and AND statement in the same search ? 
> eg : (cat1 OR cat2) AND ! inactive
> 

The easiest thing to do is to use a SQL query and its syntax. But
you can do it with a bit of difficulty with Interchange's search
language:

    st=db
    co=1

    sf=inactive
    se=1
    op=ne
    os=0
    sg=0

    sf=category
    se=CD
    op=eq
    os=1
    sg=1

    sf=category
    se=DVD
    op=eq
    os=1
    sg=1
     
    sr=0 and 1

sr is mv_search_relate, which allows you to relate searches for specs
placed in a group with sg/mv_search_group.

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.513.523.7621      <mike@perusion.com>

I am a great believer in luck, and I find that the harder I work
the more luck I have. -- Thomas Jefferson