0

I want to partially update the elasticsearch record. I have created methods for Indexing but it basically overwrites the full document. I have a scenario where I want to partially update the record. Can anyone please point me to how this can be accomplished. This is the method I have for Indexing.

 public async Task<IIndexResponse> IndexAsync<T>(T data, string indexName, string typeName) where T : class
    {
        if (indexName == null)
        {
            throw new ArgumentNullException("Index name is null. Please provide index name to insert the data.");
        }

        return await Client.IndexAsync<T>(data, i => i
            .Index(indexName)
            .Type(typeName)
            .OpType(OpType.Create));
    }
Hussain ali
  • 491
  • 3
  • 7
  • 21
  • 2
    Maybe these([1](https://stackoverflow.com/a/39029907/290460), [2](https://stackoverflow.com/a/38479067/290460)) answers will put some light on your problem. – Rob May 26 '17 at 07:01
  • Thanks for the reference posts. I figured out how to implement update. – Hussain ali May 30 '17 at 00:42
  • You should call "Update" method. Take a look [here](https://stackoverflow.com/questions/38462229/partial-update-elastic-search-nest-2-x) – Mahdi Feb 04 '18 at 08:34

0 Answers0