function search_filter($query) {
if ( !is_admin() && $query->is_main_query() ) {
if ($query->is_search) {
$query->set('paged', ( get_query_var('paged') ) ? get_query_var('paged') : 1 );
$query->set('posts_per_page',1);
}
}
}
add_action( 'pre_get_posts', 'search_filter' );