[ic] Numeric Search

Kevin Walsh kevin at cursor.biz
Wed Jun 15 12:12:41 EDT 2005


Mark Bryant [mark at eros-shop.co.uk] wrote:
> At 16:30 14/06/2005, you wrote:
> > I can't seem to figure out how to get this numeric search to work. I
> > have products priced at 0.00 and I want to create a search that will
> > not display them. So I tried this:
> > scan/fi=products/st=db/co=1/sf=suggested_retail/se=0.00/op=>/nu=1/ml=50.html
> > 
> > No luck. I was hoping someone knows a way around this.
> > 
> Assuming you have a suggested_retail field/col to search on in your DB,
> change the > to gt in the line to get that to work :)
> 
> scan/fi=products/st=db/co=1/sf=suggested_retail/se=0.00/op=gt/nu=1/ml=50.html
> 
The ">" operator is correct for numeric searches.  The "gt" operator
would be for string searches.  "0.00" isn't really necessary;  "0" will
suffice in a numeric search, but that doesn't really matter. :-)

>
> Failing that try setting sf=price if your pricing info is stored there.
> Worked for me when I tried it a few mins ago although it doesn't seem to
> take into account TAX settings/values.
> 
It worked for me too, with sf=price, so perhaps there's a problem with
the "suggested_retail" column.  Perhaps that column hasn't been defined
in the appropriate dbconf file, or whatever.  The search won't take tax
into account;  It'll only match the values in the specified column.

A more flexible solution would be to mark products as "inactive".  In
that case, they won't appear in search results regardless of any other
parameters. This might be better than setting the price to zero for that
purpose.  In your dbconf file, for the products table, you'd add the
following - if not present already:

    Database  products  COLUMN_DEF   "inactive=CHAR(1) DEFAULT ''"
    Database  products  HIDE_FIELD   inactive

If the "inactive" column is true (not zero and not blank) then the row
will not appear in search results, otherwise it will - depending upon
the other search criteria, of course.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin at cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/



More information about the interchange-users mailing list