You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Oliver Eilhard edited this page Feb 13, 2018
·
13 revisions
Services are the functional units that enable you to interact with Elasticsearch. To invoke a service, you need to have a client first.
Services usually come with a variety of methods to prepare the query and a Do function to execute it against the
Elasticsearch REST interface and return a response. Here is an example of the IndexExists service that checks if a given index already exists.
exists, err:=client.IndexExists("twitter").Do(context.Background())
iferr!=nil {
// Handle error
}
if!exists {
// Index does not exist yet.
}