Rewrite search query generation for clarity.