How to use _mtermvectors endpoint in NEST C#?

In elasticsearch help at
Multi term vectors API | Elasticsearch Guide [8.11] | Elastic
there is an _mtermvectors endpoint like this

POST /twitter/tweet/_mtermvectors
{
"ids" : ["1", "2"],
"parameters": {
"fields": [
"message"
],
"term_statistics": true
}
}

What is the corresponding call in NEST
I tried

var res = Client.MultiTermVectors(new MultiTermVectorsRequest("twitter", "tweet")
{
TermStatistics = true
});

How can i specify the ids array? Thanks for the help!

Used the lowlevel call like below if anyone needs it

string sbRequestBody = "{\"ids\":[\"1\", \"2\"],\"parameters\":{\"fields\": [\"message\"],\"term_statistics\":true}}";			
var termvecResponse =Client.LowLevel.Mtermvectors<MultiTermVectorsResponse>("twitter", "tweet", sbRequestBody);

foreach (var doc in termvecResponse.Body.Documents)
			{
				var item = doc.TermVectors["message"];

				Console.WriteLine("Document: {0}",doc.Id);
				foreach (var term in item.Terms)
				{
					Console.WriteLine("{0}: {1}", term.Key, term.Value.TermFrequency);

				}
			}

High level call:

var tvecR = client.MultiTermVectors(new MultiTermVectorsRequest("twitter", typeof(tweet))
{
    Fields = Infer.Fields<tweet>(f => f.Body), // all docs will use these fields
    Documents = idRange.Select(n => new MultiTermVectorOperation<tweet>(n)
    {
        TermStatistics = true
    })
});

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