How to set a id using ElasticClient

To avoid duplicates I like to give a document ID to each data set into Elastic.

As described at the documentation I like to set a ID while adding a item to Elastic. The description recommend to set the ID like this:

PUT /{index}/{type}/{id}

But I'm using the ElasticClient and I'm adding items like this:


I don't know how to set the Index here. I thought about some thing like


but I cant find a method like that.

How can I add the ID using the IElasticClient object?

Assuming you are using java to index documents, the docs are here

I'm using C# .NET.

To set the Id I extend my _doc class with the property Id.
Than I set the Id.

        doc.Id = myId;

So I don't get any duplicates at the Elastic anymore.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.