Reputation: 77
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 ?
Upvotes: 0
Views: 112
Reputation: 77
The best way to overcome is to parse your .csv file your own way and then post documents to ACS using exposed API. This is the best effective way (do not rely on builtin serialiser)
Upvotes: 1