issue #23323: two bugfixes for new search method