【发布时间】:2016-10-12 17:37:44
【问题描述】:
我的域对象是这样的:
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 搜索索引文档不支持复杂类型,因此我需要将这些所有类扁平化为一个模型,如 here 所述。
所以,我创建了一个这样的类:
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
}
问题是我还需要处理映射类的DisplayOrder 属性。文档未涵盖的内容。
我可以创建查询来搜索由A_Id_List 和/或B_Id_List 过滤的MainTypeDocumentModel。但我需要使用文档的X_DisplayOrder_List 属性中的值对文档进行排序(或得分更高)。
我查看了来自 Microsoft 的 Scoring Profile 文档,但不知道如何针对这种情况实施。
【问题讨论】:
-
您能否详细说明您要完成的工作?从问题上看不清楚。谢谢!
-
编辑了问题。谢谢。
标签: azure azure-cognitive-search