// Generated from search-count_0e44c19403fbd14f97b84c8afffbe4c1_test.go
//
[source, go]
----
{
	res, err := es.Index(
		"twitter",
		strings.NewReader(`{
	  "user": "kimchy"
	}`),
		es.Index.WithDocumentID("1"),
		es.Index.WithRefresh("true"),
		es.Index.WithPretty(),
	)
	fmt.Println(res, err)
}

{
	res, err := es.Count(
		es.Count.WithIndex("?q=user:kimchy"),
		es.Count.WithQuery("user:kimchy"),
		es.Count.WithPretty(),
	)
	fmt.Println(res, err)
}

{
	res, err := es.Count(
		es.Count.WithIndex(""),
		es.Count.WithBody(strings.NewReader(`{
	  "query": {
	    "term": {
	      "user": "kimchy"
	    }
	  }
	}`)),
		es.Count.WithPretty(),
	)
	fmt.Println(res, err)
}
----
