Rethinking search as code generation