[ic] Search with form fields help required

Stefan Hornburg Racke interchange-users@lists.akopia.com
Sat Jun 9 15:37:00 2001


jean-pierre.parent@bridgepoint-intl.com writes:

> Hello everyone,
> 
> I've been using the demo search without troubles until now. I recently
> added a new field
> in the products table that tells me if the product is "inactive" which
> happens to be the name
> of the field.
> 
> Now, when i do a search I need to check for the string but after adding the
> inactive field I also
> have to check for inactive products.
> 
> I use a 2 page model:
> 
> Page #1 - Simplified
> 
> <form action="[area search]" method="post">
> 
> <input type=hidden name=mv_searchtype value="db">
> <input type=hidden name=mv_matchlimit value="30">
> <input type=hidden name=mv_sort_field value="category_code">
> <input type=hidden name=mv_search_field value="description comment title
> sku">
> 
> <input type=text name=mv_searchspec value="">
> 
> </form>
> 
> Page #2 - Simplified
> 
> [search-region]
> [search-list]
> ...code to display results here...
> [/search-list]
> [/search-region]
> 
> My question (finally) is how can I ALWAYS check for "inactive = N" with
> form fields WHILE still
> searching for the string specified in the text field? Is it possible?

Yes, at least with Interchange 4.7.x. I use the following (products
should be found only if sell=1):

<form method=post action="[process-search]">
<input type="hidden" name="mv_session_id" value="[data session id]">
<input type="hidden" name="mv_profile" value="basic">
<input type="hidden" name="mv_check" value="fast">
<input type="hidden" name="mv_return_fields" value="idf,partnumber">
<input type="hidden" name="mv_coordinate" value="yes">
&nbsp;<br>&nbsp;<input type="text" name="searchpro" size="11">&nbsp;<input type="submit" name="mv_doit" value="[L]Go[/L]">
</form>

Now the profiles basic and fast (OrderProfile):

__NAME__ basic
mv_searchtype=sql
mv_search_file=component
mv_coordinate=yes
mv_substring_match=yes
mv_sort_field=partnumber
mv_matchlimit=25
mv_more_alpha=yes
__END__

__NAME__ fast
[perl]
$out = 'mv_search_field=' . 
       join("\0",'sell','partnumber','description','manufacturer','remarks') . "\n";
$out .= 'mv_searchspec=' . join("\0", 1, (($CGI->{searchpro}) x 4)) . "\n";
$out .= 'mv_search_group=' . join("\0", 0, ((1) x 4)) . "\n";
$out .= 'mv_orsearch=' . join("\0", 0, ((1) x 4)) . "\n";
$out .= 'mv_substring_match=' . join("\0", 0, ((1) x 4)) . "\n";
$out;
[/perl]
__END__

Ciao
		Racke

-- 
Master of Swiss Web 2001: http://www.zweifel.ch/

For projects and other business stuff please refer to COBOLT NetServices
(URL: http://www.cobolt.net; Email: info@cobolt.net; Phone: 0041-1-3884400)