I would like to retrieve a nested object from documents in my index called "userprofiles".
My UserProfile model:
public class UserProfileModel
{
public string FullName { get; set; }
public string Oid { get; set; }
public string Upn { get; set; }
public List<SsoLink> FavoriteSsoLinks { get; set; } = new List<SsoLink>();
}
My SsoLink Model:
public class SsoLink
{
public string Id { get; set; }
public string Name { get; set; }
public string Url { get; set; }
public string Owner { get; set; }
}
Index creation:
PUT userprofiles
{
"mappings" : {
"properties" : {
"FavoriteSsoLinks" : {
"type" : "object"
}
}
}
}
My Query:
var searchResponse = _client.Search<UserProfileModel>(s => s
.Index(_profileIndex)
.Query(q=>q
.Term(t => t.Field(t => t.Oid).Value(oid)
)
)
);
Right now it returns the documents, but the favoritelinks object is blank, however I see objects listed from Kibana. I must be missing something obvious, but having trouble figuring this out.
Here is an example of my data:
