js: Avoid running multiple search queries in the same plugin