Skip to content
Ryo Nakao edited this page Mar 23, 2018 · 4 revisions

The Delete service removes a document from an index.

// Delete tweet with specified ID
ctx := context.Background()
res, err := client.Delete().
    Index("twitter").
    Type("tweet").
    Id("1").
    Do(ctx)
if err != nil {
    // Handle error
    panic(err)
}
if res.Found {
    fmt.Print("Document deleted from from index\n")
}
Clone this wiki locally