【发布时间】:2014-01-02 12:08:15
【问题描述】:
我在问如何根据文档上的两个不同嵌套属性创建索引。我正在通过 C# 执行这些查询。
public class LocationCode
{
public string Code {get;set;}
public string SeqId {get;set;}
}
public class ColorCode
{
public string Code {get;set;}
public string SeqId {get;set;}
}
public class TestDocument
{
public int Id {get;set;}
public List<LocationCode> Locations { get; set; }
public List<ColorCode> Colors { get; set; }
}
我尝试过各种 AbstractIndexCreationTask、Map 和 Map+Reduce,但都无济于事。
我希望能够进行如下查询:
获取任何 Locations.Code 属性为“USA”、AND/OR Colors.Code="RED" 或 SeqId 属性的所有文档。我不知道这是否意味着我需要多个索引。通常我要么比较两个嵌套类的 Code 属性,要么比较 Seq,但从不混合。
请有人指出正确的方向。
非常感谢 菲尔
【问题讨论】: