I have a problem in Azure search, I get data from a csv file in blob storage. To simplify let assume my object as:
public class Instrument
{
public Identifier Identifier { get; set; }
[SearchableField(IsSortable = true, IsKey = true)]
public string Id { get; set; }
[SearchableField(IsSortable = true)]
public string RefIs { get; set; }
}
public class Identifier
{
[SearchableField(IsSortable = true)]
public string Code { get; set; }
}
when I receive my data it's flat in the csv such as : _id,_ref,_code.
When I create my index through SDK I setup Mapping for simple Fields:
indexer.FieldMappings.Add(new FieldMapping("_ref")
{
TargetFieldName = "RefIs"
});
but I cannot figure out the way I declare it to complex type in my indexer ? given code does not work for it :
indexer.FieldMappings.Add(new FieldMapping("_code")
{
TargetFieldName = "Code"
});
indexer.FieldMappings.Add(new FieldMapping("_code")
{
TargetFieldName = "Identifier.Code"
});
error is the same TargetField is not present in index.
Could someone help ?