[ic] filtering search results or refining results or searching within results

Mike Heins interchange-users@icdevgroup.org
Sat Sep 14 16:27:03 2002


Quoting Jeff Dafoe (jeff@badtz-maru.com):
> Hello,
> 
>  When on the results page, I want to be able to refine the current search by
> adding additional search parameters to the current search and then reissuing
> this new, more qualified search.  The issue I am having is that I cannot
> determine what the proper way to retrieve the current (complex) search
> parameters from the results page is.  Any insight would be great, even if it
> is just the vaguest of pointers, like "it's contained in this data structure
> and you will have to rebuild the query string yourself" or "look at the code
> in blah blah" or something.

You *can* access the search object, but I am not sure how much
good it will do you.

[search-region label=mysearch]
[search-list]
	[item-foo ...] [item-bar ...] [item-etc ...]

[/search-list]
[/search-region]


[calc]
	my $obj = $Search->{mysearch};

	return $Tag->uneval({ref => $obj});

	my @out;
	if($obj->{mv_coordinate}) {
		push @out, "It was a coordinated search";
	}
	push @out, "Search type was " . $obj->{mv_searchtype};
	push @out, "Searched: " . join ",", @{$obj->{mv_search_file}};
	push @out, "Search fields were " . join ",", @{$obj->{mv_search_field}};
	push @out, "Search specs were " . join ",", @{$obj->{mv_searchspec}};

	return join "<br>", @out;
[/calc]

Probably the best way to do it is to use $Session->{last_search}. But you
have to do that at the very top of the page if you want to make sure
you get the one that came in via the form. 
Then concatenate your refinements to it.

There is help on the way in 4.9, which has a new "Search reference" 
capability. Basically, it allows you to save all search results like
a more list and then specify that your next search only search within
the previously returned results.

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.513.523.7621      <mike@perusion.com>

Function in chaos, finish in style. -- Unknown