search with begin and end parameter