Here is the revised code:

```ruby
  def index
    if params[:template] == "true"
      @contacts = []
      @contacts[0] = Contact.example      
    else
      @search_criteria = params[:search]
      @contacts = @search_criteria.blank? ? current_group.contacts.order(:last_name) : contact_search_results
    end
    @contact = Contact.new
    1.times { @contact.notes.build }
    respond_to do |format|
      format.html
      format.csv { render csv: @contacts }    
  end
```
```ruby
  private

    def contact_search_results
      current_group.contacts.search_by_contact_info(@search_criteria).order(:last_name) | current_group.contacts.tag_search(@search_criteria).order(:last_name)
    end
```