search:fix query string in add-to-search functionality [continue]

Continue pull request #2305 here (because of the wrong branching strategy).