My domain objects are like:
public class MainType {
public int Id {get;set;}
public string Name {get;set;}
public List<TypeA> A_List {get;set;}
public List<TypeB> B_List {get;set;}
... other properties
}
public class TypeA {
public int Id {get;set;}
public string Name {get;set;}
... other properties
}
public class TypeAMapping {
public int TypeAId {get;set;}
public int MainTypeId {get;set;}
public int DisplayOrder {get;set;}
}
public class TypeB {
public int Id {get;set;}
public string Name {get;set;}
... other properties
}
public class TypeBMapping {
public int TypeBId {get;set;}
public int MainTypeId {get;set;}
public int DisplayOrder {get;set;}
}
Azure Search index documents does not support for complex types so I need to flatten these all classes into a model as described here.
So, I created a class like this one:
public class MainTypeDocumentModel {
public int Id {get;set;}
public string Name {get;set;}
public List<string> A_Id_List {get;set;}
public List<string> A_Name_List {get;set;}
public List<string> A_DisplayOrder_List {get;set;}
public List<string> B_Id_List {get;set;}
public List<string> B_Name_List {get;set;}
public List<string> B_DisplayOrder_List {get;set;}
... other properties
}
The problem is I also need to process DisplayOrder
property of the mapping classes. Which the documentation does not cover.
I can create queries to search MainTypeDocumentModel
filtered by A_Id_List
and/or B_Id_List
. But I need to sort the documents (or score higher) with the values in X_DisplayOrder_List
property of the documents.
I checked the Scoring Profile docs from Microsoft but couldn't figure out how to implement for this scenario.