<?php 

function frannamag_adjust_query( $query ) {

	if( !is_admin() AND is_search() AND $query->is_main_query() ) {
		$query->set( 'post_type', array( 'post', 'page' ) );
	}

}

add_action( 'pre_get_posts', 'frannamag_adjust_query' );