You can split the searching function and display result to be shown in two windows by using simple HTML form function if API available, otherwise the session ID will break the result.
Great example can be Google Custom Search. For example, if you click my name beside this post, you will land to my blog; where there is a Search box. If you input something and hit the search button, you will land to second page with result, which is essentially of Google. We can do it as Google Custom Search allows to do so. That is there is separate huge documentation of API.
This is an example HTML code which is used to collect query and land to a separate webpage :
For the widget, the prototype code needed for a text widget is :
<input type="button" name="search" value="Search" onclick="window.open('/?page_id=41')">
<input type="hidden" name="realname" value="$Name" />
And you need to land them to
cubadaddy.com/?page_id=41 (example) for showing up the results - that is an external webpage. So you need to iframe the results to make as if the results are from your website :
// Fetches data from $Name field
// custom code goes here
You can check any traditional HTML coding website like W3Schools for more info.