func (chef *Chef) Search(index, query string) (*SearchResults, error) {
	return chef.NewSearchQuery(index, query).Execute()
}
chef.Search accepts an index and a query and returns a *Chef.Search results
type as well as an error indicating if the request was successful or not

Usage:

results, err := chef.Search("nodes", "hostname:memcached*")
if err != nil {
fmt.Println(err)
os.Exit(1)
}
// do what you please with the "results" variable which is of the type
// *Chef.SearchResults
fmt.Println(results)
package chef
import (
	"encoding/json"
	"fmt"
	"strconv"
)
type SearchParams struct {
	Index string
	Query string
	Sort  string
	Rows  int
	Start int
	chef  *Chef
}
type SearchResults struct {
	Total int               `json:"total"`
	Start int               `json:"start"`
	Rows  []json.RawMessage `json:"rows"`
}
func (chef *Chef) GetSearchIndexes() (map[string]string, error) {
	resp, err := chef.Get("search")
	if err != nil {
		return nil, err
	}
	body, err := responseBody(resp)
	if err != nil {
		return nil, err
	}
	results := map[string]string{}
	json.Unmarshal(body, &results)
	return results, nil
}
func (chef *Chef) NewSearchQuery(index, query string) *SearchParams {
	params := new(SearchParams)
	params.Index = index
	params.Query = query
	params.Rows = -1
	params.Start = -1
	params.chef = chef
	return params
}