[ic] Re: table drive component template for complex searches

Paul Jordan interchange-users@icdevgroup.org
Tue Jun 11 01:43:00 2002


> Barry Treahy, Jr. wrote:
>
> > I need to create a component for page construction, preferably table
> > driven, what will allow for choices to be made from radio, check box,
> > and entered values.  There are enough similarities between our product
> > lines that being table driven could make this task much simpler in the
> > long run.
> >
> > An subset example from one of our product lines would need these types
> > of choices:
> >
> > Frequency:
> >    [   ] 26.5 Ghz
> >    [X] 18.0 Ghz
> >    [X] 12.4 Ghz
> >    [   ] 11.0 Ghz
> >
> > Power Rating:
> >    [X] 2 watts
> >    [X] 5 watts
> >    [   ]O 10 watts
> >
> > Interface Genders:
> >    *  Male/Female
> >    O Female/Female
> >    O Male/Male
> >
> > Low VSWR:    [  ]
> >
> > Attenuation value:  ______
> >
> > And then with the input from this dynamically created form, a search
> > would need to be constructed to scan through the products table.  A
> > side note, the intent isn't to search for a precise hit through  a
> > description or title column as individual metric columns for each
> > parameter exist, but rather reduce the 30,000 SKU's and infinite
> > choice combinations down to a manageable few SKU's and then present
> > those SKU's to the prospective buyer.
> > Before I attempt to do something that has already been created by
> > someone else who wouldn't mind sharing their efforts, has any one done
> > any thing like this?
> >
> > Can anyone provide a push start on this or at least a recommended
> > direction to head?
>
> I've been forging ahead on this, perhaps a case of the
> blind-leading-ones-self, but so far I have a form establish which is not
> data driven as I had hoped, at least not yet :-)
>
> I'm still trying to figure out how to handle the content selection.  I
> have the following search:
>
>   <input type=hidden name="mv_searchtype" value="db">
>   <input type=hidden name="mv_sort_field" value="category">
>   <input type=hidden name="mv_sort_field" value="sku">
>   <input type=hidden name="mv_sort_field" value="">
>   <input type=hidden name="mv_coordinated" value="yes">
>   <input type=hidden name="mv_search_map" value="
> mv_searchspec=FREQMAX
> mv_searchspec=POWER
> mv_searchspec=VSWR
> mv_searchspec=BODY
> mv_searchspec=GENDERS
> mv_searchspec=INTERFACES
> mv_searchspec=DBRANGES">
>   <input type=hidden name="mv_search_field" value="freqmax">
>   <input type=hidden name="mv_search_field" value="power">
>   <input type=hidden name="mv_search_field" value="vswr">
>   <input type=hidden name="mv_search_field" value="body">
>   <input type=hidden name="mv_search_field" value="genders">
>   <input type=hidden name="mv_search_field" value="interfaces">
>   <input type=hidden name="mv_search_field" value="dbranges">
>
> by gleaning hints from the archives and docs, it does select product but
> the challenge I'm running into is that first, this should be an AND
> reduction between the fields, yet the returned results appear to be an OR.
>
> Additionally, the water is murkied because within the field such as
> POWER, if the person checks that he wants to see both 2 and 5 watt
> choices, the search seems to be applying an AND to the field search
> where I really need the logic to operate as an OR.
>
> So, so summarize where I need to reach, each field test if non-black
> needs to reduce the results selected in an AND test between themselves.
>  Within each field, if multiple choices are available, each choice needs
> to be considered as an OR test:
>
>     (FREQMAX eq 18 OR FREQMAX eq 12.4) AND (POWER eq 2 or POWER eq 5)
> and BODY eq STD
>
> for example...
>
> Anyone???
>
> Barry


Hi Barry!

I think a possibly easier approach would be to collect input in a regular
form, pass it to a results page.

It sounds like you will have complicated searches, as do I, as different as
they may be. One possibility might be to have the criteria that facilitate
being searched numerically, utilize <= and >= operators.

> >    [   ] 26.5 Ghz
> >    [X] 18.0 Ghz
> >    [X] 12.4 Ghz
> >    [   ] 11.0 Ghz

I don't know how many different GHz we are talking about, but if you only
have 4, then in the db they can be known as 26, 18, 12, and 11 respectively.
Substitution on the flyage etc etc will be neccessary.

That all ofcourse is only if IC won't play well with NN.N values. If it
does, maybe you could for example WRT the above generate on the recieveing
page


..... more here
sf=freqmax
se=18.0
op=<=
nu=1
sf=freqmax
se=12.4
op=>=
nu=1
..... more here

Thus in a sense creating a psuedo OR search within a AND search. I learned
recently that it is wise to not only search the db with search criteria, but
let it build parts of the search for you.

There is also mv_range_look but I am pretty sure you can't use it WITH
coordinated searches.

HTH

Paul

PS, If I remember correctly there is an example of your above search map in
advancedsearch.html