Sorry for “$” bug. I’m embarrassed.
realted http://wordpress.org/support/topic/how-to-display-the-number-of-search-results-found-redux
and maybe:
<?php
$number_of_posts = $wp_query->post_count;
if (have_posts()) :
while (have_posts()) : the_post();
if ($number_of_posts == 1)
{
header("Location: ".$get_permalink());
}
...the loop...
?>