How do I update an existing document inside ElasticSearch index using NEST?

前端 未结 5 805
一生所求
一生所求 2020-12-24 06:56

I am trying to update an existing indexed document. I have indexed tags, title and owners field. Now when the user changes the title, I need to find and update the document

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-24 07:35

    A better solution in Nest 7.x:

     await _client.UpdateAsync(doc.Id, u => u.Index("movies").Doc(new ElasticSearchDoc { Title = "Updated title!" }));
    

提交回复
热议问题