Fix advance search issue

Fixes RM-2722