[ic] SQL + search_region
Jamie Neil
jamie at versado.net
Mon May 24 16:39:27 EDT 2004
Mike Heins wrote:
> Sounds like mostly you want to pre-do the search with SQL, and
> then display it with the search-region. This can easily be done
That's exactly what I want to do. That way I can use a single search
results template and code the searches as action maps (somehow feels
neater than putting the sql in the pages).
> by formatting a $Search->{labelname} object, then passing it
> on with [search-region label=labelname]. I believe you want
> to have at least:
>
> my $ary = [ [ 'return1', 'return2', ] ];
> my $n = scalar @$ary;
> $Search->{$label} = {
> matches => $n,
> mv_results => $ary,
> mv_matchlimit => 20,
> mv_field_names => [ 'field1', 'field2', ],
> };
>
Hmm - I'm a bit fuzzy on arrayrefs and hashrefs. Could you give an
simple example using the query tag, or is it as simple as just
substituting $ary for a query tag and plugging the return field names
into the array at the bottom?
Thanks,
--
Jamie Neil | <jamie at versado.net> | 0870 7777 454
Versado I.T. Services Ltd. | http://versado.net/ | 0845 450 1254
More information about the interchange-users
mailing list