[ic] Trouble with coordinated search to test for inactive

Ron Phipps rphipps at reliant-solutions.com
Wed Apr 7 14:20:52 EDT 2004


> From: Paul Jordan
> 
> Ron Phipps [rphipps at reliant-solutions.com] wrote:
> >> From: Stefan Hornburg
> >>
> >> On Tue, 6 Apr 2004 20:57:45 -0700
> >> "Ron Phipps" <rphipps at reliant-solutions.com> wrote:
> >>
> >>> Hello,
> >>>
> >>> I have the following fields in my products table:
> >>>
> >>> sku
> >>> title
> >>> short_description
> >>> long_description
> >>> import_inactive
> >>> user_inactive
> >>>
> >>> A user would like to search by keyword for the value 'test'.  I
> >>> would like to show all products where import_inactive = 0 and
> >>> user_inactive = 0 and either sku, title, short_description or
> >>> long_description contain "test".  I've tried several different
> >>> search strings, but have yet to come up with one which satisfies
> >>> all of these requirements.  Any ideas?
> >>
> >> co=1
> >> sf=import_inactive
> >> se=0
> >> op===
> >> sf=user_inactive
> >> se=0
> >> op===
> >> lf=sku
> >> ls=%test
> >> lf=title
> >> ls=%test
> >> ....
> >>
> >> Untested, please watch your SQL logfile for the search statement.
> >>
> >> Bye
> >> 	Racke
> >
> > Hi Racke,
> >
> > Thanks for the pointers.  I gave your code a try and came up with
the
> > same thing as my other tests.  The resulting query is WHERE
> > import_inactive = 0 AND user_inactive=0 AND sku like 'test%' AND
title
> > like 'test%'.  This fails because both sku and title do not contain
> > that string.  Is it possible to set os (mv_orsearch) for only part
of
> > the search (between the like tests)?  I'm thinking my best bet may
be
> > to just use query for this search page...
> >
> > Thanks,
> > -Ron
> >
> 
> I went down this path a while ago:
> 
> http://www.icdevgroup.org/archive/interchange-users/2002/msg09270.html
> 
> I ended up using a mysql query. If your worried about the text portion
of
> the
> search, mysql 4.0 is said to be better with them, I do not know about
yak
> postgres.
> 
> Otherwise you could probably do it with two searches. To bad you could
not
> link
> itl searches. i.e., find this, then find this within that, then find
this
> within that. You could of course manually :)
> 
> Paul
> 

Hi Paul,

I read your thread and many others last night and was just being
stubborn figuring there has to be a way :)  I just wrote a query page in
10x less the time I experimented with the built in search.  Take it
easy!

-Ron



More information about the interchange-users mailing list