[ic] Calling all search gurus

Dan Browning interchange-users@interchange.redhat.com
Thu Aug 9 17:54:01 2001


At 12:38 PM 8/9/2001 -0700, you wrote:
>Hi all -
>
>Using IC 4.6.5 with MySQL.  Need to do a form-based search, something like 
>this:
>
>mv_search_field="field1,field2,field3,field4"
>mv_searchspec="foo"
>
>mv_search_field="field5"
>mv_searchspec="1"
>
>I need to find all products which have /foo/ in any of the corresponding 
>fields, AND do not have '1' in the other field.  I thought this would be a 
>simple coordinated search:
>
><input type=hidden name=mv_searchtype value=db>
><input type=hidden name=mv_coordinate value=yes>
>
><input type=hidden name=mv_search_field value="field1,field2,field3,field4">
><input type=text name=mv_searchspec value="foo">
><input type=hidden name=mv_column_op value=rm>
><input type=hidden name=mv_numeric value=0>
>
><input type=hidden name=mv_search_field value="field5">
><input type=hidden name=mv_searchspec value=1>
><input type=hidden name=mv_column_op value="!=">
><input type=hidden name=mv_numeric value=1>
>
>..but it does not work.  The problem is the multiple search fields in the 
>first group - if I search just one field, it works fine - multiple fields 
>completely break the search.  Somehow I need to tell IC that "foo" in 
>field1 OR field2 OR ... etc. is acceptable for the first group - it 
>appears to be applying 'AND' logic to the list of fields instead.
>
>Perhaps this can be done with an SQL statement? But I would rather not 
>rely on searching products.txt, I prefer to search the db directly.
>
>Thanks in advance for any suggestions!
>
>- Ed L.

I wasn't sure what you meant by:

 >But I would rather not rely on searching products.txt, I prefer to search 
the db directly.

You must be referring to: 4.5. Specifying a Text-Based Search with SQL-Like 
Syntax
( http://ic.redhat.com/cgi-bin/ic/dev/icdatabase_26.html )

I think a better solution then either of the above is to simply collect the 
<input> on the first page and do a [query] in mv_nextpage.  Anyone else 
have a suggestion?

Dan Browning, Cyclone Computer Systems, danpb@mail.com