Not quite sure if I understand exactly what you want, but one of these should help..
If you want to display a search form at the top of single topics add the following to your functions.php file:
function my_bbp_topic_search_form(){
?>
<div class="bbp-search-form">
<?php bbp_get_template_part( 'form', 'search' ); ?>
</div>
<?php
}
add_action( 'bbp_template_before_single_topic', 'my_bbp_topic_search_form' );
If you want a search form at the top of single forums (or sub forums) use the following in your functions.php file:
function my_bbp_forum_search_form(){
?>
<div class="bbp-search-form">
<?php bbp_get_template_part( 'form', 'search' ); ?>
</div>
<?php
}
add_action( 'bbp_template_before_single_forum', 'my_bbp_forum_search_form' );
If you want to limit results to the topic or forum in question that will be a little more tricky but the following post will point you in the right direction (it shows you how to limit searching to a single forum – you’ll need to customise further to apply it to a single topic): http://sevenspark.com/tutorials/how-to-search-a-single-forum-with-bbpress.
Hope that helps.
I know this is an old thread but it was the one I came across when searching for a solution. I managed to use the link above and create a solution that will only search current and sub forums / topics. You can find it here.