def METHOD_NAME(direction: SearchDirection, count: int = 1) -> None:
    """
    Apply search, but keep search buffer focused.
    """
    assert is_searching()
    layout = get_app().layout
    # Only search if the current control is a `BufferControl`.
    from prompt_toolkit.layout.controls import BufferControl
    search_control = layout.current_control
    if not isinstance(search_control, BufferControl):
        return
    prev_control = layout.search_target_buffer_control
    if prev_control is None:
        return
    search_state = prev_control.search_state
    # Update search_state.
    direction_changed = search_state.direction != direction
    search_state.text = search_control.buffer.text
    search_state.direction = direction
    # Apply search to current buffer.
    if not direction_changed:
        prev_control.buffer.apply_search(
            search_state, include_current_position=False, count=count
        )