[ticket/10737] Code fixes in AJAX search feature

PHPBB3-10737