-
Couldn't load subscription status.
- Fork 1.2k
Closed
Labels
Description
Elastic.Clients.Elasticsearch version:9.1.0
Elasticsearch version:9.1.0
.NET runtime version:.net 9.0
Operating system version: Windows 11
Description of the problem including expected versus actual behavior:
The fields property on TermVectorsRequestDescriptor is serialized incorrectly. If there are only one field, the request is :
{"fields":"test_field"} it should be: {"fields":["test_field"]}
Steps to reproduce:
This code causes a badrequest:
var termVectorsRequestDescriptor = new TermVectorsRequestDescriptor<MyDocument>(indexName)
.Id(hit.Id)
.Preference(NodePreferenceHelper.GetNodePreference(node))
.Fields(new[]{Field.FromString("test_field")});
var termVectorResult =
await _elasticsearchClient.TermvectorsAsync(termVectorsRequestDescriptor, cancellationToken);
Expected behavior
The request is serialized as {"fields":["test_field"]}