I have a DTO with a property of type Dictionary<string, string>
. It's not annotated. When I upload my DTO and call indexClient.Documents.Index(batch)
, I get this error back from the service:
The request is invalid. Details: parameters : A node of type 'StartObject' was read from the JSON reader when trying to read the contents of the property 'Data'; however, a 'StartArray' node was expected.
The only way I've found to avoid it is by setting it to null. This is how I created my index:
var fields = FieldBuilder.BuildForType<DTO>();
client.Indexes.Create(new Index
{
Name = indexName,
Fields = fields
});
How can I index my dictionary?
question from:https://stackoverflow.com/questions/66054883/how-to-insert-map-into-azure-search-index