Regarding official GoLang client of elasticsearch

I was using olivere Elasticsearch-golang client for my project.
But i came across https://www.elastic.co/guide/en/elasticsearch/client/go-api/current/index.html .
Here is an example of code:
https://github.com/elastic/go-elasticsearch

in this,

for _, hit := range r["hits"].(map[string]interface{})["hits"].([]interface{}) {
    log.Printf(" * ID=%s, %s", hit.(map[string]interface{})["_id"], hit.(map[string]interface{})["_source"])
  }

how do i perform source filtering?
I figured out i have to use WithSourceIncludes() function, but for some reason i am not able to use that function.
can you help me out here.

Thanks

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.