I've stumbled upon this question while trying to achieve something similar. I believe the following solves your problem:
Use a file to record all executed commands. Thanks to Eli Bendersky for his post, I use his code as it is, the only change is setting the filename in $PERSISTENT_HISTORY_FILE.
Install fzf with key bindings (I'm unsure if installation via package manager sets key bindings, but via git and install script does).
Change __fzf_history function in fzf/shell/key-bindings.bash to:
__fzf_history__() {
local output opts script
opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} -n2..,.. --scheme=history --bind=ctrl-r:toggle-sort ${FZF_CTRL_R_OPTS-} +m --read0"
script='BEGIN { $/ = "\n"; $HISTCOUNT = $ENV{last_hist} + 1 } s/^[ *]//; print $HISTCOUNT - $. . "\t$_" if !$seen{$_}++'
output=$(
tac $PERSISTENT_HISTORY_FILE |
last_hist=$(HISTTIMEFORMAT='%F %T ' builtin history 1) perl -n -l0 -e "$script" |
FZF_DEFAULT_OPTS="$opts" $(__fzfcmd) --query "$READLINE_LINE"
) || return
READLINE_LINE=${output#*| }
if [[ -z "$READLINE_POINT" ]]; then
echo "$READLINE_LINE"
else
READLINE_POINT=0x7fffffff
fi
}
Obviously, you can make your own function stripping the code above from fzf specifics and binding it to ctrl+r.