[ic] Actionmap 2 table problem

Peter peter at pajamian.dhs.org
Wed Jun 27 11:04:10 UTC 2012


On 27/06/12 21:43, IC wrote:
>>> I have an actionmap which *should* search 2 product tables for word $w1,
>>> however it only searches the last listed table, have I missed something?
>>>
>>>      $CGI->{mv_todo} = 'search';
>>>      $CGI->{mv_nextpage} = $Config->{SpecialPage}->{results};
>>>      $CGI->{mv_searchtype} = 'db';
>>>      $CGI->{mv_coordinate} = 'yes';
>>>      $CGI->{mv_substring_match} = 'yes';
>>>      $CGI->{mv_search_page} = 'results';
>>>
>>>      $CGI->{mv_search_file} = 'products';
>>>      $CGI->{mv_search_field} = "inactive\0description";
>>>      $CGI->{mv_searchspec} = "1\0$w1";
>>>      $CGI->{mv_column_op} = "ne\0rm";
>>>
>>>      $CGI->{mv_search_file} = 'products2';
>>>      $CGI->{mv_search_field} = "inactive\0description";
>>>      $CGI->{mv_searchspec} = "1\0$w1";
>>>      $CGI->{mv_column_op} = "ne\0rm";
>>>
>>>      $CGI->{mv_matchlimit} = '15';
>>>      $CGI->{mv_sort_field} = 'sale_price';
>>>      $CGI->{mv_sort_option} = 'n';
>>>
>>
>> First of all I would rather do a native SQL query than fight
>> with Interchange's search parameters.
>>
>> Second you just overwrite the settings in $CGI->{mv_search_file}
>> et al.
>>
>> Please try to specify multiple tables in $CGI->{mv_search_file}
>> as follows:
>>
>> $CGI->{mv_search_file} = 'products,products2';
> 
> Hi Racke,
> 
> Thanks for the suggestion but that still only searches the first table
> before the comma, I think I may have already tried that in one of my
> iterations.
> 
> Any other suggestions?

Right, because mv_coordinate is set, the first set of search params
looks like: products:inactive ne 1
...and the second looks like: products2:description rm $w1

You can do this with an IC search, but you really are much better off
using an SQL query like racke suggests.


Peter



More information about the interchange-users mailing list