<% if current_site.opened? %>
Sitemap: <%= sitemaps_url(format: :xml) %>
<% else %>
User-Agent: *
Disallow: /
<% end %>

<% if current_site.opened? %>
Sitemap: <%= sitemaps_url(format: :xml) %>
Noindex: /search
<% else %>
User-Agent: *
Disallow: /
<% end %>

Set "Noindex: /search" in robots.txt
Set "Noindex: /search" in robots.txt
