Hi.
I want to create a new document in elastic search with golang.
my code :
_, err := s.client.Index().Index("profile").Type(typ).Id(user.ID).BodyJson(user).Do(ctx)
if err != nil {
return err
}
this function listen from nats and then create the document .
but when i want create a document show this error :
err="elastic: Error 404 (Not Found): [profile][p-mehrdad]: document missing
[type=document_missing_exception]"
but when i want update a document with this code it is ok :
_, err := s.client.Update().Index("profile").Type(typ).Id(user.ID).Doc(user).Do(ctx)
if err != nil {
return err
}
can you help me ?