I've asked a couple of other questions about parts of this issue, but I haven't explained the whole thing. I think I'm going down rabbit holes on specific issues; but if I explained the whole thing, perhaps someone could point me in a different, more productive direction.
I have a search page using the simple_form tag. By default, it searches in the products channel. But we want a mechanism which allows users to alternatively search in the blog channel. So when they arrive on the search_results page, in addition to the search results, we also display Product and Blog links. The Product link is highlighted, to show we're displaying product results. If the user clicks the Blog link, jQuery takes over, changes a hidden field called search_type to "blog", and clicks the search button on the search form.
This brings us back to the search_results page, but now we've passed the "blog" flag as a hidden field. We pick it up using stash:get, and use the search_type as the channel parameter in the search:simple_form tag...
Well, that's how it should work, anyhow. As I was writing that last bit, it occurred to me that the channel parameter had been parsed some time ago, so when we hit the search button, the channel is already encoded in teh hidden fields. (I'm guessing that's how it works.)
OK, so how would I handle this product/blog search thing? I've been going round in circles for over a day. Thanks for your help.